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

Bug metastable plotting #49

Merged
merged 2 commits into from
Oct 23, 2022
Merged

Conversation

PeBoch
Copy link
Contributor

@PeBoch PeBoch commented Oct 20, 2022

Hi

I tried to fix issue 45: having the possibility to distinguish between isotope states for plotting.

Main changes are to NuclideDataEntry class to have a "state" and nuclidelib.py adding a new function get_all_isotopes_states(). By default get_all_isotopes_states() gives back a list of all isotopes and all states of STATE_MAPPINGS (part of which is "m" for metastable). Don't know if it makes sense to include other STATE_MAPPINGS than "m". Also plotproperty distinguishes the state now.

In plotnuclideheat.py I tried the changes by with different plot examples.

The get_all_isotopes() function also continues working (if there is no interest in the state): added IndexError handling in NuclideDataEntry self.state for this purpose. Not sure if that is good practice. :D

Any feedback would be great!

…fispact#45)

examples/outputplotting/plotnuclideheat.py
- plotting all isotopes of one element with get_all_isotopes as before, here Sc
- plotting one specific ZAI with new get_all_isotopes_states, here Sc45m
- plotting all isotopes and states of an element with new get_all_isotopes_states, here Sc

pypact/analysis/__init__.py
- import new get_all_isotopes_states()

pypact/analysis/propertyplotter.py
- NuclideDataEntry class(): added self.state, IndexError handling if get_all_isotopes() is used instead of of get_all_isotopes_states()
- plotproperty(): also distinguish by state, labels

pypact/library/nuclidelib.py
- new function get_all_isotopes_states(): multiplying by STATE_MAPPINGS
@thomasms
Copy link
Member

This is great! It works well - thanks for the fix.

@thomasms thomasms merged commit be77231 into fispact:master Oct 23, 2022
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