Skip to content

Commit

Permalink
Abundance widget bug fix (#2577)
Browse files Browse the repository at this point in the history
* Fixed CustomAbundanceWidget Bug caused by using wrong parameters of simulation_state

* Reformatted using black suggestion

* Updated Documentation concerning usage of CustomAbundanceWidget.from_simulation
  • Loading branch information
Sumit112192 authored Apr 24, 2024
1 parent 760dacd commit 63cde91
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/io/visualization/how_to_abundance_widget.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"outputs": [],
"source": [
"# sim = run_tardis(\"tardis_example.yml\")\n",
"# widget = CustomAbundanceWidget.from_sim(sim)"
"# widget = CustomAbundanceWidget.from_simulation(sim)"
]
},
{
Expand Down
6 changes: 4 additions & 2 deletions tardis/visualization/widgets/custom_abundance.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,10 @@ def from_simulation(cls, sim):
-------
CustomAbundanceWidgetData
"""
abundance = sim.simulation_state.raw_abundance.copy()
isotope_abundance = sim.simulation_state.raw_isotope_abundance.copy()
abundance = sim.simulation_state.abundance.copy()
isotope_abundance = (
sim.simulation_state.composition.raw_isotope_abundance.copy()
)

# integrate element and isotope to one DataFrame
abundance["mass_number"] = ""
Expand Down

0 comments on commit 63cde91

Please sign in to comment.