Skip to main content

A tool for selectively removing tags such as the graveyard from DAGMC h5m files.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

remove_dagmc_tags-0.0.5.tar.gz (18.1 kB view details)

Uploaded Source

Built Distribution

remove_dagmc_tags-0.0.5-py3-none-any.whl (19.9 kB view details)

Uploaded Python 3

File details

Details for the file remove_dagmc_tags-0.0.5.tar.gz.

File metadata

  • Download URL: remove_dagmc_tags-0.0.5.tar.gz
  • Upload date:
  • Size: 18.1 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for remove_dagmc_tags-0.0.5.tar.gz
Algorithm Hash digest
SHA256 e3e16c6ad219c1764db5db4236d326b4a022b2d62c98475c9318a9e9faa82b72
MD5 348fe699b73301e2cbc7851ec1f3f1e9
BLAKE2b-256 16d23a7bf2cf70501b0d4665214cf7e6079f3c4735954b39eee4e15a2897a5a9

See more details on using hashes here.

File details

Details for the file remove_dagmc_tags-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: remove_dagmc_tags-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 19.9 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for remove_dagmc_tags-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 c878c23e899e3d7a359390b03a4a00201d3774d564840260063986b3294b7b34
MD5 a7500196b0ce79269ce457e798e7d85a
BLAKE2b-256 0168cb4311f002e3e594f3ddcb2dca62947ccd4a164323209e91507172fd9d31

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page