Skip to main content

N|Python docker based CI PyPI codecov

This is a minimal Python package that provides both command line and API interfaces for removing multiple tags from a DAGMC h5m file.

This is useful for preparing the h5m file for visulisation where it is desirable to remove reflecting surfaces, vacuum materials and the graveyard(s) region from the geometry before viewing the vtk file.

Command line usage

Perhaps the most common use of this program is to remove a DAGMC graveyard.

remove-dagmc-tags -i dagmc.h5m -o dagmc_no_graveyard.h5m -t graveyard
  • the -i or --input argument specifies the input h5m file
  • the -o or --output argument specifies the output h5m or vtk filename
  • the -t or --tags argument specifies the tags to remove.
  • the -v or --verbose argument enables (true) or disables (false) the printing of additional details

Multiple tags can also be removed and vtk files can be generated. This example removes three tags from the dagmc.h5m file and saves the result as a vtk file.

remove-dagmc-tags -i dagmc.h5m -o output.vtk -t mat:graveyard mat:vacuum reflective

Python API usage

Removing a single tag called mat:graveyard from the dagmc.h5m file.

from remove_dagmc_tags import remove_tags

remove_tags(
    input='dagmc.h5m',
    output='output.h5m',
    tags='mat:graveyard'
)

Removing two tags called mat:graveyard and reflective from the dagmc.h5m file and saves the result as a vtk file and h5m file.

from remove_dagmc_tags import remove_tags

remove_tags(
    input='dagmc.h5m',
    output=['output.vtk', 'output.h5m'],
    tags=['reflective', 'mat:graveyard']
)

Installation

The recommended method of installing is via conda install as this is able to install all the dependencies including PyMoab.

conda install -c conda-forge remove_dagmc_tags

However the package is available via the PyPi package manager. In this case you will have to seperatly install PyMoab.

pip install remove_dagmc_tags

Some Python dependencies (such as Numpy) are installed during the pip install remove_dagmc_tags process, however PyMoab needs to be installed seperatly to make full use of this package.

One method of installing pymoab is to install MOAB via Conda which includes PyMoab.

conda install -c conda-forge moab

Another method of installing pymoab is to compile MOAB with pymoab enabled.

mkdir MOAB
cd MOAB ; \
mkdir build ; \
git clone  --single-branch --branch develop https://bitbucket.org/fathomteam/moab.git
cd build
cmake ../moab -DENABLE_HDF5=ON \
              -DENABLE_NETCDF=ON \
              -DENABLE_FORTRAN=OFF \
              -DENABLE_BLASLAPACK=OFF \
              -DBUILD_SHARED_LIBS=OFF \
              -DCMAKE_INSTALL_PREFIX=/MOAB
make -j"$compile_cores"
make -j"$compile_cores" install
cmake ../moab -DENABLE_HDF5=ON \
              -DENABLE_PYMOAB=ON \
              -DENABLE_FORTRAN=OFF \
              -DBUILD_SHARED_LIBS=ON \
              -DENABLE_BLASLAPACK=OFF \
              -DCMAKE_INSTALL_PREFIX=/MOAB
make -j"$compile_cores"
make -j"$compile_cores" install
cd pymoab
bash install.sh
python setup.py install

Achknowledgments

The package is largely inspired by the DAGMC-viz(https://github.com/svalinn/DAGMC-viz) repository.

Metadata

Release files for remove-dagmc-tags 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for remove-dagmc-tags 0.0.5
File Size Uploaded
remove_dagmc_tags-0.0.5.tar.gz 18.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for remove-dagmc-tags 0.0.5
File Interpreter ABI Platform
remove_dagmc_tags-0.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 38.0 kB

Release files / remove_dagmc_tags-0.0.5.tar.gz

Download URL remove_dagmc_tags-0.0.5.tar.gz
Size 18.1 kB
Tags Source
SHA-256 checksum
How to use checksums
e3e16c6ad219c1764db5db4236d326b4a022b2d62c98475c9318a9e9faa82b72
BLAKE2b-256 checksum
How to use checksums
16d23a7bf2cf70501b0d4665214cf7e6079f3c4735954b39eee4e15a2897a5a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

Release files / remove_dagmc_tags-0.0.5-py3-none-any.whl

Download URL remove_dagmc_tags-0.0.5-py3-none-any.whl
Size 19.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c878c23e899e3d7a359390b03a4a00201d3774d564840260063986b3294b7b34
BLAKE2b-256 checksum
How to use checksums
0168cb4311f002e3e594f3ddcb2dca62947ccd4a164323209e91507172fd9d31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

Release history Release notifications | RSS feed

This release

0.0.5 This release

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page