Recent Releases of The PHITS Tools Python package for parsing, organizing, and analyzing results from the PHITS radiation transport and DCHAIN activation codes
The PHITS Tools Python package for parsing, organizing, and analyzing results from the PHITS radiation transport and DCHAIN activation codes - v1.6.1
This minor patch fixes a bug where, in the automatic file identification process, the primary output from T-Dchain would not be properly recognized if the first line contained square brackets. Now, as long as the first non-blank characters on the first line start with / are htitle, [T-Dchain] output/DCHAIN input files are correctly identified. Nothing else is changed. (This patch consists of just a single line of code changed.)
- Python
Published by Lindt8 9 months ago
The PHITS Tools Python package for parsing, organizing, and analyzing results from the PHITS radiation transport and DCHAIN activation codes - The PHITS Tools Python package for parsing, organizing, and analyzing results from the PHITS radiation transport and DCHAIN activation codes
by Hunter N. Ratliff¹ (ORCID 0000-0003-3761-5415) ¹Department of Computer science, Electrical engineering and Mathematical sciences, Western Norway University of Applied Sciences, Inndalsveien 28, 5063 Bergen, Norway (ROR 05phns765)
This release is for the archive for the JOSS publication for PHITS Tools. It reflects the state of the codebase as of release version 1.6.0 and the final JOSS paper following the JOSS review process.
PHITS Tools is a Python package for automatically processing, organizing, and visualizing output from the PHITS general purpose Monte Carlo particle transport code and easing/expediting further analyses. (PHITS can be obtained at https://phits.jaea.go.jp/.)
Specifically, PHITS Tools seeks to be a universal PHITS output parser, supporting output from all tallies, both normal "standard" output as well as dump file outputs (in plaintext and binary formats), reading in the numeric data and metadata and storing them in Python objects for further use and analysis in Python. PHITS Tools is also coupled to and distributed with the DCHAIN Tools submodule for processing of DCHAIN output. PHITS Tools also contains a number of functions for assisting in further analyses. You can read more about how to use PHITS Tools and its output in its online documentation: lindt8.github.io/PHITS-Tools/
- Python
Published by Lindt8 9 months ago
The PHITS Tools Python package for parsing, organizing, and analyzing results from the PHITS radiation transport and DCHAIN activation codes - v1.6.0
This release officially publishes the changes added in the various 1.6.0bX beta releases along with a few more recent updates. The most substantial changes from the previous v1.5.1.1 release are:
- Installing PHITS Tools via
pip install PHITS-Toolsnow provides convenient commands (entry points / executables) for using it in the terminal from anywhere:PHITS-Tools,PHITS_tools,phits-tools, andPHITS-Tools-GUI. - Addition of the
manage_mc_materialssubmodule for customization of the MC materials database distributed with PHITS Tools- Its documentation can be viewed here.
- The distributed MC material data library pickle files have been replaced by equivalent JSON files.
- New
tally_data_indices()helper function added for easing access of the 10-Dtally_dataNumPy array in theparse_tally_output_file()function's output dictionary - PHITS Tools version number now included in output (on plots, in metadata dictionaries) and displayed in the GUI
- The example script and Jupyter notebook have been updated to showcase new/additional functionalities.
- Documentation improvements for various functions, notably
parse_tally_output_file()(more details on metadata and NumPy array outputs) andrebinner()(methodology outlined with equations and illustrations)
Some of the largest changes that are more development-focused (rather than user-facing) include:
- pyproject.toml added for package config and using hatchling for building
- Overhaul of unit testing and functional/integration testing (with corresponding README instructions)
- Repository is restructured
- Version number single source of truth located in PHITS_tools.py
- Makefile added with common dev commands
- Documentation building/deployment now automated via GitHub Actions workflows
- De-bloated build wheel and tarball files distributed via PyPI
This release (relative to v1.5.1.1) contains all of the changes and additions made to PHITS Tools over the course of its JOSS review:
- Python
Published by Lindt8 9 months ago
The PHITS Tools Python package for parsing, organizing, and analyzing results from the PHITS radiation transport and DCHAIN activation codes - v1.6.0b5
This beta release principally encompasses some development-side improvements, though with some minor bugfixes and documentation improvements. It can be obtained from PyPI via pip install PHITS-Tools==1.6.0b5.
Download the attached PHITS_tools_docs_v160b5.html to see the most up-to-date version of the main module's documentation. (And likewise for manage_mc_materials_docs_v160b5.html for the manage_mc_materials submodule.)
- Python
Published by Lindt8 10 months ago
The PHITS Tools Python package for parsing, organizing, and analyzing results from the PHITS radiation transport and DCHAIN activation codes - v1.6.0b4
This beta release introduces some unit tests (with more to come) and restructures the repository such that you are able to import PHITS_tools, from PHITS_tools import dchain_tools, from PHITS_tools import manage_mc_materials, etc. from the repository's root directory, regardless of whether you have the package installed or not.
This moved the main PHITS_tools.py module file from the root directory to inside the PHITS_tools/ directory. The src/PHITS_tools/ directory and its redundant *.py files have been removed, with the PHITS_tools/__init__.py and pyproject.toml files now ensuring submodules are properly packaged and locatable/importable.
The built wheel and tarball files are also available on PyPI, or can be installed via pip install PHITS-Tools==1.6.0b4
- Python
Published by Lindt8 11 months ago
The PHITS Tools Python package for parsing, organizing, and analyzing results from the PHITS radiation transport and DCHAIN activation codes - v1.6.0b2
This beta release introduces the new manage_mc_materials submodule for customization of the MC materials database distributed with PHITS Tools, meaning you can now add your own materials to the database for easier access / managing your own collection of PHITS/MCNP-formatted materials. The following changes have been made to PHITS-Tools/MCmaterials/
- The `managemc_materials.py` submodule has been added (for more details, see its documentation preview).
- Distributed pickle files have been replaced with JSON files (code updated accordingly).
Additionally, the pyproject.toml file used for building the distribution is now included. Note that within it and .gitattributes are specified files which appear in the repository for reference purposes but are not included in the distributed versions since they can be recreated locally (or just downloaded from the repository) and to keep the download size smaller.
- Python
Published by Lindt8 11 months ago
The PHITS Tools Python package for parsing, organizing, and analyzing results from the PHITS radiation transport and DCHAIN activation codes - v1.5.1.1
This minor release fixes an edge-case issue in parse_all_tally_output_in_dir() for handling unsupported outputs when (simultaneously) output merging is enabled, pickle saving is disabled, and combined plotting is enabled. Also, in test/README.md a link has been added to test files that can be downloaded from the PHITS website.
- Python
Published by Lindt8 about 1 year ago
The PHITS Tools Python package for parsing, organizing, and analyzing results from the PHITS radiation transport and DCHAIN activation codes - v1.5.1
This release adds to autoplot_tally_results() a new type of plot to be generated for [T-Yield] tally results when axis is set to chart or dchain in the PHITS tally input, displaying nuclide yields in a "table of isotopes" style format, a much more useful display method. The documentation for autoplot_tally_results() has been updated to reflect this as well as to link to some example plots generated by the function.
- Python
Published by Lindt8 about 1 year ago
The PHITS Tools Python package for parsing, organizing, and analyzing results from the PHITS radiation transport and DCHAIN activation codes - v1.5.0
This release substantially improves the integration of DCHAIN Tools with PHITS Tools:
- The *.dtrk/*.dyld [T-Track]/[T-Yield] tally outputs, using axis = dchain, spawned by [T-Dchain] are now supported.
- tally_output objects for them, as formatted by PHITS Tools for any tally, are now produced.
- Previously, their data was only available in the DCHAIN Tools formatting.
- When handling a DCHAIN input file (the output of [T-Dchain]) or its *.act file, substantially more information is extracted (e.g., from the *.dout file containing the [T-Dchain] tally input echo, and the PHITS Tools-formatted tally_output objects from the *.dtrk/*.dyld files) and all DCHAIN-related information, from both PHITS and DCHAIN, is compiled into a single dictionary object.
Minor bugfixes: - Function for parsing tally tables can now handle circumstances where relative uncertainty column values are populated with a Fortran overflow case (this should be very rare in any case).
Other changes: - Information printed to terminal has undergone formatting improvements for consistency, completeness, and brevity.
- Python
Published by Lindt8 about 1 year ago
The PHITS Tools Python package for parsing, organizing, and analyzing results from the PHITS radiation transport and DCHAIN activation codes - v1.4.0.1
Minor bugfix for faulty identification of output columns (beyond the first data "y" column and its relative error) when in the PHITS tally's input epsout = 2 was set combined with the samepage parameter (= part by default) being actively used.
- Python
Published by Lindt8 about 1 year ago
The PHITS Tools Python package for parsing, organizing, and analyzing results from the PHITS radiation transport and DCHAIN activation codes - v1.4.0
This release brings about 3 major new features:
- Ability to extract run metadata from a "phits.out" file with the new parse_phitsout_file() function.
- This includes information such as the PHITS version number, the PHITS input echo, memory usage, run start/stop time, CPU time, the citation request section (saying what extra papers should be cited for that run's results), etc.
- Ability to merge all tally_output dictionaries produced by a call of parse_all_tally_output_in_dir() into a single merged dictionary object.
- A separate toggle for choosing to save this merged file has been added, allowing for saving of only the merged tally outputs rather than requiring all individual tally output .pickle files be saved too.
- [INPUT_FILE mode] in parse_all_tally_output_in_dir(), allowing one to process all tally outputs from active tallies (i.e., not commented out or turned off) listed in a PHITS input file (or its produced phits.out file).
- Together with the phits.out processing and merging of outputs from this function, this means all processed output from a single PHITS run, their metadata, metadata about the run itself, and the PHITS input producing all of these results can be stored together in a single object / saved to a single .pickle file.
These new features are accessible across all usages of PHITS Tools, as an imported module or via its CLI/GUI.
With these new functionalities, PHITS Tools is now capable of automatically processing all output produced by a single PHITS run together provided the PHITS input file. This means that PHITS Tools can be used, via its CLI, in the phits.bat/phits.sh scripts to automatically process all of the outputs of a PHITS run every time PHITS is executed via its shell/batch script. See the newly added "Automatic processing at PHITS runtime" section in README.md for more information about how to set this up and how it works.
In more explicit terms, this release brings the following changes:
- 2 new functions:
- parse_phitsout_file()
- extract_tally_outputs_from_phits_input()
- New input argument include_phitsout_in_metadata added to parse_tally_output_file()
- New input arguments include_phitsout_in_metadata, merge_tally_outputs, and save_pickle_of_merged_tally_outputs added to parse_all_tally_output_in_dir()
- The default behavior of output_file_suffix has changed slightly. It remains '.out' if the function is provided a directory, but the default is '' if the function is provided a PHITS input file or phits.out file.
- See documentation for parse_all_tally_output_in_dir() for updated output behavior relevant to usage of the new input arguments. (Default behavior remains unchanged.)
- Python
Published by Lindt8 about 1 year ago
The PHITS Tools Python package for parsing, organizing, and analyzing results from the PHITS radiation transport and DCHAIN activation codes - v1.3.1
Added the following to autoplot_tally_results():
- additional_save_extensions input argument, allowing for saving of plots in additional file formats permitted by matplotlib.pyplot.savefig()
- max_num_values_to_plot input argument, controlling maximum tally size to be plotted (was previously an internal variable to the function)
- rasterizesize_threshold and rasterize_dpi input arguments, controlling maximum tally size before rasterization is employed in plotting and the DPI to be used in such instances (were previously internal variables to the function)
Furthermore, the behavior of the autoplot_tally_output argument for parse_tally_output_file() and parse_all_tally_output_in_dir() has been changed slightly. Now when set to True, in addition to generating the PDF(s) of the plot(s) as before, PNG(s) will also be generated (achieved by setting additional_save_extensions = ['.png'] in the autoplot_tally_results() call).
- Python
Published by Lindt8 about 1 year ago
The PHITS Tools Python package for parsing, organizing, and analyzing results from the PHITS radiation transport and DCHAIN activation codes - v1.3.0.1
Added return_fg_list argument to the autoplot_tally_results() function, allowing one to modify its automatically generated plots, as demonstrated in example/examplePHITStools.[py/ipynb].
- Python
Published by Lindt8 about 1 year ago
The PHITS Tools Python package for parsing, organizing, and analyzing results from the PHITS radiation transport and DCHAIN activation codes - v1.3.0
This major release is predominantly featuring the new automatic tally results plotting function:
- With the new
autoplot_tally_outputargument forparse_tally_output_file()andparse_all_tally_output_in_dir()(and itsautoplot_all_tally_output_in_dirargument), plots of standard tally results can be automatically generated and saved as PDFs.- For example plots, see example/product.pdf and test/testtallyplots.pdf
- The seaborn package has been added as a requirement since it is used for this new plotting functionality.
- Support for this functionality is available in the CLI and GUI interfaces as well.
Some additional minor bugfixes have also been implemented. The most significant of these are: - Previously, special extra columns for [T-Deposit2] and [T-Interact] with axis=act were missing from the created Pandas DataFrame. This has been rectified. (The data was always correctly written to the Numpy array used for constructing the DataFrame.) - Additional flags have been put in place to catch instances of axis=dchain for [T-Yield] and [T-Track]. - Fixed issue with reading [T-Yield] outputs with 2D axis values.
- Python
Published by Lindt8 about 1 year ago
The PHITS Tools Python package for parsing, organizing, and analyzing results from the PHITS radiation transport and DCHAIN activation codes - v1.2.3
In this minor release: - Improved documentation - Minor bugfixes - Jupyter notebook version of example added - PHITS Tools is now on PyPI!
- Python
Published by Lindt8 about 1 year ago
The PHITS Tools Python package for parsing, organizing, and analyzing results from the PHITS radiation transport and DCHAIN activation codes - v1.2.2
This release brings a small set of improvements, particularly to handling dump files: - Very large binary dump files can now be split into smaller parts for processing to save on system memory (and recombined at the end). - When parsing a directory containing dump files that had been split into numerous files by MPI, PHITS Tools can now merge them in the final saved data objects. - The option to compress standard tally output pickle files with LZMA is now available too. - More options are now available to the CLI. - Improved documentation
- Python
Published by Lindt8 over 1 year ago
The PHITS Tools Python package for parsing, organizing, and analyzing results from the PHITS radiation transport and DCHAIN activation codes - v1.2.0
This release brings a small set of improvements, particularly to handling dump files: - Very large binary dump files can now be split into smaller parts for processing to save on system memory (and recombined at the end). - When parsing a directory containing dump files that had been split into numerous files by MPI, PHITS Tools can now merge them in the final saved data objects. - The option to compress standard tally output pickle files with LZMA is now available too. - More options are now available to the CLI. - Improved documentation
- Python
Published by Lindt8 over 1 year ago
The PHITS Tools Python package for parsing, organizing, and analyzing results from the PHITS radiation transport and DCHAIN activation codes - v1.1.0
This release brings a large variety of new features and improvements:
- DCHAIN Tools is now included as a submodule and will be imported to handle any DCHAIN-related files passed to PHITS Tools.
- added /example demonstrating and explaining PHITS Tools usage
- added /test which can be used to test PHITS Tools on the ~300 sample output files distributed with PHITS
- added JOSS paper (draft)
- added ICRP 116 effective dose conversion coefficients database and function to employ them
- added database of PHITS formatted [Material] section entries and retrieval function
- added function for creating your own tally (useful for "dump" file processing)
- added function for rebinning histograms
- added a number of functions to aid in particle/nuclide identification and labeling
- expanded level of detail of documentation for main functions
- removed dill dependency and made munch dependency optional
- dump output pickle files are now compressed with LZMA by default
- improved error / warning messages and handling
- minor bugfixes
- Python
Published by Lindt8 over 1 year ago
The PHITS Tools Python package for parsing, organizing, and analyzing results from the PHITS radiation transport and DCHAIN activation codes - v1.0.0
This is the very first release of PHITS Tools, with its complete intended base feature-set of parsing PHITS standard and "dump" tally output files (and all of those in a directory) along with its interface methods as an imported module, a command line interface, and a GUI.
- Python
Published by Lindt8 over 1 year ago