From 83a143bcfd3252e105c11f9d131979e86ff78a70 Mon Sep 17 00:00:00 2001 From: Nadia Dencheva Date: Wed, 17 Nov 2021 19:01:34 -0500 Subject: [PATCH 1/6] start development --- CHANGES.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index 502c6d26..5e3ae615 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,12 @@ +0.17.1 (Unreleased) +------------------- + +New Features +^^^^^^^^^^^^ + +Bug Fixes +^^^^^^^^^ + 0.17.0 (2021-11-17) ------------------- Bug Fixes From 4e21c734cf61a92d5a8e30e8128eed88d4a9c4ab Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Fri, 26 Nov 2021 16:41:42 +0000 Subject: [PATCH 2/6] Test for stokes bug? --- gwcs/tests/test_coordinate_systems.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gwcs/tests/test_coordinate_systems.py b/gwcs/tests/test_coordinate_systems.py index 06f8958a..a37b6ec3 100644 --- a/gwcs/tests/test_coordinate_systems.py +++ b/gwcs/tests/test_coordinate_systems.py @@ -286,6 +286,9 @@ def test_stokes_frame(): assert sf.coordinate_to_quantity('I') == 0 * u.one assert sf.coordinate_to_quantity(0) == 0 +def test_stokes_profile(): + assert (cf.StokesProfile.from_index(np.arange(-8, 4) * u.one) == np.array(['YX', 'XY', 'YY,', 'XX', 'LR', 'RL', 'LL', 'RR', 'I', 'Q', 'U', 'V'], dtype="U2")).all() + @pytest.mark.parametrize('inp', [ (211 * u.AA, 0 * u.s, 0 * u.one, 0 * u.one), From bf7bb63e250795c88462918427534fd2cfce2948 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Fri, 26 Nov 2021 16:47:41 +0000 Subject: [PATCH 3/6] Fix the stokes profile bug --- gwcs/coordinate_frames.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gwcs/coordinate_frames.py b/gwcs/coordinate_frames.py index c9e0a493..2e599dc9 100644 --- a/gwcs/coordinate_frames.py +++ b/gwcs/coordinate_frames.py @@ -731,8 +731,8 @@ def from_index(cls, indexes): """ nans = np.isnan(indexes) - indexes = np.asanyarray(indexes, dtype=int) - out = np.empty_like(indexes, dtype=object) + indexes = np.asarray(indexes, dtype=int) + out = np.empty_like(indexes, dtype="U2") for profile, index in cls.profiles.items(): out[indexes == index] = profile From b821e28fbf287dd1e77cfcceb48f5294179753fc Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Fri, 26 Nov 2021 16:59:19 +0000 Subject: [PATCH 4/6] That ain't gonna work with NaNs --- gwcs/coordinate_frames.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gwcs/coordinate_frames.py b/gwcs/coordinate_frames.py index 2e599dc9..fca9292e 100644 --- a/gwcs/coordinate_frames.py +++ b/gwcs/coordinate_frames.py @@ -732,7 +732,7 @@ def from_index(cls, indexes): nans = np.isnan(indexes) indexes = np.asarray(indexes, dtype=int) - out = np.empty_like(indexes, dtype="U2") + out = np.empty_like(indexes, dtype=object) for profile, index in cls.profiles.items(): out[indexes == index] = profile From bade42edcc780ddf0cd3fe024068bedcfde033fb Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Fri, 26 Nov 2021 17:07:20 +0000 Subject: [PATCH 5/6] one last fix --- gwcs/coordinate_frames.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gwcs/coordinate_frames.py b/gwcs/coordinate_frames.py index fca9292e..dcc60c86 100644 --- a/gwcs/coordinate_frames.py +++ b/gwcs/coordinate_frames.py @@ -735,7 +735,7 @@ def from_index(cls, indexes): out = np.empty_like(indexes, dtype=object) for profile, index in cls.profiles.items(): - out[indexes == index] = profile + out[indexes == index] = cls(profile) out[nans] = np.nan From e747e347b040f2913e5c52c3dfc9624d7c27a7a6 Mon Sep 17 00:00:00 2001 From: Nadia Dencheva Date: Sat, 27 Nov 2021 17:51:09 -0500 Subject: [PATCH 6/6] prepare changelog for release --- CHANGES.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 5e3ae615..7a9faf69 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,12 +1,12 @@ -0.17.1 (Unreleased) +0.17.1 (2021-11-27) ------------------- -New Features -^^^^^^^^^^^^ - Bug Fixes ^^^^^^^^^ +- Fixed a bug with StokesProfile and array types. [#384] + + 0.17.0 (2021-11-17) ------------------- Bug Fixes