Skip to content

Commit

Permalink
docs: 🧹 Change Parameters to Arguments where lingering.
Browse files Browse the repository at this point in the history
  • Loading branch information
teald committed Aug 15, 2024
1 parent d968cad commit 17db9c1
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 28 deletions.
4 changes: 2 additions & 2 deletions astrodata/adfactory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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").
Expand Down
39 changes: 20 additions & 19 deletions astrodata/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,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
Expand Down Expand Up @@ -216,8 +216,8 @@ def assert_most_close(
--------
:func:`~numpy.testing.assert_allclose`
Parameters
----------
Arguments
---------
actual : array_like
Array obtained.
Expand Down Expand Up @@ -485,8 +485,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.
Expand Down Expand Up @@ -701,8 +701,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
"""
Expand Down Expand Up @@ -762,8 +762,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
Expand Down Expand Up @@ -1055,10 +1055,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
Expand Down Expand Up @@ -1254,8 +1255,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.
Expand Down Expand Up @@ -1358,8 +1359,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.
"""
Expand Down Expand Up @@ -1392,8 +1393,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:
Expand Down
20 changes: 13 additions & 7 deletions astrodata/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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
------
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 17db9c1

Please sign in to comment.