A minimal Python package that produces slice plots through h5m DAGMC geometry files

Overview

A minimal Python package that produces slice plots through h5m DAGMC geometry files

Installation

pip install dagmc_geometry_slice_plotter

Python API Usage

These examples assume you have a h5m file called dagmc.h5m in the same folder that the Python script is being run from.

Create a plot of a slice through the geometry perpendicular to the Z axis and default settings elsewhere. This will slice through the the center of the geometry as plane_origin has not been specified.

from dagmc_geometry_slice_plotter import plot_slice_of_dagmc_geometry

plot = plot_slice_of_dagmc_geometry(
    dagmc_file_or_trimesh_object='dagmc.h5m',
    plane_normal=[0, 0, 1],
)

plot.show()

dagmc slice plot

Create a plot of a slice through the geometry perpendicular to the Z axis, offset by 200cm and with default settings elsewhere.

from dagmc_geometry_slice_plotter import plot_slice_of_dagmc_geometry

plot = plot_slice_of_dagmc_geometry(
    dagmc_file_or_trimesh_object='dagmc.h5m',
    plane_origin=[0, 0, 200],
    plane_normal=[0, 0, 1],
)

plot.show()

dagmc slice plot

Create a plot of a slice through the geometry perpendicular to the Y axis, with a rotation of 45 degrees and with default settings elsewhere. Also saves the plot with a high resolution (DPI)

from dagmc_geometry_slice_plotter import plot_slice_of_dagmc_geometry

plot = plot_slice_of_dagmc_geometry(
    dagmc_file_or_trimesh_object='dagmc.h5m',
    plane_normal=[0, 1, 0],
    rotate_plot=45,
)

plot.savefig('my_plot3.png', dpi=600)

dagmc slice plot

Saves a png image of a plot of a slice through the geometry perpendicular to the X axis and with default settings elsewhere.

from dagmc_geometry_slice_plotter import plot_slice_of_dagmc_geometry

plot_slice_of_dagmc_geometry(
    dagmc_file_or_trimesh_object='dagmc.h5m',
    plane_normal = [1, 0, 0],
    rotate_plot=270,
    output_filename='my_plot4.png'
)

dagmc slice plot

Related packages

This package is used by the regular_mesh_plotter Python package to combine slice plots with regular mesh tally results and produce images like below.

paramak plot openmc regular mesh tally

paramak plot openmc regular mesh tally

