COSMIC-PopSynth / COSMIC

COSMIC (Compact Object Synthesis and Monte Carlo Investigation Code)
GNU General Public License v3.0
45 stars 58 forks source link

Exchange some `print` statements for `warnings.warn` #574

Closed TomWagg closed 1 year ago

TomWagg commented 1 year ago

Hi! I've been using COSMIC with @katiebreivik and love it 😁 One small thing that was bugging me was the following message I got a lot

'zsun' is set to a different value than assumed in the mlwind prescriptions (you set it to '0.014' and in mlwind, zsun_wind=0.019)

So I just made a small PR to convert any print statements to warnings.warn. This shouldn't change anything but it does now allow me to use warnings.filterwarnings to ignore certain messages like this one about the zsun value πŸ™‚

I also wasn't sure on the changelog/version updating etiquette but I changed those too.

katiebreivik commented 1 year ago

Thanks for doing this @TomWagg -- I've been meaning to figure this out for a while, so this is very much appreciated! Thanks also for updating the changelog and versions.

codecov[bot] commented 1 year ago

Codecov Report

Base: 87.36% // Head: 87.04% // Decreases project coverage by -0.32% :warning:

Coverage data is based on head (2b659f6) compared to base (46a1528). Patch coverage: 50.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #574 +/- ## =========================================== - Coverage 87.36% 87.04% -0.32% =========================================== Files 39 39 Lines 25418 25426 +8 =========================================== - Hits 22205 22130 -75 - Misses 3213 3296 +83 ``` | [Impacted Files](https://codecov.io/gh/COSMIC-PopSynth/COSMIC/pull/574?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=COSMIC-PopSynth) | Coverage Ξ” | | |---|---|---| | [cosmic/utils.py](https://codecov.io/gh/COSMIC-PopSynth/COSMIC/pull/574/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=COSMIC-PopSynth#diff-Y29zbWljL3V0aWxzLnB5) | `80.23% <50.00%> (ΓΈ)` | | | [cosmic/evolve.py](https://codecov.io/gh/COSMIC-PopSynth/COSMIC/pull/574/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=COSMIC-PopSynth#diff-Y29zbWljL2V2b2x2ZS5weQ==) | `55.42% <0.00%> (-34.17%)` | :arrow_down: | | [cosmic/sample/cmc/elson.py](https://codecov.io/gh/COSMIC-PopSynth/COSMIC/pull/574/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=COSMIC-PopSynth#diff-Y29zbWljL3NhbXBsZS9jbWMvZWxzb24ucHk=) | `88.24% <0.00%> (-0.65%)` | :arrow_down: | | [cosmic/bse\_utils/zdata.py](https://codecov.io/gh/COSMIC-PopSynth/COSMIC/pull/574/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=COSMIC-PopSynth#diff-Y29zbWljL2JzZV91dGlscy96ZGF0YS5weQ==) | `100.00% <0.00%> (ΓΈ)` | | | [cosmic/bse\_utils/zcnsts.py](https://codecov.io/gh/COSMIC-PopSynth/COSMIC/pull/574/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=COSMIC-PopSynth#diff-Y29zbWljL2JzZV91dGlscy96Y25zdHMucHk=) | `100.00% <0.00%> (ΓΈ)` | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=COSMIC-PopSynth). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=COSMIC-PopSynth)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

katiebreivik commented 1 year ago

Yay! Tests passing -- merging now.