diff --git a/src/openmc_plot/dagmcslice_tab.py b/src/openmc_plot/dagmcslice_tab.py index 0bff42e..6d1e1e2 100644 --- a/src/openmc_plot/dagmcslice_tab.py +++ b/src/openmc_plot/dagmcslice_tab.py @@ -19,8 +19,11 @@ def create_dagmcslice_tab(): new_title = '

Upload your geometry.xml

' st.markdown(new_title, unsafe_allow_html=True) - st.markdown( - 'Not got h5m files handy? Download sample [dagmc.h5m](https://raw.githubusercontent.com/fusion-energy/openmc_plot/main/examples/dagmc_geometry/dagmc_text.h5m "download")' + st.write( + """ + Not got a DAGMC h5m file handy, right mouse 🖱️ click and save these links + [ example 1 ](https://fusion-energy.github.io/openmc_geometry_plot/examples/dagmc_tokamak/dagmc_180_tokamak.h5m) + """ ) else: diff --git a/src/openmc_plot/geometry_tab.py b/src/openmc_plot/geometry_tab.py index a9e3467..f8aa60e 100644 --- a/src/openmc_plot/geometry_tab.py +++ b/src/openmc_plot/geometry_tab.py @@ -21,26 +21,18 @@ def create_geometry_tab(): """ ) file_label_col1, file_label_col2 = st.columns([1, 1]) - file_label_col1.write( + file_col1, file_col2 = st.columns([1, 1]) + file_col1.write( """ 👉 Create your ```openmc.Geometry()``` and export the geometry xml file using ```export_to_xml()```. - - Not got a geometry.xml file handy, right mouse 🖱️ click and save these links - [ example 1 ](https://fusion-energy.github.io/openmc_geometry_plot/examples/csg_tokamak/geometry.xml), - [ example 2 ](https://fusion-energy.github.io/openmc_geometry_plot/examples/csg_cylinder_box/geometry.xml) - """ ) - file_label_col2.write( + file_col2.write( """ 👉 Create your DAGMC h5m file using tools like [CAD-to-h5m](https://github.com/fusion-energy/cad_to_dagmc), [STL-to_h5m](https://github.com/fusion-energy/stl_to_h5m) [vertices-to-h5m](https://github.com/fusion-energy/vertices_to_h5m), [Brep-to-h5m](https://github.com/fusion-energy/brep_to_h5m) or the [Cubit](https://coreform.com/products/coreform-cubit/) [Plugin](https://github.com/svalinn/Cubit-plugin) - - Not got a DAGMC h5m file handy, right mouse 🖱️ click and save these links - [ example 1 ](https://fusion-energy.github.io/openmc_geometry_plot/examples/dagmc_tokamak/dagmc_180_tokamak.h5m) - """ ) - file_col1, file_col2 = st.columns([1, 1]) + geometry_xml_file = file_col1.file_uploader( "Upload your geometry.xml", type=["xml"] ) @@ -52,9 +44,19 @@ def create_geometry_tab(): new_title = '

Upload your geometry.xml or DAGMC h5m file

' st.markdown(new_title, unsafe_allow_html=True) - sub_title = '

Not got geometry files handy? Download an example geometry.xml or DAGMC h5m file

' - st.markdown(sub_title, unsafe_allow_html=True) - + st.write( + """ + Not got a geometry.xml file handy, right mouse 🖱️ click and save these links + [ example 1 ](https://fusion-energy.github.io/openmc_geometry_plot/examples/csg_tokamak/geometry.xml), + [ example 2 ](https://fusion-energy.github.io/openmc_geometry_plot/examples/csg_cylinder_box/geometry.xml) + """ + ) + st.write( + """ + Not got a DAGMC h5m file handy, right mouse 🖱️ click and save these links + [ example 1 ](https://fusion-energy.github.io/openmc_geometry_plot/examples/dagmc_tokamak/dagmc_180_tokamak.h5m) + """ + ) # DAGMC route elif dagmc_file is not None and geometry_xml_file is not None: diff --git a/src/openmc_plot/header.py b/src/openmc_plot/header.py index 7a96790..96a7c6a 100644 --- a/src/openmc_plot/header.py +++ b/src/openmc_plot/header.py @@ -22,7 +22,7 @@ def header(): st.write( """ - # OpenMC plot ```v0.2.1``` + # OpenMC plot ```v0.2.2``` ### ⚛ A geometry plotting user interface for OpenMC. diff --git a/src/openmc_plot/launch.py b/src/openmc_plot/launch.py index e70ace9..d1d3db1 100644 --- a/src/openmc_plot/launch.py +++ b/src/openmc_plot/launch.py @@ -1,3 +1,4 @@ +import os import runpy import sys import openmc_plot @@ -8,6 +9,9 @@ def main(): path_to_app = str(Path(openmc_plot.__path__[0])/'app.py') + # default is 200MB, this sets uplod file zise to 100GB + os.environ['STREAMLIT_SERVER_MAX_UPLOAD_SIZE'] = '100000' + sys.argv = ["streamlit", "run", path_to_app]; runpy.run_module("streamlit", run_name="__main__") diff --git a/src/openmc_plot/regularmesh_tab.py b/src/openmc_plot/regularmesh_tab.py index e2dec6f..4880441 100644 --- a/src/openmc_plot/regularmesh_tab.py +++ b/src/openmc_plot/regularmesh_tab.py @@ -28,9 +28,11 @@ def create_regularmesh_tab(): st.markdown(new_title, unsafe_allow_html=True) st.markdown( - 'Not got statepoint.h5 files handy? Download sample [statepoint.h5](https://github.com/fusion-energy/openmc_plot/raw/adding_statepoint_example_file/examples/regularmesh_plot/statepoint.40.h5 "download")' + """ + Not got a Statepoint h5 file handy, right mouse 🖱️ click and save this link + [example 1](https://github.com/fusion-energy/openmc_plot/raw/adding_statepoint_example_file/examples/regularmesh_plot/statepoint.40.h5) + """ ) - else: save_uploadedfile(statepoint_file) diff --git a/src/openmc_plot/source_tab.py b/src/openmc_plot/source_tab.py index 52884fe..becb84c 100644 --- a/src/openmc_plot/source_tab.py +++ b/src/openmc_plot/source_tab.py @@ -22,7 +22,10 @@ def create_source_tab(): st.markdown(new_title, unsafe_allow_html=True) st.markdown( - 'Not got xml files handy? Download sample [settings.xml](https://raw.githubusercontent.com/fusion-energy/openmc_plot/main/examples/ring_source/settings.xml)' + """ + Not got a settings xml file handy, right mouse 🖱️ click and save this link + [example 1](https://fusion-energy.github.io/openmc_plot/examples/ring_source/settings.xml) + """ ) else: diff --git a/src/openmc_plot/weightwindows_tab.py b/src/openmc_plot/weightwindows_tab.py index 965fc7c..a0a29ea 100644 --- a/src/openmc_plot/weightwindows_tab.py +++ b/src/openmc_plot/weightwindows_tab.py @@ -23,10 +23,12 @@ def create_weightwindow_tab(): new_title = '

Upload your settings.xml

' st.markdown(new_title, unsafe_allow_html=True) - st.markdown( - 'Not got xml files handy? Download sample [settings.xml](https://raw.githubusercontent.com/fusion-energy/openmc_plot/main/examples/weightwindows/settings.xml)' + st.write( + """ + Not got a settings xml file handy, right mouse 🖱️ click and save these links + [ example 1 ](https://fusion-energy.github.io/openmc_plot/examples/weightwindows/settings.xml) + """ ) - else: save_uploadedfile(settings_xml_file)