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
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
📊📈 Serves up Pandas dataframes via the Django REST Framework for use in client-side (i.e. d3.js) visualizations and offline analysis (e.g. Excel)

📊📈 Serves up Pandas dataframes via the Django REST Framework for use in client-side (i.e. d3.js) visualizations and offline analysis (e.g. Excel)

wq framework 1.2k Jan 01, 2023
HW 2: Visualizing interesting datasets

HW 2: Visualizing interesting datasets Check out the project instructions here! Mean Earnings per Hour for Males and Females My first graph uses data

7 Oct 27, 2021
A python-generated website for visualizing the novel coronavirus (COVID-19) data for Greece.

COVID-19-Greece A python-generated website for visualizing the novel coronavirus (COVID-19) data for Greece. Data sources Data provided by Johns Hopki

Isabelle Viktoria Maciohsek 23 Jan 03, 2023
Chem: collection of mostly python code for molecular visualization, QM/MM, FEP, etc

chem: collection of mostly python code for molecular visualization, QM/MM, FEP,

5 Sep 02, 2022
Lightweight, extensible data validation library for Python

Cerberus Cerberus is a lightweight and extensible data validation library for Python. v = Validator({'name': {'type': 'string'}}) v.validate({

eve 2.9k Dec 27, 2022
HM02: Visualizing Interesting Datasets

HM02: Visualizing Interesting Datasets This is a homework assignment for CSCI 40 class at Claremont McKenna College. Go to the project page to learn m

Qiaoling Chen 11 Oct 26, 2021
finds grocery stores and stuff next to route (gpx)

Route-Report Route report is a command-line utility that can be used to locate points-of-interest near your planned route (gpx). The results are based

Clemens Mosig 5 Oct 10, 2022
Extract data from ThousandEyes REST API and visualize it on your customized Grafana Dashboard.

ThousandEyes Grafana Dashboard Extract data from the ThousandEyes REST API and visualize it on your customized Grafana Dashboard. Deploy Grafana, Infl

Flo Pachinger 16 Nov 26, 2022
Simple CLI python app to show a stocks graph performance. Made with Matplotlib and Tiingo.

stock-graph-python Simple CLI python app to show a stocks graph performance. Made with Matplotlib and Tiingo. Tiingo API Key You will need to add your

Toby 3 May 14, 2022
Create a table with row explanations, column headers, using matplotlib

Create a table with row explanations, column headers, using matplotlib. Intended usage was a small table containing a custom heatmap.

4 Aug 14, 2022
Farhad Davaripour, Ph.D. 1 Jan 05, 2022
A high performance implementation of HDBSCAN clustering. http://hdbscan.readthedocs.io/en/latest/

HDBSCAN Now a part of scikit-learn-contrib HDBSCAN - Hierarchical Density-Based Spatial Clustering of Applications with Noise. Performs DBSCAN over va

Leland McInnes 91 Dec 29, 2022
Backend app for visualizing CANedge log files in Grafana (directly from local disk or S3)

CANedge Grafana Backend - Visualize CAN/LIN Data in Dashboards This project enables easy dashboard visualization of log files from the CANedge CAN/LIN

13 Dec 15, 2022
Attractors is a package for simulation and visualization of strange attractors.

attractors Attractors is a package for simulation and visualization of strange attractors. Installation The simplest way to install the module is via

Vignesh M 45 Jul 31, 2022
An easy to use burndown chart generator for GitHub Project Boards.

Burndown Chart for GitHub Projects An easy to use burndown chart generator for GitHub Project Boards. Table of Contents Features Installation Assumpti

Joseph Hale 15 Dec 28, 2022
Realtime Web Apps and Dashboards for Python and R

H2O Wave Realtime Web Apps and Dashboards for Python and R New! R Language API Build and control Wave dashboards using R! New! Easily integrate AI/ML

H2O.ai 3.4k Jan 06, 2023
Fast data visualization and GUI tools for scientific / engineering applications

PyQtGraph A pure-Python graphics library for PyQt5/PyQt6/PySide2/PySide6 Copyright 2020 Luke Campagnola, University of North Carolina at Chapel Hill h

pyqtgraph 3.1k Jan 08, 2023
A Bokeh project developed for learning and teaching Bokeh interactive plotting!

Bokeh-Python-Visualization A Bokeh project developed for learning and teaching Bokeh interactive plotting! See my medium blog posts about making bokeh

Will Koehrsen 350 Dec 05, 2022