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

Dummy release #261

Merged

Conversation

Witchblade101
Copy link
Collaborator

Test PR of a release for PRDOPSSOC-051 using the NRS workaround described in #255 .

This replaces a mistake in the earlier PR.

@Witchblade101
Copy link
Collaborator Author

Comments from PR #254 that should have been here:

Now this is weird...

Every test passes on my Mac, but test_aperture.py::test_idl_to_tel fails here for NIRISS. I noticed the values are very small- 7e-14. We still get the warnings about 'np.float' being deprecated and that we should switch to 'np.float64' to avoid platform differences. Is that what's going on here?

On my Mac:
`========================================================= test session starts ==========================================================
platform darwin -- Python 3.9.12, pytest-7.1.1, pluggy-1.0.0
rootdir: /Users/dlong/pysiaf, configfile: setup.cfg
collected 32 items

test_aperture.py ...... [ 18%]`

And then on witserv2:
`========================================================= test session starts ==========================================================
platform linux -- Python 3.9.13, pytest-7.1.2, pluggy-1.0.0 -- /user/dlong/linux/miniconda3/envs/pysiaf/bin/python
cachedir: .pytest_cache
rootdir: /home/dlong/pysiaf, configfile: setup.cfg
collected 32 items

test_aperture.py::test_idl_to_tel FAILED [ 3%]`

@tonysohn is it safe to ignore these tests failures here, or is something more serious broken?
@tonysohn
Member
tonysohn commented 3 hours ago

@Witchblade101 Was that the exact error message? It's hard to tell whether it's safe to ignore or not just from that...
@Witchblade101
Member
Witchblade101 commented now

@Witchblade101 Was that the exact error message? It's hard to tell whether it's safe to ignore or not just from that...

No. To see the full error look at the failed checks for PR #261 (which is what these comments refer to. It was a long night, and Mario's NRC work here is completely innocent!)

@Witchblade101
Copy link
Collaborator Author

Full pytest result from witserv2:

