Skip to content

Commit

Permalink
Merge pull request #57 from fusion-energy/develop
Browse files Browse the repository at this point in the history
general bug fixing and improvments to tasks
  • Loading branch information
shimwell authored Dec 20, 2021
2 parents b460cae + 52ad4f0 commit c5486e4
Show file tree
Hide file tree
Showing 10 changed files with 169 additions and 343 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ RUN pip install cmake\
nest_asyncio \
pytest \
pytest-cov \
# holoviews \
holoviews \
ipywidgets \
# cython is needed for moab
cython \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,33 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 8,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/jshimwell/miniconda3/envs/openmc-dagmc/lib/python3.8/site-packages/IPython/core/display.py:724: UserWarning:\n",
"\n",
"Consider using IPython.display.IFrame instead\n",
"\n"
]
},
{
"data": {
"text/html": [
"<iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/qHqAuqMLYPA\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from IPython.display import HTML\n",
"HTML('<iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/qHqAuqMLYPA\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>')"
Expand Down Expand Up @@ -199,7 +223,7 @@
"plot_spectrum_from_tally(\n",
" spectrum={'front surface': cell_tally},\n",
" x_label = \"energy [eV]\",\n",
" y_label = \"flux [neutrons centimeter / simulated neutron]\",\n",
" y_label = \"flux [neutrons centimeter / source neutron]\",\n",
" plotting_package=\"plotly\", # matplotlib is another option, but plotly option provides a dropdown menu for changing axis scale\n",
")"
]
Expand Down Expand Up @@ -233,9 +257,9 @@
"plot_spectrum_from_tally(\n",
" spectrum={'back_surface_tally': back_surface_tally, 'front_surface_tally':front_surface_tally},\n",
" x_label = \"energy [eV]\",\n",
" y_label = \"neutrons per simulated neutron\",\n",
" y_label = \"neutrons per source neutron\",\n",
" plotting_package=\"plotly\", # matplotlib is another option, but plotly option provides a dropdown menu for changing axis scale\n",
" required_units = 'neutrons / simulated_particle'\n",
" required_units = 'neutrons / source_particle'\n",
")"
]
},
Expand Down Expand Up @@ -289,7 +313,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.11"
"version": "3.8.12"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,226 +42,9 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Overwriting auto display for cadquery Workplane and Shape\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "6f28acd8ed8d4f20a0fbcbf5f8e34c10",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"HBox(children=(VBox(children=(HBox(children=(Checkbox(value=False, description='Axes', indent=False, _dom_clas…"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<style>\n",
".scroll-area {\n",
" overflow: scroll !important;\n",
" border: unset !important;\n",
"}\n",
"\n",
".mac-scrollbar::-webkit-scrollbar {\n",
" width: 5px !important;\n",
" height: 5px !important;\n",
"}\n",
"\n",
".mac-scrollbar::-webkit-scrollbar-track {\n",
" background-color: transparent !important;\n",
"}\n",
"\n",
".mac-scrollbar .widget-html-content {\n",
" overflow-x: visible;\n",
" overflow-y: visible;\n",
"}\n",
"\n",
".tab-content-no-padding .widget-tab-contents {\n",
" overflow-x: visible !important;\n",
" overflow-y: visible !important;\n",
" padding-bottom: 0px !important;\n",
"}\n",
"\n",
".view_renderer {\n",
" border: 1px solid var(--jp-border-color1);\n",
" margin-top: 3px;\n",
" margin-left: 2px;\n",
"}\n",
"\n",
".view_tree {\n",
" padding: 0px !important;\n",
"}\n",
"\n",
".view_axes {\n",
" width: 60px !important;\n",
" margin-left: 5px !important;\n",
"}\n",
"\n",
".view_zero {\n",
" width: 55px !important;\n",
"}\n",
"\n",
".view_grid {\n",
" width: 56px !important;\n",
"}\n",
"\n",
".view_ortho {\n",
" width: 64px !important;\n",
"}\n",
"\n",
".view_transparent {\n",
" width: 125px !important;\n",
"}\n",
"\n",
".view_black_edges {\n",
" width: 105px !important;\n",
"}\n",
"\n",
".view_button {\n",
" padding: 0px !important;\n",
"}\n",
"\n",
".view_button>img {\n",
" height: 28px;\n",
" width: 36px;\n",
"}\n",
"\n",
".node_entry_wrap {\n",
" white-space: pre;\n",
"}\n",
"\n",
".node_entry {\n",
" white-space: nowrap;\n",
" padding-top: 4px;\n",
"}\n",
"\n",
".t-caret {\n",
" cursor: pointer;\n",
" -webkit-user-select: none;\n",
" /* Safari 3.1+ */\n",
" -moz-user-select: none;\n",
" /* Firefox 2+ */\n",
" -ms-user-select: none;\n",
" /* IE 10+ */\n",
" user-select: none;\n",
"}\n",
"\n",
".t-caret-down::before {\n",
" -ms-transform: rotate(90deg);\n",
" /* IE 9 */\n",
" -webkit-transform: rotate(90deg);\n",
" /* Safari */\n",
" transform: rotate(90deg);\n",
"}\n",
"\n",
".toplevel {\n",
" list-style-type: none;\n",
" padding-inline-start: 0px;\n",
"}\n",
"\n",
".nested {\n",
" display: none;\n",
" list-style-type: none;\n",
" padding-inline-start: 16px;\n",
"}\n",
"\n",
".active {\n",
" display: block;\n",
"}\n",
"\n",
".icon {\n",
" width: 28px !important;\n",
" height: 22px !important;\n",
" padding-right: 2px;\n",
" vertical-align: middle;\n",
"}\n",
"\n",
".indent {\n",
" margin-left: 12px;\n",
"}\n",
"\n",
".tree_label {\n",
" padding-left: 2px;\n",
" font-size: 14px;\n",
"}\n",
"\n",
".scroll_down {\n",
" display: flex;\n",
" flex-direction: column-reverse;\n",
"}\n",
"\n",
".small_table {\n",
" line-height: 14px;\n",
"}\n",
"\n",
".monospace select {\n",
" font-family: monospace;\n",
"}\n",
"\n",
" .t-caret::before {\n",
" content: u\"\";\n",
" font-size: 12px;\n",
" color: \"#080808\";\n",
" display: inline-block;\n",
" margin-right: 2px;\n",
" }\n",
"\n",
" .mac-scrollbar::-webkit-scrollbar-thumb {\n",
" background-color: rgba(0, 0, 0, 0.2) !important;\n",
" border-radius: 100px !important;\n",
" }\n",
"\n",
" .mac-scrollbar::-webkit-scrollbar-thumb:hover {\n",
" background: rgba(0, 0, 0, 0.4) !important;\n",
" }\n",
"\n",
" .mac-scrollbar::-webkit-scrollbar-thumb:active {\n",
" background: #181818 !important;\n",
" }\n",
"\n",
" .mac-scrollbar::-webkit-scrollbar-corner {\n",
" background: white;\n",
" }\n",
"\n",
" .view_output {\n",
" border: 1px solid var(--jp-border-color1);\n",
" margin: 2px 2px 2px 2px !important;\n",
" padding-right: 1px !important;\n",
" background-color: white;\n",
" }\n",
" </style>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"<jupyter_cadquery.cad_display.CadqueryDisplay at 0x7f4778429d60>"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"import paramak\n",
"\n",
Expand All @@ -286,13 +69,13 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"![tf](https://user-images.githubusercontent.com/8583900/94529559-cd8aa280-0231-11eb-9919-48d3c642a5d7.png)\n",
"![tf](https://user-images.githubusercontent.com/56687624/98582371-cb991200-22ba-11eb-8e15-86d273a8b819.png)\n",
"\n",
"This second stage makes a toroidal field coil using the Paramak package.\n",
"\n",
"The documentation includes a full description of the shape and arguments.\n",
"\n",
"https://paramak.readthedocs.io/en/main/paramak.parametric_components.html#toroidalfieldcoilprincetond"
"https://paramak.readthedocs.io/en/main/parametric_components.html#toroidalfieldcoilcoathanger"
]
},
{
Expand All @@ -301,15 +84,16 @@
"metadata": {},
"outputs": [],
"source": [
"tf = paramak.ToroidalFieldCoilPrincetonD(\n",
" R1=100,\n",
" R2=700,\n",
" thickness=30,\n",
" distance=40,\n",
"tf = paramak.ToroidalFieldCoilCoatHanger(\n",
" horizontal_start_point=(200, 500),\n",
" horizontal_length=400,\n",
" vertical_mid_point=(700, 50),\n",
" vertical_length=500,\n",
" thickness=50,\n",
" distance=50,\n",
" number_of_coils=12,\n",
" rotation_angle=180\n",
")\n",
"\n",
"tf.show()"
]
},
Expand Down Expand Up @@ -464,7 +248,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.11"
"version": "3.8.12"
}
},
"nbformat": 4,
Expand Down
7 changes: 3 additions & 4 deletions tasks/task_10_making_CAD_geometry/3_make_CAD_reactors.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"outputs": [],
"source": [
"my_reactor.export_svg('reactor.svg')\n",
"filenames = my_reactor.export_stp()"
"filenames = my_reactor.export_stp('my_reactor.stp')"
]
},
{
Expand All @@ -107,8 +107,7 @@
"source": [
"from IPython.display import FileLink\n",
"display(FileLink('reactor.svg'))\n",
"for file in filenames:\n",
" display(FileLink(str(file)))"
"display(FileLink('reactor.stp'))"
]
},
{
Expand Down Expand Up @@ -144,7 +143,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.11"
"version": "3.8.12"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@
" settings=settings,\n",
" tallies=tallies\n",
")\n",
"!rm *.h5 # just removes old summary.h5 or statepoint files\n",
"statepoint_file = my_model.run()"
]
},
Expand Down Expand Up @@ -292,7 +293,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.11"
"version": "3.8.12"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit c5486e4

Please sign in to comment.