openmc-dev / openmc

OpenMC Monte Carlo Code
https://docs.openmc.org
Other
699 stars 444 forks source link

Eliminate deprecation warnings from scipy and pandas #2951

Open paulromano opened 3 weeks ago

paulromano commented 3 weeks ago

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

paulromano commented 2 weeks ago

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.