`========================================================= test session starts ==========================================================
platform linux -- Python 3.9.13, pytest-7.1.2, pluggy-1.0.0 -- /user/dlong/linux/miniconda3/envs/pysiaf/bin/python
cachedir: .pytest_cache
rootdir: /home/dlong/pysiaf, configfile: setup.cfg
collected 32 items

test_aperture.py::test_idl_to_tel FAILED [ 3%]
test_aperture.py::test_hst_fgs_idl_to_tel PASSED [ 6%]
test_aperture.py::test_jwst_aperture_transforms PASSED [ 9%]
test_aperture.py::test_jwst_aperture_vertices PASSED [ 12%]
test_aperture.py::test_raw_transformations PASSED [ 15%]
test_aperture.py::test_jwst_sky_transformations PASSED [ 18%]
test_hst.py::test_hst_aperture_init PASSED [ 21%]
test_hst.py::test_hst_siaf PASSED [ 25%]
test_hst.py::test_hst_amudotrep PASSED [ 28%]
test_iando.py::test_write_jwst_siaf_xml PASSED [ 31%]
test_iando.py::test_write_jwst_siaf_xlsx PASSED [ 34%]
test_match_v2v3.py::test_match_v2v3 PASSED [ 37%]
test_miri.py::test_against_test_data PASSED [ 40%]
test_nirspec.py::test_against_test_data PASSED [ 43%]
test_nirspec.py::test_nirspec_aperture_transforms PASSED [ 46%]
test_nirspec.py::test_nirspec_slit_transformations PASSED [ 50%]
test_nirspec.py::test_sci_det_consistency PASSED [ 53%]
test_plotting.py::test_aperture_plotting PASSED [ 56%]
test_polynomial.py::test_poly PASSED [ 59%]
test_polynomial.py::test_RotateCoeffs PASSED [ 62%]
test_polynomial.py::test_two_step PASSED [ 65%]
test_polynomial.py::test_invert PASSED [ 68%]
test_polynomial.py::test_ShiftCoeffs PASSED [ 71%]
test_projection.py::test_tangent_plane_projection_roundtrip PASSED [ 75%]
test_projection.py::test_project_to_tangent_plane PASSED [ 78%]
test_projection.py::test_deproject_from_tangent_plane PASSED [ 81%]
test_rotations.py::test_attitude PASSED [ 84%]
test_rotations.py::test_attitude_matrix PASSED [ 87%]
test_rotations.py::test_sky_to_tel PASSED [ 90%]
test_rotations.py::test_axial_rotation PASSED [ 93%]
test_rotations.py::test_unit_vector_from_cartesian PASSED [ 96%]
test_tools.py::test_jwst_fgs_to_fgs_matrix PASSED [100%]

=============================================================== FAILURES ===============================================================
___________________________________________________________ test_idl_to_tel ____________________________________________________________

verbose = False

def test_idl_to_tel(verbose=False):
    """Test the transformations between ideal and telescope frames."""
    siaf = Siaf('NIRISS')

    x_idl, y_idl = get_grid_coordinates(10, (0, 0), 100)

    for aper_name in siaf.apertures.keys():
        aperture = siaf[aper_name]

        for idl_to_tel_method in ['planar_approximation', 'spherical']:
            if idl_to_tel_method == 'spherical':
                input_coordinate_types = ['polar', 'cartesian']
            else:
                input_coordinate_types = ['tangent_plane']

            for input_coordinates in input_coordinate_types:
                v2, v3 = aperture.idl_to_tel(x_idl, y_idl, method=idl_to_tel_method, input_coordinates=input_coordinates, output_coordinates=input_coordinates)
                x_idl_2, y_idl_2 = aperture.tel_to_idl(v2, v3, method=idl_to_tel_method, input_coordinates=input_coordinates, output_coordinates=input_coordinates)
                x_diff = np.abs(x_idl - x_idl_2)
                y_diff = np.abs(y_idl - y_idl_2)
                if verbose:
                    print('{} {}: Aperture {} {} x_diff {} y_diff {}'.format(idl_to_tel_method, input_coordinates, aper_name, input_coordinates, np.max(x_diff), np.max(y_diff)))
                if idl_to_tel_method == 'planar_approximation':
                    threshold = 7e-14
                elif idl_to_tel_method == 'spherical':
                    if input_coordinates == 'polar':
                        threshold = 6e-13
                    elif input_coordinates == 'cartesian':
                        threshold = 5e-8
                assert np.max(x_diff) < threshold
              assert np.max(y_diff) < threshold

E assert 7.105427357601002e-14 < 7e-14
E + where 7.105427357601002e-14 = <function amax at 0x7f3e4b18d4c0>(array([1.42108547e-14, 4.97379915e-14, 4.26325641e-14, 7.10542736e-15,\n 2.13162821e-14, 4.97379915e-14, 3.55271368e-14, 7.10542736e-15,\n 2.84217094e-14, 4.97379915e-14, 4.26325641e-14, 4.97379915e-14,\n 2.13162821e-14, 1.42108547e-14, 4.26325641e-14, 7.10542736e-14,\n 1.42108547e-14, 1.42108547e-14, 4.26325641e-14, 4.26325641e-14,\n 5.32907052e-14, 3.55271368e-14, 3.55271368e-15, 2.48689958e-14,\n 5.68434189e-14, 2.84217094e-14, 3.55271368e-15, 2.84217094e-14,\n 5.68434189e-14, 2.48689958e-14, 4.97379915e-14, 1.77635684e-14,\n 7.10542736e-15, 3.90798505e-14, 4.61852778e-14, 1.42108547e-14,\n 1.42108547e-14, 3.90798505e-14, 4.26325641e-14, 1.42108547e-14,\n 2.84217094e-14, 8.88178420e-16, 3.10862447e-14, 5.50670620e-14,\n 2.48689958e-14, 4.44089210e-15, 3.37507799e-14, 5.06261699e-14,\n 2.22044605e-14, 7.10542736e-15, 7.10542736e-15, 2.22044605e-14,\n 5.06261699e-14, 3.37507799e-14, 4.44089210e-15, 2.48689958e-14,\n 5.50670620e-14, 3.10862447e-14, 8.88178420e-16, 2.84217094e-14,\n 0.00000000e+00, 2.84217094e-14, 5.32907052e-14, 2.84217094e-14,\n 0.00000000e+00, 3.19744231e-14, 5.32907052e-14, 2.13162821e-14,\n 3.55271368e-15, 3.55271368e-14, 1.77635684e-14, 4.97379915e-14,\n 3.55271368e-14, 3.55271368e-15, 2.13162821e-14, 6.39488462e-14,\n 3.19744231e-14, 3.55271368e-15, 2.84217094e-14, 6.03961325e-14,\n 4.26325641e-14, 4.26325641e-14, 1.42108547e-14, 1.42108547e-14,\n 7.10542736e-14, 4.26325641e-14, 1.42108547e-14, 2.13162821e-14,\n 4.97379915e-14, 4.26325641e-14, 4.97379915e-14, 2.84217094e-14,\n 7.10542736e-15, 3.55271368e-14, 4.97379915e-14, 2.13162821e-14,\n 7.10542736e-15, 4.26325641e-14, 4.97379915e-14, 1.42108547e-14]))
E + where <function amax at 0x7f3e4b18d4c0> = np.max

test_aperture.py:57: AssertionError
======================================================= short test summary info ========================================================
FAILED test_aperture.py::test_idl_to_tel - assert 7.105427357601002e-14 < 7e-14
==================================================== 1 failed, 31 passed in 28.68s =====================================================`

