From c9b1544c8decfc7f67acbad7213e5f7d67158fa6 Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Wed, 22 Feb 2023 17:35:28 +0000 Subject: [PATCH 1/5] added gh pages links --- src/openmc_plot/geometry_tab.py | 2 +- src/openmc_plot/regularmesh_tab.py | 6 ++++-- src/openmc_plot/source_tab.py | 5 ++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/openmc_plot/geometry_tab.py b/src/openmc_plot/geometry_tab.py index a9e3467..675b5bb 100644 --- a/src/openmc_plot/geometry_tab.py +++ b/src/openmc_plot/geometry_tab.py @@ -37,7 +37,7 @@ def create_geometry_tab(): 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) - + [ example 2 ](https://fusion-energy.github.io/openmc_plot/examples/dagmc_geometry/dagmc_text.h5m) """ ) file_col1, file_col2 = st.columns([1, 1]) 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..36807f2 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 Statepoint h5 file handy, right mouse 🖱️ click and save this link + [example 1](https://fusion-energy.github.io/openmc_plot/examples/ring_source/settings.xml) + """ ) else: From b6d69ea0436687f2e36a3a72f0a138802f5a3785 Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Wed, 22 Feb 2023 17:38:40 +0000 Subject: [PATCH 2/5] fixed link --- src/openmc_plot/geometry_tab.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openmc_plot/geometry_tab.py b/src/openmc_plot/geometry_tab.py index 675b5bb..af52c32 100644 --- a/src/openmc_plot/geometry_tab.py +++ b/src/openmc_plot/geometry_tab.py @@ -36,8 +36,8 @@ def create_geometry_tab(): 👉 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) - [ example 2 ](https://fusion-energy.github.io/openmc_plot/examples/dagmc_geometry/dagmc_text.h5m) + [ example 1 ](https://fusion-energy.github.io/openmc_geometry_plot/examples/dagmc_tokamak/dagmc_180_tokamak.h5m), + [ example 2 ](https://fusion-energy.github.io/openmc_plot/examples/dagmc_text/dagmc_text.h5m) """ ) file_col1, file_col2 = st.columns([1, 1]) From 346017ac4b18941625f0738de5db749e29be3d90 Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Wed, 22 Feb 2023 17:48:29 +0000 Subject: [PATCH 3/5] imporved links --- src/openmc_plot/geometry_tab.py | 32 +++++++++++++++------------- src/openmc_plot/weightwindows_tab.py | 8 ++++--- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/src/openmc_plot/geometry_tab.py b/src/openmc_plot/geometry_tab.py index af52c32..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), - [ example 2 ](https://fusion-energy.github.io/openmc_plot/examples/dagmc_text/dagmc_text.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/weightwindows_tab.py b/src/openmc_plot/weightwindows_tab.py index 965fc7c..f0c0d1e 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_geometry_plot/examples/weightwindows/settings.xml) + """ ) - else: save_uploadedfile(settings_xml_file) From 55090e0b519b7a211986d0d0588c1ca7549ef2fd Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Wed, 22 Feb 2023 17:53:50 +0000 Subject: [PATCH 4/5] updated links --- src/openmc_plot/dagmcslice_tab.py | 7 +++++-- src/openmc_plot/source_tab.py | 2 +- src/openmc_plot/weightwindows_tab.py | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) 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/source_tab.py b/src/openmc_plot/source_tab.py index 36807f2..becb84c 100644 --- a/src/openmc_plot/source_tab.py +++ b/src/openmc_plot/source_tab.py @@ -23,7 +23,7 @@ def create_source_tab(): st.markdown( """ - Not got a Statepoint h5 file handy, right mouse 🖱️ click and save this link + 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) """ ) diff --git a/src/openmc_plot/weightwindows_tab.py b/src/openmc_plot/weightwindows_tab.py index f0c0d1e..a0a29ea 100644 --- a/src/openmc_plot/weightwindows_tab.py +++ b/src/openmc_plot/weightwindows_tab.py @@ -26,7 +26,7 @@ def create_weightwindow_tab(): st.write( """ Not got a settings xml file handy, right mouse 🖱️ click and save these links - [ example 1 ](https://fusion-energy.github.io/openmc_geometry_plot/examples/weightwindows/settings.xml) + [ example 1 ](https://fusion-energy.github.io/openmc_plot/examples/weightwindows/settings.xml) """ ) else: From 60968903c65a4c6790cc45b40cdfbaacb01f805c Mon Sep 17 00:00:00 2001 From: shimwell Date: Wed, 22 Feb 2023 19:50:48 +0000 Subject: [PATCH 5/5] version bump and upload size increase --- src/openmc_plot/header.py | 2 +- src/openmc_plot/launch.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) 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__")