Extracts information from DAGMC h5m files including volumes number, material tags
Project description
dagmc-h5m-file-inspector
A minimal Python package that finds the volume ids and the material tags in a DAGMC h5m file.
Installation (Conda)
The dagmc-h5m-file-inspector package can be installed with a single conda install terminal command.
conda install -c fusion-energy -c conda-forge dagmc_h5m_file_inspector
Installation (Conda + Pip)
The dagmc-h5m-file-inspector package requires pymoab which can be installed alongside Moab with a conda install command. Moab is not avialable on pip, however it can be installed with Conda.
conda install -c conda-forge moab
pip install dagmc-h5m-file-inspector
Python API Usage
Finding the volume IDs in a DAGMC h5m file.
import dagmc_h5m_file_inspector as di
di.get_volumes_from_h5m("dagmc.h5m")
>>> [1, 2]
Finding the material tags in a DAGMC h5m file.
import dagmc_h5m_file_inspector as di
di.get_materials_from_h5m("dagmc.h5m")
>>> ['steel', 'graveyard']
Finding the volume IDs with their materials present in a DAGMC h5m file.
import dagmc_h5m_file_inspector as di
di.get_volumes_and_materials_from_h5m("dagmc.h5m")
>>> {1: 'steel', 2: 'graveyard'}
Command line tool usage
The options for the command line tool can be obtained with inspect-dagmc-h5m-file --help
Print the volume IDs present in a dagmc h5m file to the terminal
inspect-dagmc-h5m-file -i dagmc.h5m -v
>>> Volume IDs =[1, 2]
Print the material tags present in a dagmc h5m file to the terminal
inspect-dagmc-h5m-file -i dagmc.h5m -m
>>> Material tags =['steel', 'graveyard']
Print the volume IDs and materials present in a dagmc h5m file to the terminal
inspect-dagmc-h5m-file -i dagmc.h5m -b
>>> Volume IDs and material tags=
{ 1: 'steel',
2: 'graveyard'}
Write the volume IDs and materials present in a dagmc h5m file to a txt file
inspect-dagmc-h5m-file -i dagmc.h5m -b -o output.txt
>>> writing file output.txt
Aknowledgements
This package is based on a Python script by @gonuke
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for dagmc_h5m_file_inspector-0.4.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8866a95c46feabfc7e9d26b8fc555a23fdd4012abeb3d4e8e384b1e913ceab7 |
|
MD5 | eb2d5011a23af87cde7a01e0c2f8071a |
|
BLAKE2b-256 | b855b17ab60379c79ad4de854871ed0752c089fdfa63e9255e9ad97b0bb0c8e4 |
Hashes for dagmc_h5m_file_inspector-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ed0f77a4c07d31142928e94a14c494c14b749ef8855ff51a3f8b1852c903a16 |
|
MD5 | 3829d38deb95e34768a4b2c395faefd9 |
|
BLAKE2b-256 | 554d0f1b170cbc961eeb9714d98e907ac47673ff8c059758238ff054c4a88999 |