Skip to content

Fix a test for a proseco fix and update a warning print for future numpy 2 compat#224

Merged
jeanconn merged 2 commits intomasterfrom
numpy2
Dec 9, 2025
Merged

Fix a test for a proseco fix and update a warning print for future numpy 2 compat#224
jeanconn merged 2 commits intomasterfrom
numpy2

Conversation

@jeanconn
Copy link
Copy Markdown
Contributor

@jeanconn jeanconn commented Dec 3, 2025

Description

Two small updates:

  1. Updates test reference data in the test_bad_star_set test for latent bug fix found in numpy 2 testing . There should always have been the candidate criteria critical warning in the warns for that test.

  2. Cast the star catalog index to an int in the check_guide_geometry. This is only used in the warning printing.

Requires

Interface impacts

Testing

Unit tests

  • Mac ska3 latest "pre hope"
(ska3-latest) flame:sparkles jean$ export PYTHONPATH=/Users/jean/git/proseco
(ska3-latest) flame:sparkles jean$ python -c "import proseco; print(proseco.__version__)"
5.17.1.dev1+ga6b51fa
(ska3-latest) flame:sparkles jean$ git rev-parse HEAD
b8acee57652d92e71bce37be38f89be769f6498d
(ska3-latest) flame:sparkles jean$ pytest
============================================================= test session starts =============================================================
platform darwin -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0
rootdir: /Users/jean/git
configfile: pytest.ini
plugins: socket-0.7.0, anyio-4.7.0, timeout-2.3.1
collected 128 items                                                                                                                           

sparkles/tests/test_checks.py ..................................................................................................        [ 76%]
sparkles/tests/test_find_er_catalog.py .....                                                                                            [ 80%]
sparkles/tests/test_review.py .....................                                                                                     [ 96%]
sparkles/tests/test_yoshi.py ....                                                                                                       [100%]

============================================================== warnings summary ===============================================================
sparkles/sparkles/tests/test_review.py::test_jupiter_not_present
sparkles/sparkles/tests/test_review.py::test_jupiter_not_present
  /Users/jean/miniforge3/envs/ska3-latest/lib/python3.12/site-packages/bs4/builder/_lxml.py:124: DeprecationWarning: The 'strip_cdata' option of HTMLParser() has never done anything and will eventually be removed.
    parser = parser(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
====================================================== 128 passed, 2 warnings in 36.95
ska3-jeanconn-kady> export PYTHONPATH=/home/jeanconn/git/proseco
ska3-jeanconn-kady> python -c "import proseco; print(proseco.__version__)"
5.17.1.dev2+gb7c8104
ska3-jeanconn-kady> pytest
=========================================================== test session starts ===========================================================
platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0
rootdir: /proj/sot/ska/jeanproj/git
configfile: pytest.ini
plugins: anyio-4.7.0, timeout-2.3.1
collected 128 items                                                                                                                       

sparkles/tests/test_checks.py ..................................................................................................    [ 76%]
sparkles/tests/test_find_er_catalog.py .....                                                                                        [ 80%]
sparkles/tests/test_review.py .....................                                                                                 [ 96%]
sparkles/tests/test_yoshi.py ....                                                                                                   [100%]

============================================================ warnings summary =============================================================
sparkles/sparkles/tests/test_review.py::test_jupiter_present
sparkles/sparkles/tests/test_review.py::test_jupiter_not_present
sparkles/sparkles/tests/test_review.py::test_jupiter_not_present
  /proj/sot/ska3/flight/lib/python3.12/site-packages/bs4/builder/_lxml.py:124: DeprecationWarning: The 'strip_cdata' option of HTMLParser() has never done anything and will eventually be removed.
    parser = parser(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=============================================== 128 passed, 3 warnings in 110.29s (0:01:50) ===============================================
ska3-jeanconn-kady> git rev-parse HEAD
b8acee57652d92e71bce37be38f89be769f6498d
  • OSX with recent hope plus proseco PR
(ska3-flight-2026.0rc4) flame:sparkles jean$ git rev-parse HEAD
b8acee57652d92e71bce37be38f89be769f6498d
(ska3-flight-2026.0rc4) flame:sparkles jean$ python -c "import proseco; print(proseco.__version__)"
5.17.1.dev1+ga6b51fa9c
(ska3-flight-2026.0rc4) flame:sparkles jean$ pytest 
================================================== test session starts ===================================================
platform darwin -- Python 3.13.10, pytest-9.0.1, pluggy-1.6.0
rootdir: /Users/jean/git
configfile: pytest.ini
plugins: anyio-4.12.0, timeout-2.4.0
collected 128 items                                                                                                      

sparkles/tests/test_checks.py .................................................................................... [ 65%]
..............                                                                                                     [ 76%]
sparkles/tests/test_find_er_catalog.py .....                                                                       [ 80%]
sparkles/tests/test_review.py .....................                                                                [ 96%]
sparkles/tests/test_yoshi.py ....                                                                                  [100%]

==================================================== warnings summary ====================================================
sparkles/sparkles/tests/test_checks.py: 108 warnings
sparkles/sparkles/tests/test_find_er_catalog.py: 10 warnings
sparkles/sparkles/tests/test_review.py: 91 warnings
sparkles/sparkles/tests/test_yoshi.py: 2 warnings
  /Users/jean/miniforge3/envs/ska3-flight-2026.0rc4/lib/python3.13/site-packages/proseco/guide.py:964: DeprecationWarning: `in1d` is deprecated. Use `np.isin` instead.
    bad = np.in1d(cand_guides["id"], list(ACA.bad_star_set))

sparkles/sparkles/tests/test_checks.py::test_check_jupiter_acq_spoilers_fail[ACAReviewTable]
sparkles/sparkles/tests/test_checks.py::test_check_jupiter_acq_spoilers_fail[ACACheckTable]
sparkles/sparkles/tests/test_checks.py::test_check_jupiter_acq_spoilers_none[ACAReviewTable]
sparkles/sparkles/tests/test_checks.py::test_check_jupiter_acq_spoilers_none[ACACheckTable]
sparkles/sparkles/tests/test_review.py::test_jupiter_present
sparkles/sparkles/tests/test_review.py::test_jupiter_not_present
  /Users/jean/git/sparkles/sparkles/checks.py:152: DeprecationWarning: `in1d` is deprecated. Use `np.isin` instead.
    ok = np.in1d(acar["type"], ("BOT", "ACQ"))

sparkles/sparkles/tests/test_checks.py: 10 warnings
sparkles/sparkles/tests/test_review.py: 2 warnings
  /Users/jean/git/sparkles/sparkles/checks.py:194: DeprecationWarning: `in1d` is deprecated. Use `np.isin` instead.
    ok = np.in1d(acar["type"], ("GUI", "BOT", "FID"))

sparkles/sparkles/tests/test_checks.py::test_check_jupiter_distribution[-300-ACAReviewTable]
sparkles/sparkles/tests/test_checks.py::test_check_jupiter_distribution[-300-ACACheckTable]
sparkles/sparkles/tests/test_checks.py::test_check_jupiter_distribution[300-ACAReviewTable]
sparkles/sparkles/tests/test_checks.py::test_check_jupiter_distribution[300-ACACheckTable]
sparkles/sparkles/tests/test_checks.py::test_check_jupiter_distribution_cross[ACAReviewTable]
sparkles/sparkles/tests/test_checks.py::test_check_jupiter_distribution_cross[ACACheckTable]
sparkles/sparkles/tests/test_review.py::test_jupiter_present
sparkles/sparkles/tests/test_review.py::test_jupiter_not_present
  /Users/jean/git/sparkles/sparkles/checks.py:228: DeprecationWarning: `in1d` is deprecated. Use `np.isin` instead.
    ok = np.in1d(acar["type"], ("GUI", "BOT"))

sparkles/sparkles/tests/test_checks.py: 13 warnings
sparkles/sparkles/tests/test_find_er_catalog.py: 5 warnings
sparkles/sparkles/tests/test_review.py: 68 warnings
sparkles/sparkles/tests/test_yoshi.py: 1 warning
  /Users/jean/git/sparkles/sparkles/checks.py:49: DeprecationWarning: `in1d` is deprecated. Use `np.isin` instead.
    ok = np.in1d(acar["type"], ("GUI", "BOT", "FID", "MON"))

sparkles/sparkles/tests/test_checks.py: 23 warnings
sparkles/sparkles/tests/test_find_er_catalog.py: 5 warnings
sparkles/sparkles/tests/test_review.py: 68 warnings
sparkles/sparkles/tests/test_yoshi.py: 1 warning
  /Users/jean/git/sparkles/sparkles/checks.py:252: DeprecationWarning: `in1d` is deprecated. Use `np.isin` instead.
    ok = np.in1d(acar["type"], ("GUI", "BOT"))

sparkles/sparkles/tests/test_checks.py::test_include_exclude[ACAReviewTable]
sparkles/sparkles/tests/test_checks.py::test_include_exclude[ACACheckTable]
sparkles/sparkles/tests/test_review.py::test_roll_options_with_include_ids
  /Users/jean/miniforge3/envs/ska3-flight-2026.0rc4/lib/python3.13/site-packages/proseco/acq.py:856: DeprecationWarning: `in1d` is deprecated. Use `np.isin` instead.
    ok = np.in1d(cand_acqs["id"], self.include_ids)

sparkles/sparkles/tests/test_review.py: 18 warnings
  /Users/jean/git/sparkles/sparkles/roll_optimize.py:164: DeprecationWarning: `in1d` is deprecated. Use `np.isin` instead.
    overlap = np.in1d(self.guides["id"], acqs["id"])

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================================== 128 passed, 442 warnings in 38.10s ===========================================
(ska3-flight-2026.0rc4) flame:sparkles jean$ 

Independent check of unit tests by [REVIEWER NAME]

  • [PLATFORM]:

Functional tests

No functional testing.

@jeanconn jeanconn marked this pull request as ready for review December 9, 2025 16:28
@javierggt
Copy link
Copy Markdown
Contributor

javierggt commented Dec 9, 2025

I note that, in order to get the tests passing, one need sot/proseco/pull/412, and considering this is a numpy 2 PR, I actually did my checks on the branch for #225 which is chained to this one, and rebased the proseco PR 412 on proseco PR 411 as well.

Doing all that, tests pass on ska3-flight and hope.

@taldcroft
Copy link
Copy Markdown
Member

@jeanconn - this needs to be tested in ska3-flight as well.

@jeanconn
Copy link
Copy Markdown
Contributor Author

jeanconn commented Dec 9, 2025

I don't generally test in ska3-flight. This is not really a numpy 2 PR at this point.

@jeanconn jeanconn changed the title Tiny fixes for numpy2 Fix a test for a proseco fix and update a warning print for future numpy 2 compat Dec 9, 2025
@jeanconn
Copy link
Copy Markdown
Contributor Author

jeanconn commented Dec 9, 2025

#225 is not required to test this PR.

@javierggt
Copy link
Copy Markdown
Contributor

#225 is not required to test this PR.

It is not, but combinatorics is a thing. I am testing in ska3-flight and hope, and in all numpy 2 PRs. If they are chained, it makes life easier.

@jeanconn
Copy link
Copy Markdown
Contributor Author

jeanconn commented Dec 9, 2025

Right, it just means you didn't test this PR in isolation and I thought the #225 code was just about warnings.

@taldcroft
Copy link
Copy Markdown
Member

I don't generally test in ska3-flight. This is not really a numpy 2 PR at this point.

I'm not sure what that means, but it will be faster to just test all these PRs in both flight and hope than to discuss.

@jeanconn
Copy link
Copy Markdown
Contributor Author

jeanconn commented Dec 9, 2025

I do all of my ska PR testing in latest. And my latest is pre numpy 2.0 . I only documented testing above in that environment.

@jeanconn
Copy link
Copy Markdown
Contributor Author

jeanconn commented Dec 9, 2025

My overall point was that since we decided to have all PRs be back compatible, my take-away was that testing in current pre-hope latest was really sufficient for development at this point and release testing will cover hope testing. But I'm typing this while I'm trying to get to ska3-flight on Linux to sure, run the tests again if ska3-flight plus the proseco PR is favored.

@javierggt
Copy link
Copy Markdown
Contributor

I don't understand. I approved the PR. Do you need me to approve it again?

@jeanconn
Copy link
Copy Markdown
Contributor Author

jeanconn commented Dec 9, 2025

Tom said I needed to test on ska3-flight.

@jeanconn jeanconn merged commit d23899e into master Dec 9, 2025
2 checks passed
@jeanconn jeanconn deleted the numpy2 branch December 9, 2025 18:16
This was referenced Jan 20, 2026
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