SNEWS2 / snewpy

A Python package for working with supernova neutrinos
https://snewpy.readthedocs.io
BSD 3-Clause "New" or "Revised" License
26 stars 19 forks source link

`snewpy.snowglobes`: note deprecated parameters #173

Closed JostMigenda closed 2 years ago

JostMigenda commented 2 years ago

With the rewrite of the SNOwGLoBES interface in #132, several parameters to simulate() and collate() are no longer used. To avoid confusing users, this PR updates the docstrings to note that these parameters are deprecated and prints a warning message if one of these parameters is used.

github-actions[bot] commented 2 years ago

Result of Benchmark Tests

Benchmark Min Max Mean
python/snewpy/test/test_snowglobes.py::test_simulation_chain_benchmark 5.03 5.20 5.12 +- 0.06
JostMigenda commented 2 years ago

Regarding logging.warning() vs. warnings.warn(): Documentation recommends the latter for this purpose. If I understand correctly, the difference is that the former only prints text to stdout (or a file, or however logging is configured), whereas the latter raises an actual Warning (which may get printed to stdout or stderr by default; but gives the users more options to configure warning filters, e.g. to treat all warnings as errors).