diff --git a/aiapy/calibrate/meta.py b/aiapy/calibrate/meta.py index b7f7fe4..67a3f05 100644 --- a/aiapy/calibrate/meta.py +++ b/aiapy/calibrate/meta.py @@ -51,7 +51,7 @@ def fix_observer_location(smap): return smap._new_instance(smap.data, new_meta, plot_settings=smap.plot_settings, mask=smap.mask) -def update_pointing(smap, pointing_table=None): +def update_pointing(smap, *, pointing_table=None): """ Update pointing information in the `smap` header. diff --git a/aiapy/calibrate/prep.py b/aiapy/calibrate/prep.py index 4396269..4745cdd 100644 --- a/aiapy/calibrate/prep.py +++ b/aiapy/calibrate/prep.py @@ -18,7 +18,7 @@ @add_common_docstring(rotation_function_names=_rotation_function_names) -def register(smap, missing=None, order=3, method="scipy"): +def register(smap, *, missing=None, order=3, method="scipy"): """ Processes a full-disk level 1 `~sunpy.map.sources.sdo.AIAMap` into a level 1.5 `~sunpy.map.sources.sdo.AIAMap`. @@ -110,7 +110,7 @@ def register(smap, missing=None, order=3, method="scipy"): return newmap -def correct_degradation(smap, correction_table=None, calibration_version=None): +def correct_degradation(smap, *, correction_table=None, calibration_version=None): """ Apply time-dependent degradation correction to an AIA map. @@ -158,6 +158,7 @@ def correct_degradation(smap, correction_table=None, calibration_version=None): def degradation( channel: u.angstrom, obstime, + *, correction_table=None, calibration_version=None, ) -> u.dimensionless_unscaled: diff --git a/aiapy/calibrate/spikes.py b/aiapy/calibrate/spikes.py index 63999c4..1ee40f6 100644 --- a/aiapy/calibrate/spikes.py +++ b/aiapy/calibrate/spikes.py @@ -14,7 +14,7 @@ __all__ = ["respike", "fetch_spikes"] -def respike(smap, spikes=None): +def respike(smap, *, spikes=None): """ Re-insert "spikes" or "hot pixels" into level 1 AIA images. diff --git a/aiapy/calibrate/tests/test_prep.py b/aiapy/calibrate/tests/test_prep.py index fba94ed..297eacb 100644 --- a/aiapy/calibrate/tests/test_prep.py +++ b/aiapy/calibrate/tests/test_prep.py @@ -103,7 +103,7 @@ def test_register_level_15(lvl_15_map): [ pytest.param(None, None, marks=pytest.mark.remote_data), ( - get_correction_table(get_test_filepath("aia_V8_20171210_050627_response_table.txt")), + get_correction_table(correction_table=get_test_filepath("aia_V8_20171210_050627_response_table.txt")), 8, ), ], diff --git a/aiapy/calibrate/util.py b/aiapy/calibrate/util.py index 17a1266..aed96e8 100644 --- a/aiapy/calibrate/util.py +++ b/aiapy/calibrate/util.py @@ -42,7 +42,7 @@ } -def get_correction_table(correction_table=None): +def get_correction_table(*, correction_table=None): """ Return table of degradation correction factors. @@ -110,7 +110,7 @@ def get_correction_table(correction_table=None): @u.quantity_input @validate_channel("channel") -def _select_epoch_from_correction_table(channel: u.angstrom, obstime, table, version=None): +def _select_epoch_from_correction_table(channel: u.angstrom, obstime, table, *, version=None): """ Return correction table with only the first epoch and the epoch in which `obstime` falls and for only one given calibration version. diff --git a/aiapy/response/channel.py b/aiapy/response/channel.py index 29d2150..2aced04 100644 --- a/aiapy/response/channel.py +++ b/aiapy/response/channel.py @@ -74,7 +74,7 @@ class Channel: @u.quantity_input @validate_channel("channel") - def __init__(self, channel: u.angstrom, instrument_file=None): + def __init__(self, channel: u.angstrom, *, instrument_file=None): self._channel = channel self._instrument_data = self._get_instrument_data(instrument_file) diff --git a/aiapy/response/tests/test_channel.py b/aiapy/response/tests/test_channel.py index f0183c8..f533c5b 100644 --- a/aiapy/response/tests/test_channel.py +++ b/aiapy/response/tests/test_channel.py @@ -129,7 +129,7 @@ def test_effective_area(channel): 1.0140386988603103 * u.dimensionless_unscaled, ), ( - get_correction_table(get_test_filepath("aia_V8_20171210_050627_response_table.txt")), + get_correction_table(correction_table=get_test_filepath("aia_V8_20171210_050627_response_table.txt")), 8, 1.0140386988603103 * u.dimensionless_unscaled, ), diff --git a/aiapy/util/decorators.py b/aiapy/util/decorators.py index 26312ff..8a09246 100644 --- a/aiapy/util/decorators.py +++ b/aiapy/util/decorators.py @@ -17,7 +17,7 @@ ] -def validate_channel(argument, valid_channels="all"): +def validate_channel(argument, *, valid_channels="all"): """ Parameters ---------- diff --git a/pyproject.toml b/pyproject.toml index a68177e..c2312a6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -70,6 +70,8 @@ docs = [ "sphinx-hoverxref", "sphinxext-opengraph", "sunpy-sphinx-theme", + # Remove next line when fixed in towncrier; see https://github.com/twisted/towncrier/issues/528 + "importlib-resources<6", ] dev = ["aiapy[all,tests,docs]"]