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

Use parse_cm load_dir_from_load_name and test #288

Merged
merged 1 commit into from
Jan 17, 2024

Conversation

taldcroft
Copy link
Member

@taldcroft taldcroft commented Jan 10, 2024

Description

This updates a utiliity function to use parse_cm.paths.load_dir_from_load_name() instead of kadi.commands.core.ska_load_dir() which is deprecated.

Interface impacts

None

Testing

Unit tests

(masters) ➜  mica git:(use-parsecm-load-dir-from-load-name) git rev-parse HEAD                                                             
892751a4701f92c08daa6278a0f30ea75ddcd34a
(masters) ➜  mica git:(use-parsecm-load-dir-from-load-name) pytest                      
==================================================================== test session starts ====================================================================
platform darwin -- Python 3.10.8, pytest-7.2.1, pluggy-1.0.0
rootdir: /Users/aldcroft/git, configfile: pytest.ini
plugins: timeout-2.1.0, anyio-3.6.2
collected 107 items                                                                                                                                         

mica/archive/tests/test_aca_dark_cal.py ..................                                                                                            [ 16%]
mica/archive/tests/test_aca_hdr3.py s                                                                                                                 [ 17%]
mica/archive/tests/test_aca_l0.py sss                                                                                                                 [ 20%]
mica/archive/tests/test_asp_l1.py ssssss                                                                                                              [ 26%]
mica/archive/tests/test_cda.py ..............................................                                                                         [ 69%]
mica/archive/tests/test_obspar.py .                                                                                                                   [ 70%]
mica/report/tests/test_write_report.py s                                                                                                              [ 71%]
mica/starcheck/tests/test_catalog_fetches.py ...............                                                                                          [ 85%]
mica/stats/tests/test_acq_stats.py .ss                                                                                                                [ 87%]
mica/stats/tests/test_guide_stats.py .sss                                                                                                             [ 91%]
mica/vv/tests/test_vv.py sssssssss                                                                                                                    [100%]

============================================================== 82 passed, 25 skipped in 20.63s ==============================================================
(razl) ➜  mica git:(use-parsecm-load-dir-from-load-name)  

Independent check of unit tests by Jean

  • Linux
(ska3-masters) jeanconn-fido> pytest
===================================================================================== test session starts =====================================================================================
platform linux -- Python 3.10.8, pytest-7.2.1, pluggy-1.0.0
rootdir: /proj/sot/ska/jeanproj/git/mica
plugins: timeout-2.1.0, anyio-3.6.2
collected 107 items                                                                                                                                                                           

mica/archive/tests/test_aca_dark_cal.py ..................                                                                                                                              [ 16%]
mica/archive/tests/test_aca_hdr3.py .                                                                                                                                                   [ 17%]
mica/archive/tests/test_aca_l0.py ...                                                                                                                                                   [ 20%]
mica/archive/tests/test_asp_l1.py ......                                                                                                                                                [ 26%]
mica/archive/tests/test_cda.py ..............................................                                                                                                           [ 69%]
mica/archive/tests/test_obspar.py .                                                                                                                                                     [ 70%]
mica/report/tests/test_write_report.py .                                                                                                                                                [ 71%]
mica/starcheck/tests/test_catalog_fetches.py ...............                                                                                                                            [ 85%]
mica/stats/tests/test_acq_stats.py ...                                                                                                                                                  [ 87%]
mica/stats/tests/test_guide_stats.py ....                                                                                                                                               [ 91%]
mica/vv/tests/test_vv.py .........                                                                                                                                                      [100%]

====================================================================================== warnings summary =======================================================================================
../../../../../../fido.real/conda/envs/ska3-masters/lib/python3.10/site-packages/numexpr/expressions.py:21
../../../../../../fido.real/conda/envs/ska3-masters/lib/python3.10/site-packages/numexpr/expressions.py:21
  /fido.real/conda/envs/ska3-masters/lib/python3.10/site-packages/numexpr/expressions.py:21: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    _np_version_forbids_neg_powint = LooseVersion(numpy.__version__) >= LooseVersion('1.12.0b1')

../../../../../../fido.real/conda/envs/ska3-masters/lib/python3.10/site-packages/jupyter_client/connect.py:27
  /fido.real/conda/envs/ska3-masters/lib/python3.10/site-packages/jupyter_client/connect.py:27: DeprecationWarning: Jupyter is migrating its paths to use standard platformdirs
  given by the platformdirs library.  To remove this warning and
  see the appropriate new directories, set the environment variable
  `JUPYTER_PLATFORM_DIRS=1` and then run `jupyter --paths`.
  The use of platformdirs will be the default in `jupyter_core` v6
    from jupyter_core.paths import jupyter_data_dir

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
========================================================================= 107 passed, 3 warnings in 527.59s (0:08:47) ===============================================================
(ska3-masters) jeanconn-fido> python -c "import kadi; print(kadi.__version__)"
7.8.1.dev13+g2b977de
(ska3-masters) jeanconn-fido> git rev-parse HEAD
8a8995e1197fc101a83dc75871ab5ab1c21807f1

Functional tests

For kicks I modified the load_name_to_mp_dir() function always return "" to check test coverage. This failed a number of tests in test_catalog_fetches.py so that is reassuring.

@taldcroft taldcroft merged commit 45efdbd into master Jan 17, 2024
@taldcroft taldcroft deleted the use-parsecm-load-dir-from-load-name branch January 17, 2024 17:26
This was referenced Mar 6, 2024
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