openmc icon indicating copy to clipboard operation
openmc copied to clipboard

Eliminate deprecation warnings from scipy and pandas

Open paulromano opened this issue 3 months ago • 1 comments

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

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

paulromano avatar Apr 11 '24 14:04 paulromano