Skip to content

Commit

Permalink
Merge pull request #32 from fusion-energy/develop
Browse files Browse the repository at this point in the history
fixed x y infinity bug
  • Loading branch information
shimwell authored Nov 29, 2022
2 parents 1920a16 + fafa5ee commit f57e89e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ This repository contains:
# Plot regular mesh tallies
![openmc plot mesh](https://canada1.discourse-cdn.com/free1/uploads/openmc/original/2X/2/24a9db7bc9cc227908dbaf13a54d1245a4d16f20.gif)

# Plot weight windows
![openmc plot mesh](https://canada1.discourse-cdn.com/free1/uploads/openmc/original/2X/1/114aeb91172c7577e9231ffe30edf141678d26f6.gif)

# Install

OpenMC_plot can be install directly from the Python package index (PyPi) using pip.
Expand Down
30 changes: 16 additions & 14 deletions src/openmc_plot/geometry_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,25 +70,27 @@ def create_geometry_tab():
msg = "Infinity value found in X axis, axis length can't be automatically found. Input desired Z axis length"
x_width = col1.number_input(msg, value=1.0)
x_offset = col1.number_input("X axis offset")
x_width = abs(bb[0][0] - bb[1][0])
x_offset = col1.slider(
label="X axis offset",
min_value=float(bb[0][0]),
max_value=float(bb[1][0]),
value=float((bb[0][0] + bb[1][0]) / 2),
)
else:
x_width = abs(bb[0][0] - bb[1][0])
x_offset = col1.slider(
label="X axis offset",
min_value=float(bb[0][0]),
max_value=float(bb[1][0]),
value=float((bb[0][0] + bb[1][0]) / 2),
)

if np.isinf(bb[0][1]) or np.isinf(bb[1][1]):
msg = "Infinity value found in Y axis, axis length can't be automatically found. Input desired Z axis length"
y_width = col1.number_input(msg, value=1.0)
y_offset = col1.number_input("Y axis offset")
y_width = abs(bb[0][1] - bb[1][1])
y_offset = col1.slider(
label="Y axis offset",
min_value=float(bb[0][1]),
max_value=float(bb[1][1]),
value=float((bb[0][1] + bb[1][1]) / 2),
)
else:
y_width = abs(bb[0][1] - bb[1][1])
y_offset = col1.slider(
label="Y axis offset",
min_value=float(bb[0][1]),
max_value=float(bb[1][1]),
value=float((bb[0][1] + bb[1][1]) / 2),
)

if np.isinf(bb[0][2]) or np.isinf(bb[1][2]):
msg = "Infinity value found in Z axis, axis length can't be automatically found. Input desired Z axis length"
Expand Down
2 changes: 1 addition & 1 deletion src/openmc_plot/header.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def header():

st.write(
"""
# OpenMC plot ```v0.1.11```
# OpenMC plot ```v0.1.12```
### ⚛ A geometry plotting user interface for OpenMC.
🐍 Run this app locally with Python ```pip install openmc_plot``` then run with ```openmc_plot```
Expand Down

0 comments on commit f57e89e

Please sign in to comment.