Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ FROM ghcr.io/openmc-data-storage/nuclear_data_base_docker:h5_base
COPY requirements.txt .
RUN pip install -r requirements.txt

RUN pip install gunicorn==20.0.4

# finds the avaialble isotopes
ENV OPENMC_CROSS_SECTIONS=/TENDL-2019/cross_sections.xml
COPY find_dropdown_options.py .
Expand Down
83 changes: 31 additions & 52 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,35 @@
with open('options.json') as json_file:
element_names = load(json_file)

def make_plotly_graph(downloaded_data, energy_units, xaxis_scale, xs_units, yaxis_scale):

return [
dcc.Graph(
config=dict(showSendToCloud=True),
figure={
"data": downloaded_data,
"layout": {
"height": 800,
# "width":1600,
"margin": {"l": 3, "r": 2, "t": 15, "b": 60},
"xaxis": {
"title": {"text": f"Energy {energy_units}"},
"type": xaxis_scale,
"tickformat": ".1e",
"tickangle": 45,
},
"yaxis": {
"automargin": True,
"title": {"text": xs_units},
"type": yaxis_scale,
"tickformat": ".1e",
},
"showlegend": True,
},
},
)
]

app = dash.Dash(
__name__,
prevent_initial_callbacks=True,
Expand Down Expand Up @@ -594,32 +623,7 @@ def update_graph_from_mcnp(reaction_names, mcnp_input_text, xaxis_scale, yaxis_

energy_units = "eV"
xs_units = "Macroscopic cross section [1/cm]"
return [
dcc.Graph(
config=dict(showSendToCloud=True),
figure={
"data": mcnp_downloaded_data,
"layout": {
"height": 800,
# "width":1600,
"margin": {"l": 3, "r": 2, "t": 15, "b": 60},
"xaxis": {
"title": {"text": f"Energy {energy_units}"},
"type": xaxis_scale,
"tickformat": ".1e",
"tickangle": 45,
},
"yaxis": {
"automargin": True,
"title": {"text": xs_units},
"type": yaxis_scale,
"tickformat": ".1e",
},
"showlegend": True,
},
},
)
], table_of_processed
return make_plotly_graph(mcnp_downloaded_data, energy_units, xaxis_scale, xs_units, yaxis_scale), table_of_processed

except:
return [], html.H4(
Expand Down Expand Up @@ -746,32 +750,7 @@ def update_output(reaction_names, rows, density_value, fraction_type, xaxis_sca
)
energy_units = "eV"
xs_units = "Macroscopic cross section [1/cm]"
return [
dcc.Graph(
config=dict(showSendToCloud=True),
figure={
"data": downloaded_data,
"layout": {
"height": 800,
# "width":1600,
"margin": {"l": 3, "r": 2, "t": 15, "b": 60},
"xaxis": {
"title": {"text": f"Energy {energy_units}"},
"type": xaxis_scale,
"tickformat": ".1e",
"tickangle": 45,
},
"yaxis": {
"automargin": True,
"title": {"text": xs_units},
"type": yaxis_scale,
"tickformat": ".1e",
},
"showlegend": True,
},
},
)
]
return make_plotly_graph(downloaded_data, energy_units, xaxis_scale, xs_units, yaxis_scale)
else:
raise dash.exceptions.PreventUpdate

Expand Down
283 changes: 0 additions & 283 deletions index.py

This file was deleted.

Loading