Skip to content

Commit

Permalink
Revert changes to avoid conflict with open PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
nabobalis committed Sep 8, 2024
1 parent 61d3558 commit 78baa2a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 23 deletions.
14 changes: 7 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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]
Expand Down Expand Up @@ -33,17 +33,17 @@ authors = [
{name = "Jonathan Slavin", email = "[email protected]"},
{name = "Nick Murpy", email="[email protected]"},
{name = "Will Barnes"},
{name = "Nabil Freij"},
{name = "Nabil Freij", email="[email protected]"},
{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",
]

Expand All @@ -53,7 +53,7 @@ dev = [
"nox >= 2022.8.7",
]
tests = [
"pytest >= 8.0.0",
"pytest-allclose >= 1.0.0",
"pytest-astropy",
]
docs = [
Expand Down
7 changes: 3 additions & 4 deletions xrtpy/image_correction/tests/test_remove_lightleak.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from pathlib import Path

import numpy as np
import pytest
from sunpy.map import Map

Expand Down Expand Up @@ -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)

Expand All @@ -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)
11 changes: 4 additions & 7 deletions xrtpy/response/tests/test_effective_area.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from datetime import datetime
from pathlib import Path

import numpy as np
import pytest
from astropy import units as u

Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand All @@ -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)
Expand All @@ -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)
9 changes: 4 additions & 5 deletions xrtpy/response/tests/test_temperature_response.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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()
Expand Down Expand Up @@ -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()
Expand All @@ -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)
Expand All @@ -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,
Expand Down

0 comments on commit 78baa2a

Please sign in to comment.