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

Remove np.str calls #296

Merged
merged 1 commit into from
Mar 19, 2024
Merged

Remove np.str calls #296

merged 1 commit into from
Mar 19, 2024

Conversation

jeanconn
Copy link
Contributor

Description

Remove np.str calls

Centroid dashboard fails with numpy error without this change.

Interface impacts

Testing

Unit tests

  • Linux
(ska3-masters) jeanconn-fido> export SKA=/proj/sot/ska
(ska3-masters) jeanconn-fido> pytest
============================================================================ test session starts =============================================================================
platform linux -- Python 3.11.8, pytest-8.0.2, pluggy-1.4.0
rootdir: /proj/sot/ska/jeanproj/git
configfile: pytest.ini
plugins: timeout-2.2.0, anyio-4.3.0
collected 108 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 ==============================================================================
mica/mica/archive/tests/test_aca_l0.py::test_l0_images_meta
mica/mica/archive/tests/test_aca_l0.py::test_l0_images_meta
mica/mica/archive/tests/test_aca_l0.py::test_get_l0_images
mica/mica/archive/tests/test_aca_l0.py::test_get_l0_images
  /fido.real/conda/envs/ska3-masters/lib/python3.11/site-packages/numpy/ma/core.py:429: DeprecationWarning: NumPy will stop allowing conversion of out-of-bound Python integers to integer arrays.  The conversion of -9999 to uint8 will fail in the future.
  For the old behavior, usually:
      np.array(value).astype(dtype)
  will give the desired result (the cast overflows).
    output_value.append(np.array(fval, dtype=cdtype).item())

mica/mica/archive/tests/test_asp_l1.py::test_get_atts_time
  /fido.real/conda/envs/ska3-masters/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'

mica/mica/archive/tests/test_asp_l1.py::test_get_atts_time
  /fido.real/conda/envs/ska3-masters/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
================================================================ 108 passed, 6 warnings in 514.86s (0:08:34) =================================================================
(ska3-masters) jeanconn-fido> git rev-parse HEAD
8fbe6fad68f960de5578b9823e23a18676a51d4e

Independent check of unit tests by [REVIEWER NAME]

  • [PLATFORM]:

Functional tests

No functional testing.

@jeanconn jeanconn requested review from javierggt and taldcroft March 19, 2024 15:20
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.

LGTM.

@jeanconn jeanconn merged commit 5043feb into master Mar 19, 2024
@jeanconn jeanconn deleted the numpy-fix branch March 19, 2024 15:39
This was referenced Apr 17, 2024
@javierggt javierggt mentioned this pull request May 1, 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