Skip to content

Commit

Permalink
Merge pull request #41 from fusion-energy/develop
Browse files Browse the repository at this point in the history
Release 0.3.0
  • Loading branch information
shimwell authored Jun 22, 2022
2 parents 929e355 + 4556e0a commit d5208e1
Show file tree
Hide file tree
Showing 13 changed files with 55 additions and 110 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci_with_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ jobs:

- name: install dependancies
run: |
conda install -c conda-forge openmc
conda install -c conda-forge mamba
mamba install -c conda-forge openmc
- name: install package
run: |
Expand Down
3 changes: 3 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ authors:
- family-names: "Shimwell"
given-names: "Jonathan"
orcid: "https://orcid.org/0000-0001-6909-0946"
- family-names: "Delaporte-Mathurin"
given-names: "Rémi"
orcid: "https://orcid.org/0000-0003-1064-8882"
title: "A Python package for plotting regular mesh tally results from neutronics simulations."
version: 0.1.0
date-released: 2021-10-30
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,16 @@ Example 1 shows a OpenMC tally plotted
```python

import regular_mesh_plotter as rmp
import matplotlib.pyplot as plt

my_plot = rmp.plot_regular_mesh_tally(
rmp.plot_regular_mesh_tally(
tally=my_tally,
std_dev_or_tally_value="tally_value",
x_label="X [cm]",
y_label="Y [cm]",
)

my_plot.save_fig('openmc_mesh_tally_plot.png')
plt.savefig('openmc_mesh_tally_plot.png')
```

Example 4 shows a OpenMC tally plotted with an underlying DAGMC geometry
Expand Down
10 changes: 5 additions & 5 deletions examples/examples_from_readme.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from dagmc_geometry_slice_plotter import plot_slice_of_dagmc_geometry
from stl_to_h5m import stl_to_h5m

import matplotlib.pyplot as plt
import paramak

my_reactor = paramak.SubmersionTokamak(
Expand Down Expand Up @@ -45,29 +45,29 @@
)


plot = plot_slice_of_dagmc_geometry(
plot_slice_of_dagmc_geometry(
dagmc_file_or_trimesh_object="dagmc.h5m",
plane_normal=[0, 0, 1],
output_filename="my_plot1.png",
)


plot = plot_slice_of_dagmc_geometry(
plot_slice_of_dagmc_geometry(
dagmc_file_or_trimesh_object="dagmc.h5m",
plane_origin=[0, 0, 300],
plane_normal=[0, 0, 1],
output_filename="my_plot2.png",
)


plot = plot_slice_of_dagmc_geometry(
plot_slice_of_dagmc_geometry(
dagmc_file_or_trimesh_object="dagmc.h5m",
plane_normal=[0, 1, 0],
rotate_plot=45,
output_filename="my_plot3.png",
)

plot.savefig("big.png", dpi=600)
plt.savefig("big.png", dpi=600)

plot_slice_of_dagmc_geometry(
dagmc_file_or_trimesh_object="dagmc.h5m",
Expand Down
7 changes: 3 additions & 4 deletions examples/plot_regular_mesh_dose_tally.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import regular_mesh_plotter as rmp
import openmc
import matplotlib.pyplot as plt

# loads in the statepoint file containing tallies
statepoint = openmc.StatePoint(filepath="statepoint.2.h5")
Expand All @@ -8,11 +9,9 @@
my_tally = statepoint.get_tally(name="neutron_effective_dose_on_2D_mesh_xy")

# creates a plot of the mesh tally
my_plot = rmp.plot_regular_mesh_dose_tally(
rmp.plot_regular_mesh_dose_tally(
tally=my_tally, # the openmc tally object to plot, must be a 2d mesh tally
filename="plot_regular_mesh_dose_tally.png", # the filename of the picture file saved
scale=None, # LogNorm(),
vmin=None,
x_label="X [cm]",
y_label="Y [cm]",
rotate_plot=0,
Expand All @@ -22,4 +21,4 @@
)

# displays the plot
my_plot.show()
plt.show()
7 changes: 3 additions & 4 deletions examples/plot_regular_mesh_dose_tally_with_geometry.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import regular_mesh_plotter as rmp
import openmc
import matplotlib.pyplot as plt

# loads in the statepoint file containing tallies
statepoint = openmc.StatePoint(filepath="statepoint.2.h5")
Expand All @@ -8,12 +9,10 @@
my_tally = statepoint.get_tally(name="neutron_effective_dose_on_2D_mesh_xy")

# creates a plot of the mesh
my_plot = rmp.plot_regular_mesh_dose_tally_with_geometry(
rmp.plot_regular_mesh_dose_tally_with_geometry(
tally=my_tally,
dagmc_file_or_trimesh_object="dagmc.h5m",
filename="plot_regular_mesh_dose_tally_with_geometry.png",
scale=None, # LogNorm(),
vmin=None,
label="Effective dose [picosievert / second]",
x_label="X [cm]",
y_label="Y [cm]",
Expand All @@ -25,4 +24,4 @@
source_strength=1e20,
)

my_plot.show()
plt.show()
3 changes: 0 additions & 3 deletions examples/plot_regular_mesh_tally.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@
rmp.plot_regular_mesh_tally(
tally=my_tally,
filename="neutron_effective_dose_on_2D_mesh_xy.png",
scale=None, # LogNorm(),
vmin=None,
label="",
base_plt=None,
x_label="X [cm]",
y_label="Y [cm]",
# rotate_plot: float = 0,
Expand Down
8 changes: 4 additions & 4 deletions examples/plot_regular_mesh_tally_with_geometry.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import regular_mesh_plotter as rmp
import openmc

import matplotlib.pyplot as plt

# loads in the statepoint file containing tallies
statepoint = openmc.StatePoint(filepath="statepoint.2.h5")

# gets one tally from the available tallies
my_tally = statepoint.get_tally(name="neutron_effective_dose_on_2D_mesh_xy")

# creates a plot of the mesh
my_plot = rmp.plot_regular_mesh_tally_with_geometry(
rmp.plot_regular_mesh_tally_with_geometry(
tally=my_tally,
dagmc_file_or_trimesh_object="dagmc.h5m",
std_dev_or_tally_value="tally_value",
filename="plot_regular_mesh_tally_with_geometry.png",
scale=None, # LogNorm(),
vmin=None,
label="",
x_label="X [cm]",
y_label="Y [cm]",
Expand All @@ -26,4 +26,4 @@
source_strength=None,
)

my_plot.show()
plt.show()
2 changes: 0 additions & 2 deletions examples/plot_regular_mesh_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@
rmp.plot_regular_mesh_values(
values=values,
filename="plot_regular_mesh_values.png",
scale=None, # LogNorm(),
vmin=None,
label="legend label",
x_label="X [cm]",
y_label="Y [cm]",
Expand Down
2 changes: 0 additions & 2 deletions examples/plot_regular_mesh_values_with_geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@
values=values,
dagmc_file_or_trimesh_object="example.stl",
filename="plot_regular_mesh_values_with_geometry.png",
scale=None, # LogNorm(),
vmin=None,
label="legend label",
x_label="X [cm]",
y_label="Y [cm]",
Expand Down
Loading

0 comments on commit d5208e1

Please sign in to comment.