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

fix NumPy warnings on null vector instantiation (NaN as value for int array); updates to match newer Numba deprecations; new simpler clock() impl; NUMBA_OPT for CI; Python 3.11 on CI #416

Merged
merged 43 commits into from
Jan 8, 2024

Conversation

bhiogade
Copy link
Contributor

No description provided.

@slayoo slayoo self-requested a review December 29, 2023 16:54
@codecov-commenter
Copy link

codecov-commenter commented Dec 29, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (7eec9a7) 91.79% compared to head (161b5e9) 92.02%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #416      +/-   ##
==========================================
+ Coverage   91.79%   92.02%   +0.23%     
==========================================
  Files          30       30              
  Lines        1475     1468       -7     
==========================================
- Hits         1354     1351       -3     
+ Misses        121      117       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@slayoo
Copy link
Member

slayoo commented Jan 1, 2024

OK, first here's an explanation why the problem has not been earlier caught on CI: it only show up on newer NumPy.
After bumping to newer Numpy (1.26.2), the same error can be observed on Github Actions:

Traceback (most recent call last):
  File "/home/runner/work/PyMPDATA/PyMPDATA/readme.py", line 60, in <module>
    stepper = Stepper(options=options, n_dims=2)
  File "/home/runner/work/PyMPDATA/PyMPDATA/PyMPDATA/stepper.py", line 67, in __init__
    self.__call, self.traversals = make_step_impl(
  File "/home/runner/work/PyMPDATA/PyMPDATA/PyMPDATA/stepper.py", line 116, in make_step_impl
    traversals = Traversals(
  File "/home/runner/work/PyMPDATA/PyMPDATA/PyMPDATA/impl/traversals.py", line 45, in __init__
    null_vector_field=VectorField.make_null(self.n_dims, self).impl,
  File "/home/runner/work/PyMPDATA/PyMPDATA/PyMPDATA/vector_field.py", line 104, in make_null
    VectorField(
  File "/home/runner/work/PyMPDATA/PyMPDATA/PyMPDATA/vector_field.py", line 47, in __init__
    self.data = tuple(
  File "/home/runner/work/PyMPDATA/PyMPDATA/PyMPDATA/vector_field.py", line 48, in <genexpr>
    np.full(shape_with_halo[dim], INVALID_INIT_VALUE, dtype=self.dtype)
  File "/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/numpy/core/numeric.py", line 330, in full
    multiarray.copyto(a, fill_value, casting='unsafe')
RuntimeWarning: invalid value encountered in cast

(https://github.com/open-atmos/PyMPDATA/actions/runs/7378420709/job/20073521039?pr=418)

Hence, bumping Numpy (and Numba) requirements in this PR

@slayoo slayoo mentioned this pull request Jan 1, 2024
@slayoo slayoo changed the title sort out issues with NumPy warnings on null vector instantiation (NaN as value for int array) sort out issues with NumPy warnings on null vector instantiation (NaN as value for int array) + updates to match newer Numba deprecations Jan 1, 2024
slayoo
slayoo previously approved these changes Jan 1, 2024
@slayoo slayoo changed the title sort out issues with NumPy warnings on null vector instantiation (NaN as value for int array) + updates to match newer Numba deprecations sort out issues with NumPy warnings on null vector instantiation (NaN as value for int array) + updates to match newer Numba deprecations + xfail for timing test on Windows + NUMBA_OPT for CI Jan 2, 2024
@slayoo slayoo changed the title sort out issues with NumPy warnings on null vector instantiation (NaN as value for int array) + updates to match newer Numba deprecations + xfail for timing test on Windows + NUMBA_OPT for CI sort out issues with NumPy warnings on null vector instantiation (NaN as value for int array) + updates to match newer Numba deprecations + new clock() impl (higher res on Windows) + NUMBA_OPT for CI Jan 2, 2024
@slayoo slayoo changed the title sort out issues with NumPy warnings on null vector instantiation (NaN as value for int array) + updates to match newer Numba deprecations + new clock() impl (higher res on Windows) + NUMBA_OPT for CI fix NumPy warnings on null vector instantiation (NaN as value for int array); updates to match newer Numba deprecations; new simpler clock() impl; NUMBA_OPT for CI; Python 3.11 on CI Jan 5, 2024
@slayoo slayoo added this pull request to the merge queue Jan 8, 2024
Merged via the queue into open-atmos:main with commit d32aa20 Jan 8, 2024
26 checks passed
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