From 142d2b7e6c8815ef70241d3b3467ca7b78e255b2 Mon Sep 17 00:00:00 2001 From: David Stansby Date: Thu, 31 Dec 2020 15:53:38 +0000 Subject: [PATCH 1/3] Fix dev doc links --- docs/dev_guide/contents/code_standards.rst | 6 +++--- docs/dev_guide/contents/documentation.rst | 2 +- docs/dev_guide/contents/logger.rst | 2 +- docs/dev_guide/contents/maintainer_workflow.rst | 2 +- docs/dev_guide/contents/new_objects.rst | 2 +- docs/dev_guide/contents/newcomers.rst | 4 ++-- docs/dev_guide/contents/remote_data.rst | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/dev_guide/contents/code_standards.rst b/docs/dev_guide/contents/code_standards.rst index 58f64bc3bb6..4fce4692d2b 100644 --- a/docs/dev_guide/contents/code_standards.rst +++ b/docs/dev_guide/contents/code_standards.rst @@ -55,7 +55,7 @@ Formatting We enforce a minimum level of code style with our continuous intergration (the name is ``sunpy.sunpy (python_codestyle [linux]``). This runs a tool called `pre-commit `__. -The settings and tools we use for the pre-commit can be found in the file `.pre-commit-config.yaml` at the root of the sunpy git repository. +The settings and tools we use for the pre-commit can be found in the file :file:`.pre-commit-config.yaml` at the root of the sunpy git repository. Some of the checks are: * Checks (but doesn't fix) various PEP8 issues with flake8. * Sort all imports in any Python files with isort. @@ -146,7 +146,7 @@ Instead of running the pre-commit command each time you can install the git hook $ pre-commit install -which installs a command to `.git/hooks/pre-commit` which will run these tools at the time you do ``git commit`` and means you don't have to run the first command each time. +which installs a command to :file:`.git/hooks/pre-commit` which will run these tools at the time you do ``git commit`` and means you don't have to run the first command each time. We only suggest doing the install step if you are comfortable with git and the pre-commit tool. Documentation and Testing @@ -188,7 +188,7 @@ Any other standard output, warnings, and errors should follow these rules: * For warnings, one should always use ``warnings.warn(message, warning_class)``. These get redirected to ``log.warning()`` by default, but one can still use the standard warning-catching mechanism and custom warning classes. - The warning class should be either class:`~sunpy.utils.exceptions.SunPyUserWarning` or inherit from it. + The warning class should be either class:`~sunpy.util.SunpyUserWarning` or inherit from it. Including C Code ================ diff --git a/docs/dev_guide/contents/documentation.rst b/docs/dev_guide/contents/documentation.rst index 323d10c6ccf..91925a2bf46 100644 --- a/docs/dev_guide/contents/documentation.rst +++ b/docs/dev_guide/contents/documentation.rst @@ -181,7 +181,7 @@ This is particularly useful if you need to cover multiple namespaces in which an In rare circumstances, one may want to insert "raw" HTML directly into the pages written by Sphinx. For HTML that is statically available (i.e., already written in some form), one can use the `"raw" directive `__. -For HTML that is generated by Python code, SunPy provides the custom directive `generate`. +For HTML that is generated by Python code, SunPy provides the custom directive ``generate``. Here's an example RST block:: .. generate:: html diff --git a/docs/dev_guide/contents/logger.rst b/docs/dev_guide/contents/logger.rst index 0445691383b..132d8cd384d 100644 --- a/docs/dev_guide/contents/logger.rst +++ b/docs/dev_guide/contents/logger.rst @@ -62,7 +62,7 @@ A warning can be issued in the following way:: >>> from sunpy.util import SunpyUserWarning >>> warnings.warn("You have been warned about something you did not do correctly.", SunpyUserWarning) # doctest: +IGNORE_WARNINGS -See the section above for a discussion about the distinction between `log.warn()` and `warnings.warn()`. +See the section above for a discussion about the distinction between ``log.warn()`` and :meth:`warnings.warn`. Raising Exceptions ================== diff --git a/docs/dev_guide/contents/maintainer_workflow.rst b/docs/dev_guide/contents/maintainer_workflow.rst index 21ba2008c3c..f2658ff5ac0 100644 --- a/docs/dev_guide/contents/maintainer_workflow.rst +++ b/docs/dev_guide/contents/maintainer_workflow.rst @@ -185,7 +185,7 @@ You do not need to update this file as we use `towncrier`_ to update our changel This is built and embedded into our documentation. Towncrier will automatically reflow your text, so it will work best if you stick to a single paragraph, but multiple sentences and links are OK and encouraged. -You can install towncrier and then run `towncrier --draft` if you want to get a preview of how your change will look in the final release notes. +You can install towncrier and then run ``towncrier --draft`` if you want to get a preview of how your change will look in the final release notes. `Instructions on how to write a changelog. `__. diff --git a/docs/dev_guide/contents/new_objects.rst b/docs/dev_guide/contents/new_objects.rst index 9847fbd406b..886880b958a 100644 --- a/docs/dev_guide/contents/new_objects.rst +++ b/docs/dev_guide/contents/new_objects.rst @@ -13,7 +13,7 @@ The instrument subclass implements the instrument-specific code to parse the met In practice, the instrument subclass is not directly accessed by users. The `~sunpy.map.Map` factory is the primary interface for creating Map objects. -Any subclass of `~sunpy.map.GenericMap` which defines a method named `~sunpy.map.GenericMap.is_datasource_for` will automatically be registered with the `~sunpy.map.Map` factory. +Any subclass of `~sunpy.map.GenericMap` which defines a method named ``is_datasource_for()`` will automatically be registered with the `~sunpy.map.Map` factory. The ``is_datasource_for`` method is used by the `~sunpy.map.Map` factory to check if a file should use a particular instrument Map class. This function can run any test it needs to determine this. For example, it might check the value of the ``INSTRUMENT`` key in the metadata dictionary. diff --git a/docs/dev_guide/contents/newcomers.rst b/docs/dev_guide/contents/newcomers.rst index 4e158af963c..c05c0615452 100644 --- a/docs/dev_guide/contents/newcomers.rst +++ b/docs/dev_guide/contents/newcomers.rst @@ -145,7 +145,7 @@ In order to start coding you will need a local Python environment and we would r This method will bypass your operating system Python packages and makes the entire process easier. The first step is to install the version of conda that corresponds to your operating system and `instructions are here`_. -Next we will want to setup the conda environment and we will need to add the `conda-forge_` channel as a prerequisite: +Next we will want to setup the conda environment and we will need to add the `conda-forge`_ channel as a prerequisite: .. code:: bash @@ -215,7 +215,7 @@ Once you have some changes you would like to submit, you will need to commit the This is a three stage process: 1. Use ``git status`` to see that the only changes locally are the right ones. -2. Use ``git add `` to add the changes to `git`. +2. Use ``git add `` to add the changes to ``git``. 3. Use ``git commit -m `` to label those changes. 4. Use ``git push`` to update your fork (copy) of sunpy on GitHub. diff --git a/docs/dev_guide/contents/remote_data.rst b/docs/dev_guide/contents/remote_data.rst index fe1d700632a..d7bc3f3a0f2 100644 --- a/docs/dev_guide/contents/remote_data.rst +++ b/docs/dev_guide/contents/remote_data.rst @@ -69,7 +69,7 @@ The following example demonstates the usage of the fixture.:: sunpy_cache.add('http://example.com/test_file', 'test_data_path') -The above snippet creates a pytest fixture called `local_cache`. This fixture can be used in wherever the files have to be mocked. +The above snippet creates a pytest fixture called ``local_cache``. This fixture can be used in wherever the files have to be mocked. An example is given below.:: def test_test_function(local_cache): From 9a327da6cc6ccdd25a885db8f1e46c8bf97050f8 Mon Sep 17 00:00:00 2001 From: David Stansby Date: Fri, 1 Jan 2021 11:46:00 +0000 Subject: [PATCH 2/3] Fix changelog doc links --- docs/whatsnew/0.9.rst | 3 ++- docs/whatsnew/1.1.rst | 16 ++++++++-------- docs/whatsnew/2.0.rst | 12 ++++++------ 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/docs/whatsnew/0.9.rst b/docs/whatsnew/0.9.rst index 54975ea994b..e2870c01be9 100644 --- a/docs/whatsnew/0.9.rst +++ b/docs/whatsnew/0.9.rst @@ -13,7 +13,8 @@ SunPy 0.9 brings improved support for downloading data from the JSOC and bugfixe The 0.9.x series will be the last series of SunPy releases to support Python 2. This is because Python 2 `will not be maintained after 2019 `_. The 0.9.x series will receive bugfixs only up until the and of life of Python 2 (around 18 months). -No new functionality will be added to the 0.9.x series, which will also be the last version to include `sunpy.spectra`, `sunpy.lightcurve` and `sunpy.wcs`, all of which were deprecated in 0.8. +No new functionality will be added to the 0.9.x series, which will also be the last version to include +``sunpy.spectra``, ``sunpy.lightcurve`` and ``sunpy.wcs``, all of which were deprecated in 0.8. SunPy 1.0 and higher will support Python 3 only. All new functionality will be available only in SunPy 1.0 and higher. diff --git a/docs/whatsnew/1.1.rst b/docs/whatsnew/1.1.rst index 54f6a491021..7e951601eb0 100644 --- a/docs/whatsnew/1.1.rst +++ b/docs/whatsnew/1.1.rst @@ -141,7 +141,7 @@ SunPy 1.1 provides a data manager for versioning and caching remote files. The objective of this is to provide a way for data required for functions, such as instrument correction routines, to depend on non-local data in a reliable way. The data manager also guarantees that a specific version of the code uses a specific data file, with the ability for users to specify updated files. -This works by providing the URL of a remote file and a SHA256 hash to the `sunpy.data.manager.require ` decorator which can be added to functions that require these specific data files from remote sources. +This works by providing the URL of a remote file and a SHA256 hash to the `sunpy.data.manager.require ` decorator which can be added to functions that require these specific data files from remote sources. If the specified hash does not match that of the remote version, an exception is raised to make the user aware of any changes on the remote server or corruption of local files. Additionally, `sunpy.data.cache ` can be used to avoid re-downloading files that already exist on a user's local machine, thus saving disk space and internet bandwidth. @@ -153,7 +153,7 @@ Support for SUVI Data ===================== The Solar Ultraviolet Imager (SUVI) is a EUV instrument imaging the full disk of the Sun in six passbands, and is onboard the latest of the Geostationary Operational Environmental Satellite (GOES) missions. -`~sunpy.map.SUVIMap` provides SunPy map support for loading SUVI FITS image data, and the `~sunpy.net.sources.goes.SUVIClient` adds support to search for SUVI data hosted by NOAA via `Fido `. It supports searching for wavelength, level of data (level 2 data which consists of stacked level 1b images and original level 1b files), as well as GOES satellite number (>= GOES 16). +`~sunpy.map.sources.SUVIMap` provides SunPy map support for loading SUVI FITS image data, and the `~sunpy.net.dataretriever.SUVIClient` adds support to search for SUVI data hosted by NOAA via `Fido `. It supports searching for wavelength, level of data (level 2 data which consists of stacked level 1b images and original level 1b files), as well as GOES satellite number (>= GOES 16). .. _whatsnew-1.1-WISPR: @@ -183,22 +183,22 @@ We will continue to look for ways to improve import times. Notable Breaking Changes or Removed functionality ================================================= -- Importing `sunpy.timeseries.timeseriesbase` no longer automatically imports +- Importing `sunpy.timeseries` no longer automatically imports Matplotlib. (`#3376 `__) -- `NOAAIndicesTimeSeries.peek` now checks that the `type` argument is a +- `sunpy.timeseries.sources.NOAAIndicesTimeSeries.peek` now checks that the `type` argument is a valid string, and raises a `ValueError` if it isn't. (`#3378 `__) - Observer-based coordinate frames (`~sunpy.coordinates.frames.Heliocentric` and `~sunpy.coordinates.frames.Helioprojective`) no longer assume a default observer (Earth) if no observer is specified. These frames can now be used with no observer specified, but most transformations cannot be performed for such frames. This removal of a default observer only affects `sunpy.coordinates`, and has no impact on the default observer in `sunpy.map`. (`#3388 `__) - The colormap stored in SunPy's Map subclasses (ie. ``map.plot_settings['cmap']``) - can now be colormap string instead of the full `matplotlib.colormap.Colormap` - object. To get the full `Colormap` object use the new attribute + can now be colormap string instead of the full `matplotlib.colors.Colormap` + object. To get the full `~matplotlib.colors.Colormap` object use the new attribute ``map.cmap``. (`#3412 `__) - Fix a warning in `sunpy.map.GenericMap.rotate` where the truth value of an array was being calculated. This changes the behavior of `~sunpy.map.GenericMap.rotate` when the ``angle=`` parameter is not an `~astropy.units.Quantity` object to raise `TypeError` rather than `ValueError`. (`#3456 `__) - Removed the step of repairing images (replacing non-finite entries with local mean) before coaligning them. The user is expected to do this themselves before coaligning images. If NaNs/non-finite entries are present, a warning is thrown. - The function `sunpy.image.coalignment.repair_image_nonfinite` is deprecated. (`#3287 `__) -- The method to convert a `~sunpy.coordinates.frames.Helioprojective` frame from 2D to 3D has been renamed from `~sunpy.coordinates.frames.Helioprojective.calculate_distance` to `~sunpy.coordinates.frames.Helioprojective.make_3d`. This method is not typically directly called by users. (`#3389 `__) + The function ``sunpy.image.coalignment.repair_image_nonfinite`` is deprecated. (`#3287 `__) +- The method to convert a `~sunpy.coordinates.frames.Helioprojective` frame from 2D to 3D has been renamed from ``sunpy.coordinates.frames.Helioprojective.calculate_distance`` to `~sunpy.coordinates.frames.Helioprojective.make_3d`. This method is not typically directly called by users. (`#3389 `__) - `sunpy.visualization.animator.ImageAnimatorWCS` is now deprecated in favour of `~sunpy.visualization.animator.ArrayAnimatorWCS`. (`#3407 `__) - ``sunpy.cm`` has been moved to `sunpy.visualization.colormaps` and will be diff --git a/docs/whatsnew/2.0.rst b/docs/whatsnew/2.0.rst index d7343525c02..2bd7ecdb36a 100644 --- a/docs/whatsnew/2.0.rst +++ b/docs/whatsnew/2.0.rst @@ -62,8 +62,8 @@ So now you can do the following instead:: aiaprep is now deprecated ========================= -With the release of the new `aiapy `__ package, `sunpy.instr.aia.aiaprep` will be removed in version 2.1. -Equivalent functionality is provided by the `register` function in aiapy. For more +With the release of the new `aiapy `__ package, ``sunpy.instr.aia.aiaprep`` will be removed in version 2.1. +Equivalent functionality is provided by the ``register()`` function in aiapy. For more details, see the `example on registering and aligning level 1 AIA images `_ in the aiapy documentation. @@ -81,7 +81,7 @@ In particular: - `sunpy.map.GenericMap.reference_pixel` now returns a zero-based reference pixel. This is one pixel less than the previously returned value. Note that this means the ``reference_pixel`` now does **not** have the same value as the FITS ``CRPIX`` values, which are one-based indices. -- `sunpy.map.make_fitswcs_header` now correctly interprets the `reference_pixel` argument as being zero-based, in previous releases it incorrectly interpreted the `reference_pixel` as one-based +- `sunpy.map.make_fitswcs_header` now correctly interprets the ``reference_pixel`` argument as being zero-based, in previous releases it incorrectly interpreted the ``reference_pixel`` as one-based. Standardization of `~sunpy.map.GenericMap.submap` and `~sunpy.map.GenericMap.draw_rectangle` ============================================================================================ @@ -171,9 +171,9 @@ Download behind proxies With the release of parfive 1.1, sunpy has been patched to be able to utilize proxy servers when downloading files. -* Proxy URL is read from the environment variables `HTTP_PROXY` or `HTTPS_PROXY`. -* Proxy Authentication `proxy_auth` should be passed as a `aiohttp.BasicAuth` object, explicitly by the user. -* Proxy Headers `proxy_headers` should be passed as `dict` object, explicitly by the user. +* Proxy URL is read from the environment variables ``HTTP_PROXY`` or ``HTTPS_PROXY``. +* Proxy Authentication ``proxy_auth`` should be passed as a `aiohttp.BasicAuth` object, explicitly by the user. +* Proxy Headers ``proxy_headers`` should be passed as `dict` object, explicitly by the user. For example if you use a bash terminal: From 8c48e0090d179f5d435f82b68159f40132499a92 Mon Sep 17 00:00:00 2001 From: David Stansby Date: Sat, 30 Jan 2021 14:21:12 +0000 Subject: [PATCH 3/3] Fix a bunch more doc links --- sunpy/database/database.py | 8 +++----- sunpy/map/header_helper.py | 2 +- sunpy/map/mapbase.py | 12 ++++++------ sunpy/map/mapsequence.py | 2 +- sunpy/net/dataretriever/client.py | 6 +++--- sunpy/net/fido_factory.py | 6 +++--- sunpy/net/hek/hek.py | 2 +- sunpy/net/helioviewer.py | 4 ++-- sunpy/net/jsoc/jsoc.py | 2 +- sunpy/time/timerange.py | 2 +- sunpy/timeseries/sources/eve.py | 2 +- sunpy/timeseries/timeseries_factory.py | 2 +- sunpy/timeseries/timeseriesbase.py | 4 ++-- sunpy/util/decorators.py | 4 ++-- sunpy/util/sphinx/changelog.py | 2 +- sunpy/visualization/animator/base.py | 2 +- sunpy/visualization/animator/wcs.py | 2 +- 17 files changed, 31 insertions(+), 33 deletions(-) diff --git a/sunpy/database/database.py b/sunpy/database/database.py index 65635002300..0d178d2da30 100644 --- a/sunpy/database/database.py +++ b/sunpy/database/database.py @@ -845,9 +845,7 @@ def download_from_hek_query_result(self, query_result, client=None, path=None, p def download_from_vso_query_result(self, query_result, client=None, path=None, progress=False, ignore_already_added=False, overwrite=False): - """download(query_result, client=sunpy.net.vso.VSOClient(), - path=None, progress=False, ignore_already_added=False) - + """ Add new database entries from a VSO query result and download the corresponding data files. See :meth:`sunpy.database.Database.download` for information about the caching mechanism used and about the @@ -855,7 +853,7 @@ def download_from_vso_query_result(self, query_result, client=None, Parameters ---------- - query_result : sunpy.net.vso.QueryResponse + query_result : sunpy.net.vso.VSOQueryResponseTable A VSO query response that was returned by the ``query`` method of a :class:`sunpy.net.vso.VSOClient` object. @@ -875,7 +873,7 @@ def add_from_vso_query_result(self, query_result, Parameters ---------- - query_result : sunpy.net.vso.QueryResponse + query_result : sunpy.net.vso.VSOQueryResponseTable A VSO query response that was returned by the ``query`` method of a :class:`sunpy.net.vso.VSOClient` object. diff --git a/sunpy/map/header_helper.py b/sunpy/map/header_helper.py index 8524e7ee9c9..7797ca44660 100644 --- a/sunpy/map/header_helper.py +++ b/sunpy/map/header_helper.py @@ -50,7 +50,7 @@ def make_fitswcs_header(data, coordinate, data : `~numpy.ndarray` or `tuple` Array data of Map for which a header is required, or the shape of the data array (in numpy order, i.e. ``(y_size, x_size)``). - coordinate : `~astropy.coordinates.SkyCoord` or `~astropy.coordinates.BaseFrame` + coordinate : `~astropy.coordinates.SkyCoord` or `~astropy.coordinates.BaseCoordinateFrame` The coordinate of the reference pixel. reference_pixel :`~astropy.units.Quantity` of size 2, optional Reference pixel along each axis. These are expected to be Cartestian ordered, i.e diff --git a/sunpy/map/mapbase.py b/sunpy/map/mapbase.py index 20f99da546c..e0faa2fda65 100644 --- a/sunpy/map/mapbase.py +++ b/sunpy/map/mapbase.py @@ -501,7 +501,7 @@ def wcs(self): @property def coordinate_frame(self): """ - An `astropy.coordinates.BaseFrame` instance created from the coordinate + An `astropy.coordinates.BaseCoordinateFrame` instance created from the coordinate information for this Map, or None if the frame cannot be determined. """ try: @@ -1148,7 +1148,7 @@ def world_to_pixel(self, coordinate, origin=None): Parameters ---------- - coordinate : `~astropy.coordinates.SkyCoord` or `~astropy.coordinates.BaseFrame` + coordinate : `~astropy.coordinates.SkyCoord` or `~astropy.coordinates.BaseCoordinateFrame` The coordinate object to convert to pixel coordinates. origin : int @@ -1322,7 +1322,7 @@ def rotate(self, angle: u.deg = None, rmatrix=None, order=4, scale=1.0, ---------- angle : `~astropy.units.Quantity` The angle (degrees) to rotate counterclockwise. - rmatrix : ndarray + rmatrix : array-like 2x2 linear transformation rotation matrix. order : int Interpolation order to be used. Must be in the range 0-5. @@ -1356,8 +1356,8 @@ def rotate(self, angle: u.deg = None, rmatrix=None, order=4, scale=1.0, See Also -------- - sunpy.image.transform.affine_transform : The routine this method calls - for the rotation. + sunpy.image.transform.affine_transform : + The routine this method calls for the rotation. Notes ----- @@ -1503,7 +1503,7 @@ def submap(self, bottom_left, *, top_right=None, width: (u.deg, u.pix) = None, h The bottom-left coordinate of the rectangle. If a `~astropy.coordinates.SkyCoord` it can have shape ``(2,)`` and simultaneously define ``top_right``. If specifying pixel coordinates it must be given as an `~astropy.units.Quantity` - object with units of `~astropy.units.pix`. + object with units of `~astropy.units.si.pix`. top_right : `astropy.units.Quantity` or `~astropy.coordinates.SkyCoord`, optional The top-right coordinate of the rectangle. If ``top_right`` is specified ``width`` and ``height`` must be omitted. diff --git a/sunpy/map/mapsequence.py b/sunpy/map/mapsequence.py index b37cfe693b8..93f2b11c560 100644 --- a/sunpy/map/mapsequence.py +++ b/sunpy/map/mapsequence.py @@ -393,7 +393,7 @@ def peek(self, resample=None, **kwargs): Parameters ---------- - fig: matplotlib.Figure + fig: matplotlib.figure.Figure Figure to use to create the explorer resample: list diff --git a/sunpy/net/dataretriever/client.py b/sunpy/net/dataretriever/client.py index df2c572c20b..54e5ade2b31 100644 --- a/sunpy/net/dataretriever/client.py +++ b/sunpy/net/dataretriever/client.py @@ -77,7 +77,7 @@ def _get_match_dict(cls, *args, **kwargs): Constructs a dictionary using the query and registered Attrs that represents all possible values of the extracted metadata for files that matches the query. The returned dictionary is used to validate the metadata of searched files - in `:func:~sunpy.util.scraper.Scraper._extract_files_meta`. + in :func:`~sunpy.util.scraper.Scraper._extract_files_meta`. Parameters ---------- @@ -120,7 +120,7 @@ def _get_match_dict(cls, *args, **kwargs): def pre_search_hook(cls, *args, **kwargs): """ Helper function to return the baseurl, pattern and matchdict - for the client required by `:func:~sunpy.net.dataretriever.GenericClient.search` + for the client required by :func:`~sunpy.net.dataretriever.GenericClient.search` before using the scraper. """ matchdict = cls._get_match_dict(*args, **kwargs) @@ -146,7 +146,7 @@ class uses to dispatch queries to this Client. def post_search_hook(self, exdict, matchdict): """ - Helper function used after `:func:~sunpy.net.dataretriever.GenericClient.search` + Helper function used after :func:`~sunpy.net.dataretriever.GenericClient.search` which makes the extracted metadata representable in a query response table. Parameters diff --git a/sunpy/net/fido_factory.py b/sunpy/net/fido_factory.py index 9a267b86be5..858d8399882 100644 --- a/sunpy/net/fido_factory.py +++ b/sunpy/net/fido_factory.py @@ -361,12 +361,12 @@ def search(self, *query): def fetch(self, *query_results, path=None, max_conn=5, progress=True, overwrite=False, downloader=None, **kwargs): """ - Download the records represented by `~sunpy.net.QueryResponseTable` or + Download the records represented by `~sunpy.net.base_client.QueryResponseTable` or `~sunpy.net.fido_factory.UnifiedResponse` objects. Parameters ---------- - query_results : `sunpy.net.fido_factory.UnifiedResponse` or `~sunpy.net.QueryResponseTable` + query_results : `sunpy.net.fido_factory.UnifiedResponse` or `~sunpy.net.base_client.QueryResponseTable` Container returned by query method, or multiple. path : `str` The directory to retrieve the files into. Can refer to any fields @@ -382,7 +382,7 @@ def fetch(self, *query_results, path=None, max_conn=5, progress=True, Determine how to handle downloading if a file already exists with the same name. If `False` the file download will be skipped and the path returned to the existing file, if `True` the file will be downloaded - and the existing file will be overwritten, if `'unique'` the filename + and the existing file will be overwritten, if ``'unique'`` the filename will be modified to be unique. downloader : `parfive.Downloader`, optional The download manager to use. If specified the ``max_conn``, diff --git a/sunpy/net/hek/hek.py b/sunpy/net/hek/hek.py index 7d3dadcafa7..79fb585e956 100644 --- a/sunpy/net/hek/hek.py +++ b/sunpy/net/hek/hek.py @@ -142,7 +142,7 @@ def _can_handle_query(cls, *query): class HEKRow(Row): """ Handles the response from the HEK. Each HEKRow object is a subclass - of `astropy.Table.row`. The column-row key-value pairs correspond to the + of `astropy.table.Table.row`. The column-row key-value pairs correspond to the HEK feature/event properties and their values, for that record from the HEK. Each HEKRow object also has extra properties that relate HEK concepts to VSO concepts. diff --git a/sunpy/net/helioviewer.py b/sunpy/net/helioviewer.py index 9733033de7f..decbf6e90f6 100644 --- a/sunpy/net/helioviewer.py +++ b/sunpy/net/helioviewer.py @@ -33,7 +33,7 @@ def __init__(self, url="https://api.helioviewer.org/"): @lazyproperty def data_sources(self): """ - We trawl through the return from `getDataSources` to create a clean + We trawl through the return from ``getDataSources`` to create a clean dictionary for all available sourceIDs. Here is a list of all of them: https://api.helioviewer.org/docs/v2/#appendix_datasources @@ -288,7 +288,7 @@ def download_png(self, date, image_scale, layers, progress=True, Parameters ---------- date : `astropy.time.Time`, `str` - A `parse_time` parsable string or `~astropy.time.Time` object + A `~sunpy.time.parse_time` parsable string or `~astropy.time.Time` object for the desired date of the image image_scale : `float` The zoom scale of the image in arcseconds per pixel. diff --git a/sunpy/net/jsoc/jsoc.py b/sunpy/net/jsoc/jsoc.py index dd9edd04fe7..d56f8f7d7e7 100644 --- a/sunpy/net/jsoc/jsoc.py +++ b/sunpy/net/jsoc/jsoc.py @@ -512,7 +512,7 @@ def get_request(self, requests, path=None, overwrite=False, progress=True, Determine how to handle downloading if a file already exists with the same name. If `False` the file download will be skipped and the path returned to the existing file, if `True` the file will be downloaded - and the existing file will be overwritten, if `'unique'` the filename + and the existing file will be overwritten, if ``'unique'`` the filename will be modified to be unique. downloader : `parfive.Downloader`, optional diff --git a/sunpy/time/timerange.py b/sunpy/time/timerange.py index 9af2c06dd43..bfbce6c69ba 100644 --- a/sunpy/time/timerange.py +++ b/sunpy/time/timerange.py @@ -26,7 +26,7 @@ class TimeRange: Regardless of how a `sunpy.time.TimeRange` is constructed it will always provide a positive time range where the start time is before the end time. - `~sunpy.time.TimeRange.__contains__` has been implemented which means you can + ``__contains__`` has been implemented which means you can check if a time is within the time range you have created. Please see the example section below. diff --git a/sunpy/timeseries/sources/eve.py b/sunpy/timeseries/sources/eve.py index dfbd200e590..46061998ce4 100644 --- a/sunpy/timeseries/sources/eve.py +++ b/sunpy/timeseries/sources/eve.py @@ -149,7 +149,7 @@ class EVESpWxTimeSeries(GenericTimeSeries): Level 0CS data is primarily used for space weather. It is provided near real-time and is crudely calibrated 1-minute averaged broadband irradiances from ESP and MEGS-P broadband. - For other levels of EVE data, use `~sunpy.net.Fido`, with `sunpy.net.attrs.Instrument('eve')`. + For other levels of EVE data, use `~sunpy.net.Fido`, with ``sunpy.net.attrs.Instrument('eve')``. Data is available starting on 2010/03/01. diff --git a/sunpy/timeseries/timeseries_factory.py b/sunpy/timeseries/timeseries_factory.py index 9a30232cc6b..fd38466a6e1 100644 --- a/sunpy/timeseries/timeseries_factory.py +++ b/sunpy/timeseries/timeseries_factory.py @@ -63,7 +63,7 @@ class TimeSeriesFactory(BasicRegistrationFactory): `sunpy.timeseries.GenericTimeSeries` If the input results in a single timeseries object that will be returned, or if ``concatenate=True``. - `list` of `~sunpy.timeseries.GenericTimeseries` + `list` of `~sunpy.timeseries.GenericTimeSeries` If multiple inputs are parsed, they will be returned in a list, unless ``concatenate=True`` is set when they will be combined into a single timeseries. diff --git a/sunpy/timeseries/timeseriesbase.py b/sunpy/timeseries/timeseriesbase.py index 085c8faaa6a..dbd42bcc49f 100644 --- a/sunpy/timeseries/timeseriesbase.py +++ b/sunpy/timeseries/timeseriesbase.py @@ -389,7 +389,7 @@ def concatenate(self, others, same_source=False, **kwargs): >>> timeseries_1.concatenate(timeseries_2) # doctest: +SKIP >>> timeseries_1.concatenate([timeseries_2, timeseries_3]) # doctest: +SKIP - Set `same_source` to `True` if the sources of the time series are the same. + Set ``same_source`` to `True` if the sources of the time series are the same. >>> timeseries_1.concatenate([timeseries_2, timeseries_3], same_source=True) # doctest: +SKIP """ @@ -625,7 +625,7 @@ def to_dataframe(self, **kwargs): Returns ------- - `~pandas.core.frame.DataFrame` + `~pandas.DataFrame` """ return self._data diff --git a/sunpy/util/decorators.py b/sunpy/util/decorators.py index b3087c416da..d3d164c3b3b 100644 --- a/sunpy/util/decorators.py +++ b/sunpy/util/decorators.py @@ -72,9 +72,9 @@ def new_function(): The type of this object, if the automatically determined one needs to be overridden. - warning_type : warning + warning_type : `~exceptions.Warning` Warning to be issued. - Default is `~sunpy.utils.exceptions.SunpyDeprecationWarning`. + Default is `~sunpy.util.exceptions.SunpyDeprecationWarning`. """ major, minor = get_removal_version(since) removal_version = f"{major}.{minor}" diff --git a/sunpy/util/sphinx/changelog.py b/sunpy/util/sphinx/changelog.py index 795a9153763..ae2b83b7402 100644 --- a/sunpy/util/sphinx/changelog.py +++ b/sunpy/util/sphinx/changelog.py @@ -19,7 +19,7 @@ class ChangeLog(Directive): The directive takes one argument which is the location of your ``pyproject.toml`` file (towncrier configuration) relative to the ``conf.py`` file *not* the file in which the directive is located. - If this argument is not specified it defaults to `"../"`. + If this argument is not specified it defaults to :file:`"../"`. Examples -------- diff --git a/sunpy/visualization/animator/base.py b/sunpy/visualization/animator/base.py index c8d42b710b4..d03b5a2be9c 100644 --- a/sunpy/visualization/animator/base.py +++ b/sunpy/visualization/animator/base.py @@ -39,7 +39,7 @@ class BaseFuncAnimator: Some arbitrary data. slider_functions: `list` A list of functions to call when that slider is changed. - These functions will have `val`, the axes image object and the slider + These functions will have ``val``, the axes image object and the slider widget instance passed to them, e.g., ``update_slider(val, im, slider)`` slider_ranges: `list` A list of ``[min,max]`` pairs to set the ranges for each slider or an array diff --git a/sunpy/visualization/animator/wcs.py b/sunpy/visualization/animator/wcs.py index 299df4d67ac..f125abd0ace 100644 --- a/sunpy/visualization/animator/wcs.py +++ b/sunpy/visualization/animator/wcs.py @@ -34,7 +34,7 @@ class ArrayAnimatorWCS(ArrayAnimator): axes. The list should be the same length as the number of pixel dimensions with ``'x'`` and (optionally) ``'y'`` in the elements corresponding to the axes to be plotted. If only ``'x'`` is present a - line plot will be drawn. All other elements should be `0`. + line plot will be drawn. All other elements should be ``0``. coord_params: `dict`, optional This dict allows you to override `~astropy.visualization.wcsaxes.WCSAxes` parameters for each world