@Witchblade101
Copy link
Collaborator Author

@tonysohn for completeness here's the full run I just did on my Mac:

`========================================================= test session starts ==========================================================
platform darwin -- Python 3.9.12, pytest-7.1.1, pluggy-1.0.0 -- /Users/dlong/miniconda3/envs/pysiaf/bin/python
cachedir: .pytest_cache
rootdir: /Users/dlong/pysiaf, configfile: setup.cfg
collected 32 items

test_aperture.py::test_idl_to_tel PASSED [ 3%]
test_aperture.py::test_hst_fgs_idl_to_tel PASSED [ 6%]
test_aperture.py::test_jwst_aperture_transforms PASSED [ 9%]
test_aperture.py::test_jwst_aperture_vertices PASSED [ 12%]
test_aperture.py::test_raw_transformations PASSED [ 15%]
test_aperture.py::test_jwst_sky_transformations PASSED [ 18%]
test_hst.py::test_hst_aperture_init PASSED [ 21%]
test_hst.py::test_hst_siaf PASSED [ 25%]
test_hst.py::test_hst_amudotrep PASSED [ 28%]
test_iando.py::test_write_jwst_siaf_xml PASSED [ 31%]
test_iando.py::test_write_jwst_siaf_xlsx PASSED [ 34%]
test_match_v2v3.py::test_match_v2v3 PASSED [ 37%]
test_miri.py::test_against_test_data PASSED [ 40%]
test_nirspec.py::test_against_test_data PASSED [ 43%]
test_nirspec.py::test_nirspec_aperture_transforms PASSED [ 46%]
test_nirspec.py::test_nirspec_slit_transformations PASSED [ 50%]
test_nirspec.py::test_sci_det_consistency PASSED [ 53%]
test_plotting.py::test_aperture_plotting PASSED [ 56%]
test_polynomial.py::test_poly PASSED [ 59%]
test_polynomial.py::test_RotateCoeffs PASSED [ 62%]
test_polynomial.py::test_two_step PASSED [ 65%]
test_polynomial.py::test_invert PASSED [ 68%]
test_polynomial.py::test_ShiftCoeffs PASSED [ 71%]
test_projection.py::test_tangent_plane_projection_roundtrip PASSED [ 75%]
test_projection.py::test_project_to_tangent_plane PASSED [ 78%]
test_projection.py::test_deproject_from_tangent_plane PASSED [ 81%]
test_rotations.py::test_attitude PASSED [ 84%]
test_rotations.py::test_attitude_matrix PASSED [ 87%]
test_rotations.py::test_sky_to_tel PASSED [ 90%]
test_rotations.py::test_axial_rotation PASSED [ 93%]
test_rotations.py::test_unit_vector_from_cartesian PASSED [ 96%]
test_tools.py::test_jwst_fgs_to_fgs_matrix PASSED [100%]

========================================================= 32 passed in 31.71s ==========================================================`

@tonysohn
Copy link
Collaborator

tonysohn commented Jun 8, 2022

Okay, the fact that this error message is machine dependent (as you implied) tells me that this is not an issue. We can look into this further later, but I'd say we close this for now.

@Witchblade101
Copy link
Collaborator Author

Sounds good. I'll open a new issue for test_idl_to_tel later.

@Witchblade101 Witchblade101 merged commit f83898e into spacetelescope:siaf-updates Jun 8, 2022
@Witchblade101 Witchblade101 deleted the dummy_release branch December 12, 2022 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants