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

Removed some pandas warnings #9030

Merged
merged 2 commits into from
Sep 25, 2023
Merged

Removed some pandas warnings #9030

merged 2 commits into from
Sep 25, 2023

Conversation

micheles
Copy link
Contributor

@micheles micheles commented Sep 25, 2023

Part of #9020. The warning in openquake/commonlib/tests/reinsurance_test.py was

  /home/michele/oq-engine/openquake/risklib/reinsurance.py:64: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison
    [indices] = np.where(dframe.liability.to_numpy() == '')

and in test_ideductible_exposure was

  <__array_function__ internals>:180: DeprecationWarning: Calling nonzero on 0d arrays is deprecated, as it behaves surprisingly. Use `atleast_1d(cond).nonzero()` if the old behavior was intended. If the context of this warning is of the form `arr[nonzero(cond)]`, just use `arr[cond]`.

Also improved a reinsurance test to consider more events.

@micheles micheles added this to the Engine 3.18.0 milestone Sep 25, 2023
@micheles micheles self-assigned this Sep 25, 2023
@micheles micheles merged commit d4775e8 into master Sep 25, 2023
5 checks passed
@micheles micheles deleted the warnings branch September 25, 2023 05:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant