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 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
>>> {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.3.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa5912dc7ed131c8a4125ecf7a367c8ae28d97307e15307553756576fc6b2e3b |
|
MD5 | f0cefcb85fcd3ee6bd4b297b4f7ee366 |
|
BLAKE2b-256 | c0f59d8436b3d8c80be9b3b4db8fa4c3b0f3918a66fad526f58f278a53cf2d02 |
Hashes for dagmc_h5m_file_inspector-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 899a5eb58ebfb5581e2209a62f44e2a8ef66fdaa5eb87cf22a717271304758aa |
|
MD5 | 024d42d4f84541f32ec47d3e6272f19d |
|
BLAKE2b-256 | 2de8d4dd1b1801f0425e334dac73f1c376fa589de6e16cf7f1f478a70d5e49c5 |