From c30261bcb2ad23a3a6ff5aa6b09f4beafc7caaf0 Mon Sep 17 00:00:00 2001 From: teald Date: Thu, 15 Aug 2024 15:20:40 -0700 Subject: [PATCH] =?UTF-8?q?docs:=20=F0=9F=A7=B9=20Change=20Parameters=20to?= =?UTF-8?q?=20Arguments=20where=20lingering.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- astrodata/adfactory.py | 4 ++-- astrodata/testing.py | 47 +++++++++++++++++++++--------------------- astrodata/utils.py | 20 +++++++++++------- 3 files changed, 39 insertions(+), 32 deletions(-) diff --git a/astrodata/adfactory.py b/astrodata/adfactory.py index 02eff5a7..ffffe790 100644 --- a/astrodata/adfactory.py +++ b/astrodata/adfactory.py @@ -229,8 +229,8 @@ def createFromScratch( def create_from_scratch(self, phu, extensions=None): """Create an AstroData object from a collection of objects. - Parameters - ---------- + Arguments + --------- phu : `fits.PrimaryHDU` or `fits.Header` or `dict` or `list` FITS primary HDU or header, or something that can be used to create a fits.Header (a dict, a list of "cards"). diff --git a/astrodata/testing.py b/astrodata/testing.py index 3e66b997..7df19286 100644 --- a/astrodata/testing.py +++ b/astrodata/testing.py @@ -167,8 +167,8 @@ def get_corners(shape): This is a recursive function to calculate the corner indices of an array of the specified shape. - Parameters - ---------- + Arguments + --------- shape : tuple of ints Length of the dimensions of the array @@ -218,8 +218,8 @@ def assert_most_close( -------- :func:`~numpy.testing.assert_allclose` - Parameters - ---------- + Arguments + --------- actual : array_like Array obtained. @@ -487,8 +487,8 @@ def download_multiple_files( ): """Download multiple files from the archive and store them at a given path. - Parameters - ---------- + Arguments + --------- files : list of str List of filenames to download. @@ -528,8 +528,8 @@ def download_multiple_files( else: path = os.path.join(os.getcwd(), "_test_cache") warnings.warn( - "Environment variable not set and no path provided, writing to " - f"{path}. To suppress this warning, set the " + "Environment variable not set and no path provided, writing " + f"to {path}. To suppress this warning, set the " "environment variable to the desired path for the " "testing cache." ) @@ -703,8 +703,8 @@ def get_associated_calibrations(filename, nbias=5): This function quieries the Gemini Observatory Archive for calibrations associated with a given data file. - Parameters - ---------- + Arguments + --------- filename : str Input file name """ @@ -764,8 +764,8 @@ def run_comparison( ): """Perform a comparison between the two AD objects in this instance. - Parameters - ---------- + Arguments + --------- max_miss: int maximum number of elements in each array that can disagree @@ -1057,10 +1057,11 @@ def format_errordict(self, errordict): def ad_compare(ad1, ad2, **kwargs): """Compare the tags, headers, and pixel values of two images. - This is a wrapper for ADCompare.run_comparison() for backward-compatibility. + This is a wrapper for ADCompare.run_comparison() for + backward-compatibility. - Parameters - ---------- + Arguments + --------- ad1: AstroData first AD objects @@ -1114,8 +1115,8 @@ def fake_fits_bytes( no header keywords are included. include_header_values : dict[str, str] | None - A dictionary of header keywords and values to be included in the primary - HDU. If None, no header keywords are included. + A dictionary of header keywords and values to be included in the + primary HDU. If None, no header keywords are included. masks : bool If True, a mask is created for the primary HDU or the image extensions. @@ -1256,8 +1257,8 @@ def test_script_file( All matches (i.e., stdout_result and stderr_result) can use regular expressions. - Parameters - ---------- + Arguments + --------- script_path : str The path to the script to be run. @@ -1360,8 +1361,8 @@ def _reg_assert(result, expected): def process_string_to_python_script(string: str) -> str: """Format a stirng to be used as a Python script. - Parameters - ---------- + Arguments + --------- string : str The string to be processed. """ @@ -1394,8 +1395,8 @@ def get_program_observations(): def expand_file_range(files: str) -> list[str]: """Expand a range of files into a list of file names. - Parameters - ---------- + Arguments + --------- files : str A range of files, e.g., "N20170614S0201-205". This would produce: diff --git a/astrodata/utils.py b/astrodata/utils.py index 589f1878..49d59f8f 100644 --- a/astrodata/utils.py +++ b/astrodata/utils.py @@ -34,8 +34,8 @@ class AstroDataDeprecationWarning(DeprecationWarning): def deprecated(reason): """Mark a function as deprecated. - Parameters - ---------- + Arguments + --------- reason : str The reason why the function is deprecated @@ -260,7 +260,12 @@ def returns_list(fn): .. code-block:: python - from astrodata import AstroData, astro_data_descriptor, returns_list, NDAstroData + from astrodata import ( + AstroData, + astro_data_descriptor, + returns_list, + NDAstroData + ) class MyAstroData(AstroData): @astro_data_descriptor @@ -431,7 +436,7 @@ def axis_dict(self): return dict(zip(self._axis_names, self)) def __getnewargs__(self): - """Return the arguments needed to create a new instance of this object.""" + """Return arguments needed to create an equivalent Section instance.""" return tuple(self) def __getattr__(self, attr): @@ -546,7 +551,8 @@ def contains(self, section): Returns ------- bool - True if the Section is entirely within this Section, otherwise False. + True if the Section is entirely within this Section, otherwise + False. Raises ------ @@ -616,8 +622,8 @@ def overlap(self, section): Notes ----- - If sections do not overlap, a warning is logged when None is returned. This is to - help with debugging, as it is often not an error condition. + If sections do not overlap, a warning is logged when None is returned. + This is to help with debugging, as it is often not an error condition. """ if self.ndim != section.ndim: raise ValueError("Sections have different dimensionality")