diff --git a/pyproject.toml b/pyproject.toml index 4e34a118..1063646b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,9 +1,9 @@ [build-system] build-backend = "setuptools.build_meta" requires = [ - "setuptools>=62.1,!=71.0.1", - "setuptools_scm[toml]>=6.2", - "wheel>=0.34", + "setuptools >=62.1 , != 71.0.1", + "setuptools_scm[toml] >=6.2", + "wheel >=0.34", ] [project] @@ -33,17 +33,17 @@ authors = [ {name = "Jonathan Slavin", email = "jslavin@cfa.harvard.edu"}, {name = "Nick Murpy", email="namurphy@cfa.harvard.edu"}, {name = "Will Barnes"}, - {name = "Nabil Freij"}, + {name = "Nabil Freij", email="nabil.freij@gmail.com"}, {name = "Stuart Mumford"}, ] dependencies = [ "astropy >= 5.3.0", "matplotlib >= 3.5.0", - "numpy>=1.23.5", + "numpy >=1.23.5", "scikit-image >= 0.19.0", # !=1.10.0 due to https://github.com/scipy/scipy/issues/17718 - "scipy>=1.9.0,!=1.10.0", + "scipy >= 1.9.0 , != 1.10.0", "sunpy[map] >= 5.0.0", ] @@ -53,7 +53,7 @@ dev = [ "nox >= 2022.8.7", ] tests = [ - "pytest >= 8.0.0", + "pytest-allclose >= 1.0.0", "pytest-astropy", ] docs = [ diff --git a/xrtpy/image_correction/tests/test_remove_lightleak.py b/xrtpy/image_correction/tests/test_remove_lightleak.py index 77cae726..d0185513 100644 --- a/xrtpy/image_correction/tests/test_remove_lightleak.py +++ b/xrtpy/image_correction/tests/test_remove_lightleak.py @@ -1,6 +1,5 @@ from pathlib import Path -import numpy as np import pytest from sunpy.map import Map @@ -47,7 +46,7 @@ def get_composite_data_files(): @pytest.mark.parametrize(("idlfile", "compfile"), data_files) -def test_lightleak(idlfile, compfile): +def test_lightleak(idlfile, compfile, allclose): IDL_map = Map(idlfile) input_map = Map(compfile) @@ -57,6 +56,6 @@ def test_lightleak(idlfile, compfile): # Because of rebinning for full resolution images, the match is worse # between IDL created images and XRTpy ones. IDL's method of rebinning # is different from that used by sunpy. - np.testing.assert_allclose(ll_removed_map_xrtpy.data, IDL_map.data, atol=0.75) + assert allclose(ll_removed_map_xrtpy.data, IDL_map.data, atol=0.75) else: - np.testing.assert_allclose(ll_removed_map_xrtpy.data, IDL_map.data, atol=1e-5) + assert allclose(ll_removed_map_xrtpy.data, IDL_map.data, atol=1e-5) diff --git a/xrtpy/response/tests/test_effective_area.py b/xrtpy/response/tests/test_effective_area.py index d1e65ab3..d4d1426f 100644 --- a/xrtpy/response/tests/test_effective_area.py +++ b/xrtpy/response/tests/test_effective_area.py @@ -1,7 +1,6 @@ from datetime import datetime from pathlib import Path -import numpy as np import pytest from astropy import units as u @@ -111,7 +110,7 @@ def get_IDL_data_files(): def _IDL_raw_data_list(filename): - with Path(filename).open() as filter_file: + with open(filename) as filter_file: # noqa: PTH123 list_of_IDL_effective_area_data = [] for line in filter_file: stripped_line = line.strip() @@ -144,7 +143,7 @@ def IDL_test_date(list_of_lists): def _IDL_effective_area_raw_data(filename): - with Path(filename).open() as filter_file: + with open(filename) as filter_file: # noqa: PTH123 list_of_lists = [] for line in filter_file: stripped_line = line.strip() @@ -158,7 +157,7 @@ def _IDL_effective_area_raw_data(filename): @pytest.mark.parametrize("filename", filenames) -def test_EffectiveAreaPreparatory_effective_area(filename): +def test_EffectiveAreaPreparatory_effective_area(filename, allclose): data_list = _IDL_raw_data_list(filename) filter_name = IDL_test_filter_name(data_list) @@ -170,6 +169,4 @@ def test_EffectiveAreaPreparatory_effective_area(filename): actual_effective_area = instance.effective_area() assert actual_effective_area.unit == IDL_effective_area.unit - np.testing.assert_allclose( - actual_effective_area.value, IDL_effective_area.value, atol=1e-2 - ) + assert allclose(actual_effective_area.value, IDL_effective_area.value, atol=1e-2) diff --git a/xrtpy/response/tests/test_temperature_response.py b/xrtpy/response/tests/test_temperature_response.py index 93f27a8d..c9fedfae 100644 --- a/xrtpy/response/tests/test_temperature_response.py +++ b/xrtpy/response/tests/test_temperature_response.py @@ -1,7 +1,6 @@ from datetime import datetime from pathlib import Path -import numpy as np import pytest from xrtpy.response.temperature_response import TemperatureResponseFundamental @@ -19,7 +18,7 @@ def get_IDL_data_files(model): def _IDL_raw_data_list(filename): - with Path(filename).open() as filter_file: + with open(filename) as filter_file: # noqa: PTH123 IDL_data_list = [] for line in filter_file: stripped_line = line.strip() @@ -52,7 +51,7 @@ def IDL_test_date(IDL_data_list): def _IDL_temperature_response_raw_data(filename): - with Path(filename).open() as filter_file: + with open(filename) as filter_file: # noqa: PTH123 IDL_data_list = [] for line in filter_file: stripped_line = line.strip() @@ -64,7 +63,7 @@ def _IDL_temperature_response_raw_data(filename): @pytest.mark.parametrize("abundance_model", ["coronal", "hybrid", "photospheric"]) -def test_temperature_response(abundance_model): +def test_temperature_response(abundance_model, allclose): filenames = get_IDL_data_files(abundance_model) for filename in filenames: IDL_data = _IDL_raw_data_list(filename) @@ -79,7 +78,7 @@ def test_temperature_response(abundance_model): actual_temperature_response = instance.temperature_response() atol = actual_temperature_response.value.max() * 0.013 - np.testing.assert_allclose( + assert allclose( actual_temperature_response.value, IDL_temperature_response, rtol=0.028,