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 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
File details
Details for the file dagmc_h5m_file_inspector-0.5.0.tar.gz
.
File metadata
- Download URL: dagmc_h5m_file_inspector-0.5.0.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 347bf297436c131ca1d5c21e64ebca20f38ea5a999b28846eaa40193c72d81eb |
|
MD5 | 324c29f9179cb85e69f4c4305be43ab2 |
|
BLAKE2b-256 | 7cc0a00deb93c99e5b2199236971b7b1aff93e0667e45ec931a2313e54a3a01e |
File details
Details for the file dagmc_h5m_file_inspector-0.5.0-py3-none-any.whl
.
File metadata
- Download URL: dagmc_h5m_file_inspector-0.5.0-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 080b8b457e5c8bb945870d5a7e062ba2635bc61e31483091e49f92fbb1bcb4eb |
|
MD5 | e6f3ae761ef50d6f712c9e6be99be398 |
|
BLAKE2b-256 | c6bbd2f87cee55c467e1b00826d96d0d2defc96465b037e68a473535b1dc7d71 |