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

Add dyn-bgd-n-faint option for review #189

Merged
merged 2 commits into from
Jun 16, 2023
Merged

Add dyn-bgd-n-faint option for review #189

merged 2 commits into from
Jun 16, 2023

Conversation

jeanconn
Copy link
Contributor

@jeanconn jeanconn commented May 29, 2023

Description

Add dyn-bgd-n-faint option for review

Lets reviewer use dyn-bgd-n-faint without hacks in core.py

Interface impacts

Adds an info statement on every observation in the output.

Testing

"Still needs sot/ska_helpers#32 and sot/ska_sun#27 for current unit tests."

Unit tests

  • Mac

Independent check of unit tests by Javier

  • Mac

Test setup requiring ska_helper and ska_sun was not originally defined here - without those changes for the roll limits, the two test_review tests noted by Javier fail. This is OK for this PR -Jean.

Functional tests

Output including obsid 25821 (Abell 2029) at:

https://icxc.cfa.harvard.edu/aspect/test_review_outputs/sparkles-pr189/MAY2923P_2023_139_17_44_50_719_sparkles/#id25821

Copy link
Contributor

@javierggt javierggt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks ok to me

Copy link
Member

@taldcroft taldcroft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. We will want to follow on with changes to monkeypatch the default acq probability model to the 2020 grid floor (current flight) since a bunch of these tests (including your new one here) will fail when the acq prob model gets updated.

Copy link
Member

@taldcroft taldcroft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. We will want to follow on with changes to monkeypatch the default acq probability model to the 2020 grid floor (current flight) since a bunch of these tests (including your new one here) will fail when the acq prob model gets updated.

@jeanconn
Copy link
Contributor Author

jeanconn commented Jun 1, 2023

I think sparkles regress tests will probably need to be pinned to avoid issues with chandra_models roll table update too.

@jeanconn
Copy link
Contributor Author

For this, I was holding merge until a reviewer did the independent unit test run.

@javierggt
Copy link
Contributor

javierggt commented Jun 15, 2023

I ran the tests. The test that corresponds to this PR passes.

These two tests fail for me:

FAILED sparkles/tests/test_review.py::test_roll_options_dec89_9 - AssertionError: assert [' roll   P2 ...6601776', ...] == [' roll   P2 ... --       --']
FAILED sparkles/tests/test_review.py::test_roll_options_for_not_allowed_pitch - ValueError: Filtered data length must be at least 2

any idea why? is that the issue you just created?

@jeanconn
Copy link
Contributor Author

jeanconn commented Jun 16, 2023

And honestly, I've forgotten which roll limits worked for sparkles for the other tests (which are failing in master).

@jeanconn
Copy link
Contributor Author

And I'd tried with ska_helpers and ska_sun and the tests still weren't working but now they are so I'll update the description.

@jeanconn jeanconn merged commit 4f5c5f2 into master Jun 16, 2023
@jeanconn jeanconn deleted the dyn-bgd-cmdline branch June 16, 2023 14:47
@taldcroft
Copy link
Member

Ugh, I just tried to run sparkles tests in a ska3-dev environment with current master for ska_sun and ska_helpers. This went even worse, with a failure to collect tests. Not sure what's happening...

(ska3-dev) ➜  sparkles git:(master) pytest sparkles -v     
=================================================== test session starts ====================================================
platform darwin -- Python 3.10.8, pytest-7.2.1, pluggy-1.0.0 -- /Users/aldcroft/miniconda3/envs/ska3-dev/bin/python3.1
cachedir: .pytest_cache
rootdir: /Users/aldcroft/git, configfile: pytest.ini
plugins: timeout-2.1.0, anyio-3.6.2
collected 59 items / 1 error                                                                                               

========================================================== ERRORS ==========================================================
_____________________________ ERROR collecting sparkles/sparkles/tests/test_find_er_catalog.py _____________________________
sparkles/tests/test_find_er_catalog.py:39: in <module>
    ACA = get_aca_catalog(**KWARGS)
../../miniconda3/envs/ska3-dev/lib/python3.10/site-packages/proseco/__init__.py:90: in get_aca_catalog
    return get_aca_catalog(*args, **kwargs)
../../miniconda3/envs/ska3-dev/lib/python3.10/site-packages/proseco/catalog.py:66: in get_aca_catalog
    aca = _get_aca_catalog(obsid=obsid, raise_exc=raise_exc, **kwargs)
../../miniconda3/envs/ska3-dev/lib/python3.10/site-packages/proseco/catalog.py:130: in _get_aca_catalog
    aca.acqs = get_acq_catalog(stars=aca.stars, **kwargs)
../../miniconda3/envs/ska3-dev/lib/python3.10/site-packages/proseco/acq.py:175: in get_acq_catalog
    acq["probs"] = AcqProbs(
../../miniconda3/envs/ska3-dev/lib/python3.10/site-packages/proseco/acq.py:1481: in __init__
    p_acq_model = acq_success_prob(
../../miniconda3/envs/ska3-dev/lib/python3.10/site-packages/chandra_aca/star_probs.py:309: in acq_success_prob
    probs = grid_model_acq_prob(mags, t_ccds, colors, halfwidths, model=model)
../../miniconda3/envs/ska3-dev/lib/python3.10/site-packages/chandra_aca/star_probs.py:515: in grid_model_acq_prob
    gfm = get_grid_func_model(
../../miniconda3/envs/ska3-dev/lib/python3.10/site-packages/chandra_aca/star_probs.py:448: in get_grid_func_model
    "filename": info["data_file_path"],
E   TypeError: 'PosixPath' object is not subscriptable
================================================= short test summary info ==================================================
ERROR sparkles/tests/test_find_er_catalog.py - TypeError: 'PosixPath' object is not subscriptable
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

@jeanconn
Copy link
Contributor Author

Current master just passed for me with the ska3-matlab-2023.4rc3 release and chandra_models 3.48 . What were you testing for chandra_aca and chandra_models?

(ska3-matlab-2023.4rc3) spark:sparkles jean$ pytest
================================================== test session starts ==================================================
platform darwin -- Python 3.10.8, pytest-7.2.1, pluggy-1.0.0
rootdir: /Users/jean/git/sparkles
plugins: timeout-2.1.0, anyio-3.6.2
collected 64 items                                                                                                      

sparkles/tests/test_checks.py .....................................                                               [ 57%]
sparkles/tests/test_find_er_catalog.py .....                                                                      [ 65%]
sparkles/tests/test_review.py ..................                                                                  [ 93%]
sparkles/tests/test_yoshi.py ....                                                                                 [100%]

============================================ 64 passed in 192.23s (0:03:12) =============================================

@taldcroft
Copy link
Member

I had an out-of-date ska_helpers. All good now.

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.

3 participants