| Authors: | Lorenzo Canzian, Davide Manzione, Daniele Tomatis |
|---|---|
| Date: | January 13, 2026 |
nchainplotter is a Python module designed to plot decay/transmutation chains, given the selected nuclides and the desired threshold in terms of probability.
The project is organized according to the following folder structure:
<nchainplotter folder>
├── docs/
├── examples/
├── nchainplotter/
├── resources/
├── README.rst
└── setup.py
- "docs/": folder containing the documentation for the plotter;
- "examples/": folder containing a functioning example of the plotter, together with the outptu produced;
- "nchainplotter/": folder containing the main package code;
- "resources/": folder containing additional resources such as xml schemas
- "README.rst": the present file;
- "setup.py": the script for installing the package.
To run the code, the following dependencies must be satisfied:
Python>= 3.11+typing-extensions>= 4.12.2h5py== 3.14.0lxml== 6.0.0numpy== 2.4.0pandas== 2.3.3PyYAML== 6.0.2tikz_python== 0.0.6xmlschema== 4.1.0
To install nchainplotter, from the terminal clone the repository in the local folder:
git clone https://github.com/newcleo-dev-team/nchainplotter.gitThen, install the package using pip, running from the root directory of nchainplotter:
python -m pip install .After that, it will be possible to create a 'Chain' object directly from a YAML configuration file by providing the path to the depletion chain file in either OpenMC XML or HDF5 format:
from nchainplotter.build_chain import build_hdf5_from_configTo enable the plotter it would be sufficient to import the module in the Python script of interest:
from nchainplotter.plotter import plot_depletion_chainFinally, a Chain object can be simplified using
chain.simplify_chain()One example file is provided in the examples/ folder:
- An example file (generate_plot_from_XML.py) demonstrates how to build the chain from the configuration file, simplify it and finally produce a plot.
It is necessary to provide the input yaml file containing the following information:
- XML chain file path
- HDF5 chain file path, if any
- the nuclides to be considered as starting point into the "nucs" array
- set, at "rel_degree", depths of the chain i.e. the number of iterations to be considered away from starting nuclide
- set, at "direction", how the chain will be parsed. "m_to_d", mothers to daughters, indicates that for each nuclides its daughters will be found. On the opposite, "d_to_m" gather the mothers of all the nuclides
Once the information has been stored, the existence of an HDF file will be verified. If so, the file will be validated. If no HDF5 file is found, the XML file is validated and converted to HDF5 format.
Here, there is an example of a Sr90 chains in the mother-to-daughter representation:
This chain can be simplified retaining this result:


