Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use canonical filename of RTD configuration and enable nitpicky mode #337

Merged
merged 5 commits into from
Sep 20, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
docs:
- .github/**/*.md
- .readthedocs.yml
- .readthedocs.yaml
- docs/*
- docs/_static/*
- docs/_templates/*
Expand Down
File renamed without changes.
6 changes: 6 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,9 @@
linkcheck_ignore = ['https://hsthelp.stsci.edu']
linkcheck_timeout = 180
linkcheck_anchors = False

# Enable nitpicky mode - which ensures that all references in the docs resolve.
nitpicky = True
nitpick_ignore = [
('py:class', 'synphot.models.BaseGaussian1D'),
]
6 changes: 3 additions & 3 deletions synphot/observation.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def sample_binned(self, wavelengths=None, flux_unit=None, **kwargs):
If not a Quantity, assumed to be in Angstrom.
If `None`, `binset` is used.

flux_unit : str or `~astropy.units.core.Unit` or `None`
flux_unit : str or `~astropy.units.Unit` or `None`
Flux is converted to this unit.
If not given, internal unit is used.

Expand Down Expand Up @@ -426,7 +426,7 @@ def effstim(self, flux_unit=None, wavelengths=None, area=None,

Parameters
----------
flux_unit : str or `~astropy.units.core.Unit` or `None`
flux_unit : str or `~astropy.units.Unit` or `None`
The unit of effective stimulus.
COUNT gives result in count/s (see :meth:`countrate` for more
options).
Expand Down Expand Up @@ -638,7 +638,7 @@ def plot(self, binned=True, wavelengths=None, flux_unit=None, area=None,
If `None`, ``self.waveset`` or `binset` is used, depending
on ``binned``.

flux_unit : str or `~astropy.units.core.Unit` or `None`
flux_unit : str or `~astropy.units.Unit` or `None`
Flux is converted to this unit for plotting.
If not given, internal unit is used.

Expand Down
8 changes: 4 additions & 4 deletions synphot/specio.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ def read_ascii_spec(filename, wave_unit=u.AA, flux_unit=units.FLAM, **kwargs):
filename : str or file pointer
Spectrum file name or pointer.

wave_unit, flux_unit : str or `~astropy.units.core.Unit`
wave_unit, flux_unit : str or `~astropy.units.Unit`
Wavelength and flux units, which default to Angstrom and FLAM,
respectively.

kwargs : dict
Keywords accepted by :func:`astropy.io.ascii.ui.read`.
Keywords accepted by :func:`astropy.io.ascii.read`.

Returns
-------
Expand Down Expand Up @@ -164,7 +164,7 @@ def read_fits_spec(filename, ext=1, wave_col='WAVELENGTH', flux_col='FLUX',
wave_col, flux_col : str
Wavelength and flux column names (case-insensitive).

wave_unit, flux_unit : str or `~astropy.units.core.Unit`
wave_unit, flux_unit : str or `~astropy.units.Unit`
Wavelength and flux units, which default to Angstrom and FLAM,
respectively. These are *only* used if ``TUNIT1`` and ``TUNIT2``
keywords are not present in table (not primary) header.
Expand Down Expand Up @@ -264,7 +264,7 @@ def write_fits_spec(filename, wavelengths, fluxes, pri_header={},
wave_col, flux_col : str
Wavelength and flux column names (case-insensitive).

wave_unit, flux_unit : str or `~astropy.units.core.Unit`
wave_unit, flux_unit : str or `~astropy.units.Unit`
Wavelength and flux units, which default to Angstrom and FLAM,
respectively. These are *only* used if wavelengths and fluxes
are not in astropy quantities.
Expand Down
16 changes: 8 additions & 8 deletions synphot/spectrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class BaseSpectrum:
Parameters
----------
modelclass : cls
Model class from `astropy.modeling.models`.
Model class from `astropy.modeling`.

clean_meta : bool
Scrub "expr" and "header" entries from input metadata before merging.
Expand Down Expand Up @@ -447,7 +447,7 @@ def integrate(self, wavelengths=None, integration_type=None, **kwargs):
integration is requested but no possible, trapezoid integration
is done anyway.

flux_unit : str, `~astropy.units.core.Unit`, or `None`
flux_unit : str, `~astropy.units.Unit`, or `None`
**This option is only available for source spectrum.**
For trapezoid integration, flux is converted to this unit for
sampling before integration. For analytical integration, while
Expand Down Expand Up @@ -863,7 +863,7 @@ def to_spectrum1d(self, wavelengths=None, **kwargs):
If not a Quantity, assumed to be in Angstrom.
If `None`, ``self.waveset`` is used.

flux_unit : str, `~astropy.units.core.Unit`, or `None`
flux_unit : str, `~astropy.units.Unit`, or `None`
This option is not applicable to unitless spectrum like bandpass.
Flux is converted to this unit before written out.
If not given, internal unit is used.
Expand Down Expand Up @@ -928,7 +928,7 @@ def __call__(self, wavelengths, flux_unit=None, **kwargs):
Wavelength values for sampling. If not a Quantity,
assumed to be in Angstrom.

flux_unit : str, `~astropy.units.core.Unit`, or `None`
flux_unit : str, `~astropy.units.Unit`, or `None`
Flux is converted to this unit.
If not given, internal unit is used.

Expand Down Expand Up @@ -1271,7 +1271,7 @@ def plot(self, wavelengths=None, flux_unit=None, area=None, vegaspec=None,
If not a Quantity, assumed to be in Angstrom.
If `None`, ``self.waveset`` is used.

flux_unit : str, `~astropy.units.core.Unit`, or `None`
flux_unit : str, `~astropy.units.Unit`, or `None`
Flux is converted to this unit for plotting.
If not given, internal unit is used.

Expand Down Expand Up @@ -1305,7 +1305,7 @@ def to_fits(self, filename, wavelengths=None, flux_unit=None, area=None,
If not a Quantity, assumed to be in Angstrom.
If `None`, ``self.waveset`` is used.

flux_unit : str, `~astropy.units.core.Unit`, or `None`
flux_unit : str, `~astropy.units.Unit`, or `None`
Flux is converted to this unit before written out.
If not given, internal unit is used.

Expand Down Expand Up @@ -1485,7 +1485,7 @@ def check_overlap(self, other, wavelengths=None, threshold=0.01):
wavelengths : array-like, `~astropy.units.quantity.Quantity`, or `None`
Wavelength values for integration.
If not a Quantity, assumed to be in Angstrom.
If `None`, `waveset` is used.
If `None`, ``waveset`` is used.

threshold : float
If less than this fraction of flux or throughput falls
Expand Down Expand Up @@ -1799,7 +1799,7 @@ def equivwidth(self, **kwargs):
Parameters
----------
kwargs : dict
See :meth:`integrate`.
See :meth:``integrate``.
pllim marked this conversation as resolved.
Show resolved Hide resolved

Returns
-------
Expand Down
12 changes: 6 additions & 6 deletions synphot/units.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def convert_flux(wavelengths, fluxes, out_flux_unit, **kwargs):
fluxes : array-like or `~astropy.units.quantity.Quantity`
Flux values. If not a Quantity, assumed to be in PHOTLAM.

out_flux_unit : str or `~astropy.units.core.Unit`
out_flux_unit : str or `~astropy.units.Unit`
Output flux unit.

area : float or `~astropy.units.quantity.Quantity`
Expand All @@ -181,7 +181,7 @@ def convert_flux(wavelengths, fluxes, out_flux_unit, **kwargs):

Raises
------
astropy.units.core.UnitsError
astropy.units.UnitsError
Conversion failed.

synphot.exceptions.SynphotError
Expand Down Expand Up @@ -298,12 +298,12 @@ def validate_unit(input_unit):

Parameters
----------
input_unit : str or `~astropy.units.core.Unit`
input_unit : str or `~astropy.units.Unit`
Unit to validate.

Returns
-------
output_unit : `~astropy.units.core.Unit`
output_unit : `~astropy.units.Unit`
Validated unit.

Raises
Expand Down Expand Up @@ -348,7 +348,7 @@ def validate_unit(input_unit):
else:
raise exceptions.SynphotError(
'{0} must be a recognized string or '
'astropy.units.core.Unit'.format(input_unit))
'astropy.units.Unit'.format(input_unit))

return output_unit

Expand Down Expand Up @@ -379,7 +379,7 @@ def validate_quantity(input_value, output_unit, equivalencies=[]):
Quantity to validate. If not a Quantity, assumed to be
already in output unit.

output_unit : str or `~astropy.units.core.Unit`
output_unit : str or `~astropy.units.Unit`
Output quantity unit.

equivalencies : list of equivalence pairs, optional
Expand Down
2 changes: 1 addition & 1 deletion synphot/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def generate_wavelengths(minwave=500, maxwave=26000, num=10000, delta=None,
If `True`, the wavelength values are evenly spaced in log scale.
Otherwise, spacing is linear.

wave_unit : str or `~astropy.units.core.Unit`
wave_unit : str or `~astropy.units.Unit`
Wavelength unit. Default is Angstrom.

Returns
Expand Down