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

Eliminate deprecation warnings from scipy and pandas #2951

Merged
merged 3 commits into from
Jun 12, 2024

Conversation

paulromano
Copy link
Contributor

Description

Our test suite currently produces a few deprecation warnings from scipy:

tests/regression_tests/mg_convert/test.py::test_mg_convert
  /home/runner/work/openmc/openmc/openmc/mgxs_library.py:1922: DeprecationWarning: 'scipy.integrate.simps' is deprecated in favour of 'scipy.integrate.simpson' and will be removed in SciPy 1.14.0
    new_data[..., l] = simps(y, mu_fine)

and pandas:

tests/unit_tests/test_data_photon.py::test_export_to_hdf5[Pu]
  /home/runner/work/openmc/openmc/openmc/data/photon.py:390: FutureWarning: Downcasting behavior in `replace` is deprecated and will be removed in a future version. To retain the old behavior, explicitly call `result.infer_objects(copy=False)`. To opt-in to the future behavior, set `pd.set_option('future.no_silent_downcasting', True)`
    df = self.transitions[shell].replace(

The pandas deprecation is explained a little more here for those who are interested.

Checklist

  • I have performed a self-review of my own code
  • I have run clang-format (version 15) on any C++ source files (if applicable)
  • I have followed the style guidelines for Python source files (if applicable)
  • I have made corresponding changes to the documentation (if applicable)
  • I have added tests that prove my fix is effective or that my feature works (if applicable)

@paulromano
Copy link
Contributor Author

There's a test failure on our Python 3.7 configuration due to an outdated version of pandas. If and when #2958 is merged, that will resolve the issue here.

@paulromano paulromano added this to the v0.15.0 milestone Jun 11, 2024
Copy link
Contributor

@eepeterson eepeterson left a comment

Choose a reason for hiding this comment

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

LGTM!

@eepeterson eepeterson merged commit dcb8033 into openmc-dev:develop Jun 12, 2024
18 checks passed
@paulromano paulromano deleted the scipy-pandas-warnings branch June 12, 2024 12:00
church89 pushed a commit to openmsr/openmc that referenced this pull request Jul 18, 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