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

Migrate maude_decom to CxoTime #183

Merged
merged 1 commit into from
Nov 14, 2024
Merged

Migrate maude_decom to CxoTime #183

merged 1 commit into from
Nov 14, 2024

Conversation

taldcroft
Copy link
Member

@taldcroft taldcroft commented Nov 7, 2024

Description

Migrate maude_decom.py to use CxoTime throughout and use recommended idioms for time delta arithmetic.

This also makes some improvements in docstrings. It accidentally includes an update that was intended for #181.

Requires

  • cxotime with CxoTime.linspace()
  • Based off the maude-aca-chunks branch.

Interface impacts

Testing

Unit tests

  • Mac
(ska3) ➜  docs git:(maude-use-cxotime) git rev-parse HEAD                                                               
374506ed1b5d85e48b5b16d701affbd30ffdbe0b
(ska3) ➜  docs git:(maude-use-cxotime) env PYTHONPATH=/Users/aldcroft/git/cxotime pytest
========================================================= test session starts ==========================================================
platform darwin -- Python 3.11.8, pytest-7.4.4, pluggy-1.4.0
rootdir: /Users/aldcroft/git
configfile: pytest.ini
plugins: cov-5.0.0, timeout-2.2.0, anyio-4.3.0
collected 0 items                                                                                                                      

======================================================== no tests ran in 0.03s =========================================================
(ska3) ➜  docs git:(maude-use-cxotime) cd ..
(ska3) ➜  chandra_aca git:(maude-use-cxotime) env PYTHONPATH=/Users/aldcroft/git/cxotime pytest
========================================================= test session starts ==========================================================
platform darwin -- Python 3.11.8, pytest-7.4.4, pluggy-1.4.0
rootdir: /Users/aldcroft/git
configfile: pytest.ini
plugins: cov-5.0.0, timeout-2.2.0, anyio-4.3.0
collected 216 items                                                                                                                    

chandra_aca/tests/test_aca_image.py .................                                                                            [  7%]
chandra_aca/tests/test_all.py ........................                                                                           [ 18%]
chandra_aca/tests/test_attitude.py .............................................................                                 [ 47%]
chandra_aca/tests/test_dark_model.py ............                                                                                [ 52%]
chandra_aca/tests/test_drift.py ..........................                                                                       [ 64%]
chandra_aca/tests/test_maude_decom.py ....................                                                                       [ 74%]
chandra_aca/tests/test_planets.py ...............                                                                                [ 81%]
chandra_aca/tests/test_psf.py ...                                                                                                [ 82%]
chandra_aca/tests/test_residuals.py ss...                                                                                        [ 84%]
chandra_aca/tests/test_star_probs.py .................................                                                           [100%]

============================================== 214 passed, 2 skipped, 1 warning in 34.40s ==============================================

Independent check of unit tests by Jean

  • OSX arm64
(ska3-flight-latest) flame:chandra_aca jean$ pytest
============================= test session starts ==============================
platform darwin -- Python 3.11.8, pytest-8.0.2, pluggy-1.4.0
PyQt5 5.15.9 -- Qt runtime 5.15.8 -- Qt compiled 5.15.8
rootdir: /Users/jean/git
configfile: pytest.ini
plugins: astropy-0.11.0, qt-4.4.0, cov-5.0.0, timeout-2.2.0, remotedata-0.4.1, anyio-4.3.0, filter-subpackage-0.2.0, doctestplus-1.2.1, astropy-header-0.2.2, hypothesis-6.112.0, arraydiff-0.6.1, mock-3.14.0
collected 216 items                                                            

chandra_aca/tests/test_aca_image.py .................                    [  7%]
chandra_aca/tests/test_all.py ........................                   [ 18%]
chandra_aca/tests/test_attitude.py ..................................... [ 36%]
........................                                                 [ 47%]
chandra_aca/tests/test_dark_model.py ............                        [ 52%]
chandra_aca/tests/test_drift.py ..........................               [ 64%]
chandra_aca/tests/test_maude_decom.py ....................                                                     [ 74%]
chandra_aca/tests/test_planets.py ...............                                                              [ 81%]
chandra_aca/tests/test_psf.py ...                                                                              [ 82%]
chandra_aca/tests/test_residuals.py ss...                                                                      [ 84%]
chandra_aca/tests/test_star_probs.py .................................                                         [100%]

================================================== warnings summary ==================================================
chandra_aca/chandra_aca/tests/test_residuals.py::test_obc
  /Users/jean/miniforge3/envs/ska3-flight-latest/lib/python3.11/site-packages/django/utils/encoding.py:266: DeprecationWarning: 'locale.getdefaultlocale' is deprecated and slated for removal in Python 3.15. Use setlocale(), getencoding() and getlocale() instead.
    encoding = locale.getdefaultlocale()[1] or 'ascii'

chandra_aca/chandra_aca/tests/test_residuals.py::test_obc
  /Users/jean/miniforge3/envs/ska3-flight-latest/lib/python3.11/site-packages/django/http/request.py:1: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
    import cgi

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
==================================== 214 passed, 2 skipped, 2 warnings in 44.06

Functional tests

No functional testing.

Base automatically changed from maude-aca-chunks to master November 7, 2024 13:41
@jeanconn jeanconn requested a review from Copilot November 13, 2024 19:36

Choose a reason for hiding this comment

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated no suggestions.

Comments skipped due to low confidence (1)

chandra_aca/maude_decom.py:278

  • The word 'returns' should be capitalized to 'Returns' to maintain consistency with the other docstrings.
Returns a dictionary with keys ['TIME', 'MNF', 'MJF', 'packets', 'flags'].
@taldcroft taldcroft merged commit c32b2de into master Nov 14, 2024
2 checks passed
@taldcroft taldcroft deleted the maude-use-cxotime branch November 14, 2024 00:58
@javierggt javierggt mentioned this pull request Dec 9, 2024
@javierggt javierggt mentioned this pull request Jan 23, 2025
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