From 71c46886a7b32cb11d57a5733a657db5369cf4e8 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 17 Nov 2021 21:34:59 +0000 Subject: [PATCH] updated to work with openmc_tally_unit_converter 0.5.2 --- README.md | 3 ++- examples/plot_regular_mesh_dose_tally.py | 4 +-- examples_from_readme.ipynb | 33 ++++++++++++++++++++++++ regular_mesh_plotter/core.py | 4 +-- 4 files changed, 39 insertions(+), 5 deletions(-) create mode 100644 examples_from_readme.ipynb diff --git a/README.md b/README.md index 13c4428..0d4f969 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ and other mesh tally results. Example 1 shows a Numpy array plotted ```python +from regular_mesh_plotter import plot_regular_mesh_values plot_regular_mesh_values( values: np.ndarray, filename: Optional[str] = None, @@ -153,7 +154,7 @@ plot_regular_mesh_dose_tally_with_geometry( plane_normal: List[float] = [0, 0, 1], rotate_mesh: float = 0, rotate_geometry: float = 0, - required_units="picosievert cm **2 / simulated_particle", + required_units="picosievert / source_particle", source_strength: float = None, std_dev_or_tally_value: str = "tally_value", ): diff --git a/examples/plot_regular_mesh_dose_tally.py b/examples/plot_regular_mesh_dose_tally.py index 423a57b..23c13df 100644 --- a/examples/plot_regular_mesh_dose_tally.py +++ b/examples/plot_regular_mesh_dose_tally.py @@ -16,9 +16,9 @@ x_label="X [cm]", y_label="Y [cm]", rotate_plot=0, - required_units="picosievert / simulated_particle", + required_units="picosievert / source_particle", source_strength=None, - label="Effective dose [picosievert / simulated_particle]", + label="Effective dose [picosievert / source_particle]", ) # displays the plot diff --git a/examples_from_readme.ipynb b/examples_from_readme.ipynb new file mode 100644 index 0000000..f8faec5 --- /dev/null +++ b/examples_from_readme.ipynb @@ -0,0 +1,33 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "id": "0555ced4-6613-455d-8854-580533dfe09b", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.11" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/regular_mesh_plotter/core.py b/regular_mesh_plotter/core.py index 66f28e8..58a6354 100644 --- a/regular_mesh_plotter/core.py +++ b/regular_mesh_plotter/core.py @@ -211,7 +211,7 @@ def plot_regular_mesh_dose_tally( x_label="X [cm]", y_label="Y [cm]", rotate_plot: float = 0, - required_units="picosievert cm **2 / simulated_particle", + required_units="picosievert / source_particle", source_strength: float = None, std_dev_or_tally_value: str = "tally_value", ): @@ -260,7 +260,7 @@ def plot_regular_mesh_dose_tally_with_geometry( plane_normal: List[float] = [0, 0, 1], rotate_mesh: float = 0, rotate_geometry: float = 0, - required_units="picosievert cm **2 / simulated_particle", + required_units="picosievert / source_particle", source_strength: float = None, std_dev_or_tally_value: str = "tally_value", ):