Comments
  • Some funky PyQT errors?

    Some funky PyQT errors?

    Pip installed and got the following error;

    ~/.local/lib/python3.10/site-packages/IPython/external/qt_loaders.py in load_qt(api_options)
        370         return result
        371     else:
    --> 372         raise ImportError("""
        373     Could not load requested Qt binding. Please ensure that
        374     PyQt4 >= 4.7, PyQt5, PySide >= 1.0.3 or PySide2 is available,
    
    ImportError: 
        Could not load requested Qt binding. Please ensure that
        PyQt4 >= 4.7, PyQt5, PySide >= 1.0.3 or PySide2 is available,
        and only one is imported per session.
    
        Currently-imported Qt library:                              'pyqt5'
        PyQt4 available (requires QtCore, QtGui, QtSvg):            False
        PyQt5 available (requires QtCore, QtGui, QtSvg, QtWidgets): False
        PySide >= 1.0.3 installed:                                  False
        PySide2 installed:                                          True
        Tried to load:                
    

    But, I do have pyqt5 & PySide2 installed

    opened by makeclean 1
  • added single function that works for file or object

    added single function that works for file or object

    Adds a function called plot_slice_of_dagmc_geometry that can accept either a dagmc file name or a trimesh object and then produce a plot.

    This provides a single entry function for users

    opened by shimwell 1
  • adopted latest py packaging approach

    adopted latest py packaging approach

    A while back I updated this package from a setup.py to use a setup.cfg and a pyproject.toml.

    It is now possible to do everything in the pyproject.toml so this PR updates the packages

    opened by shimwell 0
  • remove internal plotting methods

    remove internal plotting methods

    returning the mplt object and then using the mplt savefig() method offers more flexibility then the built in function offers.

    We can remove the internal function and reduce the code base a bit while maintaining the same functionalilty

    opened by shimwell 0
  • adding ability to make animation

    adding ability to make animation

    It would be handy if the slicer can make an animation

    Perhaps it could accept a tuple for some of these inputs of plane_origin, plane_normal, rotate_plot and then make an animation that sweeps between the inputs.

    A nice tutorial on mpl animations can be found here https://brushingupscience.com/2016/06/21/matplotlib-animations-the-easy-way/

    opened by shimwell 0
  • setuptools_scm is required in setup.cfg

    setuptools_scm is required in setup.cfg

    I might have done something incorrect with the setup.cfg / pyprogject.toml as it appears necessary to add setuptools_scm to the setup.cfg file.

    Without this package the CI fails https://github.com/fusion-energy/dagmc_geometry_slice_plotter/runs/5336107961?check_suite_focus=true

    With the package the CI passes https://github.com/fusion-energy/dagmc_geometry_slice_plotter/runs/5336124187?check_suite_focus=true

    I tested the removal of this package in this PR https://github.com/fusion-energy/dagmc_geometry_slice_plotter/pull/14

    I'm just not sure why it setuptools_scm is needed as this is not the case for other packages I've translated to setup.cfg

    opened by shimwell 0
Releases(0.2.1)
  • 0.2.1(Dec 13, 2022)

    What's Changed

    • added axis labels by @shimwell in https://github.com/fusion-energy/dagmc_geometry_slice_plotter/pull/28

    Full Changelog: https://github.com/fusion-energy/dagmc_geometry_slice_plotter/compare/0.2.0...0.2.1

    Source code(tar.gz)
    Source code(zip)
  • 0.2.0(Dec 2, 2022)

    What's Changed

    • removed unused script by @shimwell in https://github.com/fusion-energy/dagmc_geometry_slice_plotter/pull/25
    • moved to src project layout by @shimwell in https://github.com/fusion-energy/dagmc_geometry_slice_plotter/pull/26
    • refactoring to allow axis aligned plots by @shimwell in https://github.com/fusion-energy/dagmc_geometry_slice_plotter/pull/27

    Full Changelog: https://github.com/fusion-energy/dagmc_geometry_slice_plotter/compare/0.1.3...0.2.0

    Source code(tar.gz)
    Source code(zip)
  • 0.1.3(Sep 29, 2022)

    What's Changed

    • removed packages that are installed by pyproject by @shimwell in https://github.com/fusion-energy/dagmc_geometry_slice_plotter/pull/22
    • added build back by @shimwell in https://github.com/fusion-energy/dagmc_geometry_slice_plotter/pull/23
    • added missing run cmd by @shimwell in https://github.com/fusion-energy/dagmc_geometry_slice_plotter/pull/24

    Full Changelog: https://github.com/fusion-energy/dagmc_geometry_slice_plotter/compare/0.1.2...0.1.3

    Source code(tar.gz)
    Source code(zip)
  • 0.1.2(Sep 29, 2022)

    What's Changed

    • adopted latest py packaging approach by @shimwell in https://github.com/fusion-energy/dagmc_geometry_slice_plotter/pull/20
    • updating package production by @shimwell in https://github.com/fusion-energy/dagmc_geometry_slice_plotter/pull/21

    Full Changelog: https://github.com/fusion-energy/dagmc_geometry_slice_plotter/compare/0.1.1...0.1.2

    Source code(tar.gz)
    Source code(zip)
  • 0.1.1(Mar 7, 2022)

    What's Changed

    • fixed typo in package name by @shimwell in https://github.com/fusion-energy/dagmc_geometry_slice_plotter/pull/19

    Full Changelog: https://github.com/fusion-energy/dagmc_geometry_slice_plotter/compare/0.1.0...0.1.1

    Source code(tar.gz)
    Source code(zip)
  • 0.1.0(Feb 25, 2022)

    What's Changed

    • updated to setup.cfg by @shimwell in https://github.com/fusion-energy/dagmc_geometry_slice_plotter/pull/13
    • Added more python versions to the testing by @shimwell in https://github.com/fusion-energy/dagmc_geometry_slice_plotter/pull/14
    • removed output filename option by @shimwell in https://github.com/fusion-energy/dagmc_geometry_slice_plotter/pull/18

    Full Changelog: https://github.com/fusion-energy/dagmc_geometry_slice_plotter/compare/v0.0.5...0.1.0

    Source code(tar.gz)
    Source code(zip)
Owner
Fusion Energy
A collection of software projects related to fusion energy
Fusion Energy
kyle's vision of how datadog's python client should look

kyle's datadog python vision/proposal not for production use See examples/comprehensive.py for a mostly working example of the proposed API. 📈 🐶 ❤️

Kyle Verhoog 2 Nov 21, 2021
Squidpy is a tool for the analysis and visualization of spatial molecular data.

Squidpy is a tool for the analysis and visualization of spatial molecular data. It builds on top of scanpy and anndata, from which it inherits modularity and scalability. It provides analysis tools t

Theis Lab 251 Dec 19, 2022
python partial dependence plot toolbox

PDPbox python partial dependence plot toolbox Motivation This repository is inspired by ICEbox. The goal is to visualize the impact of certain feature

Li Jiangchun 723 Jan 07, 2023
Decision Border Visualizer for Classification Algorithms

dbv Decision Border Visualizer for Classification Algorithms Project description A python package for Machine Learning Engineers who want to visualize

Sven Eschlbeck 1 Nov 01, 2021
Fastest Gephi's ForceAtlas2 graph layout algorithm implemented for Python and NetworkX

ForceAtlas2 for Python A port of Gephi's Force Atlas 2 layout algorithm to Python 2 and Python 3 (with a wrapper for NetworkX and igraph). This is the

Bhargav Chippada 227 Jan 05, 2023
UNMAINTAINED! Renders beautiful SVG maps in Python.

Kartograph is not maintained anymore As you probably already guessed from the commit history in this repo, Kartograph.py is not maintained, which mean

1k Dec 09, 2022
A program that analyzes data from inertia measurement units installed in aircraft and generates g-exceedance curves.

A program that analyzes data from inertia measurement units installed in aircraft and generates g-exceedance curves.

Pooya 1 Dec 02, 2021
HW 02 for CS40 - matplotlib practice

HW 02 for CS40 - matplotlib practice project instructions https://github.com/mikeizbicki/cmc-csci040/tree/2021fall/hw_02 Drake Lyric Analysis Bar Char

13 Oct 27, 2021
Manim is an animation engine for explanatory math videos.

A community-maintained Python framework for creating mathematical animations.

12.4k Dec 30, 2022
Geospatial Data Visualization using PyGMT

Example script to visualize topographic data, earthquake data, and tomographic data on a map

Utpal Kumar 2 Jul 30, 2022
NW 2022 Hackathon Project by Angelique Clara Hanzel, Aryan Sonik, Damien Fung, Ramit Brata Biswas

Spiral-Data-Visualizer NW 2022 Hackathon Project by Angelique Clara Hanzell, Aryan Sonik, Damien Fung, Ramit Brata Biswas Description This project vis

Damien Fung 2 Jan 16, 2022
Plot and save the ground truth and predicted results of human 3.6 M and CMU mocap dataset.

Visualization-of-Human3.6M-Dataset Plot and save the ground truth and predicted results of human 3.6 M and CMU mocap dataset. human-motion-prediction

Gaurav Kumar Yadav 5 Nov 18, 2022
Draw datasets from within Jupyter.

drawdata This small python app allows you to draw a dataset in a jupyter notebook. This should be very useful when teaching machine learning algorithm

vincent d warmerdam 505 Nov 27, 2022
This is a small program that prints a user friendly, visual representation, of your current bsp tree

bspcq, q for query A bspc analyzer (utility for bspwm) This is a small program that prints a user friendly, visual representation, of your current bsp

nedia 9 Apr 24, 2022
Minimalistic tool to visualize how the routes to a given target domain change over time, feat. Python 3.10 & mermaid.js

Minimalistic tool to visualize how the routes to a given target domain change over time, feat. Python 3.10 & mermaid.js

Péter Ferenc Gyarmati 1 Jan 17, 2022
cqMore is a CadQuery plugin based on CadQuery 2.1.

cqMore (under construction) cqMore is a CadQuery plugin based on CadQuery 2.1. Installation Please use conda to install CadQuery and its dependencies

Justin Lin 36 Dec 21, 2022
This plugin plots the time you spent on a tag as a histogram.

This plugin plots the time you spent on a tag as a histogram.

Tom Dörr 7 Sep 09, 2022
Painlessly create beautiful matplotlib plots.

Announcement Thank you to everyone who has used prettyplotlib and made it what it is today! Unfortunately, I no longer have the bandwidth to maintain

Olga Botvinnik 1.6k Jan 06, 2023
Plot toolbox based on Matplotlib, simple and elegant.

Elegant-Plot Plot toolbox based on Matplotlib, simple and elegant. 绘制效果 绘制过程 数据准备 每种图标类型的目录下有data.csv文件,依据样例数据填入自己的数据。

3 Jul 15, 2022
Python+Numpy+OpenGL: fast, scalable and beautiful scientific visualization

Python+Numpy+OpenGL: fast, scalable and beautiful scientific visualization

Glumpy 1.1k Jan 05, 2023