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
Quickly and accurately render even the largest data.

Turn even the largest data into images, accurately Build Status Coverage Latest dev release Latest release Docs Support What is it? Datashader is a da

HoloViz 2.9k Dec 28, 2022
Bcc2telegraf: An integration that sends ebpf-based bcc histogram metrics to telegraf daemon

bcc2telegraf bcc2telegraf is an integration that sends ebpf-based bcc histogram

Peter Bobrov 2 Feb 17, 2022
Draw interactive NetworkX graphs with Altair

nx_altair Draw NetworkX graphs with Altair nx_altair offers a similar draw API to NetworkX but returns Altair Charts instead. If you'd like to contrib

Zachary Sailer 206 Dec 12, 2022
eoplatform is a Python package that aims to simplify Remote Sensing Earth Observation by providing actionable information on a wide swath of RS platforms and provide a simple API for downloading and visualizing RS imagery

An Earth Observation Platform Earth Observation made easy. Report Bug | Request Feature About eoplatform is a Python package that aims to simplify Rem

Matthew Tralka 4 Aug 11, 2022
Browse Dash docsets inside emacs

Helm Dash What's it This package uses Dash docsets inside emacs to browse documentation. Here's an article explaining the basic usage of it. It doesn'

504 Dec 15, 2022
CompleX Group Interactions (XGI) provides an ecosystem for the analysis and representation of complex systems with group interactions.

XGI CompleX Group Interactions (XGI) is a Python package for the representation, manipulation, and study of the structure, dynamics, and functions of

Complex Group Interactions 67 Dec 28, 2022
Data Visualizations for the #30DayChartChallenge

The #30DayChartChallenge This repository contains all the charts made for the #30DayChartChallenge during the month of April. This project aims to exp

Isaac Arroyo 7 Sep 20, 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
trade bot connected to binance API/ websocket.,, include dashboard in plotly dash to visualize trades and balances

Crypto trade bot 1. What it is Trading bot connected to Binance API. This project made for fun. So ... Do not use to trade live before you have backte

G 3 Oct 07, 2022
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
1900-2016 Olympic Data Analysis in Python by plotting different graphs

🔥 Olympics Data Analysis 🔥 In Data Science field, there is a big topic before creating a model for future prediction is Data Analysis. We can find o

Sayan Roy 1 Feb 06, 2022
Gallery of applications built using bqplot and widget libraries like ipywidgets, ipydatagrid etc.

bqplot Gallery This is a gallery of bqplot examples. View the gallery at https://bqplot.github.io/bqplot-gallery. Contributing new examples Clone this

8 Aug 23, 2022
Make scripted visualizations in blender

Scripted visualizations in blender The goal of this project is to script 3D scientific visualizations using blender. To achieve this, we aim to bring

Praneeth Namburi 10 Jun 01, 2022
ICS-Visualizer is an interactive Industrial Control Systems (ICS) network graph that contains up-to-date ICS metadata

ICS-Visualizer is an interactive Industrial Control Systems (ICS) network graph that contains up-to-date ICS metadata (Name, company, port, user manua

QeeqBox 2 Dec 13, 2021
A Simple Flask-Plotly Example for NTU 110-1 DSSI Class

A Simple Flask-Plotly Example for NTU 110-1 DSSI Class Live Demo Prerequisites We will use Flask and Ploty to build a Flask application. If you haven'

Ting Ni Wu 1 Dec 11, 2021
Datapane is the easiest way to create data science reports from Python.

Datapane Teams | Documentation | API Docs | Changelog | Twitter | Blog Share interactive plots and data in 3 lines of Python. Datapane is a Python lib

Datapane 744 Jan 06, 2023
阴阳师后台全平台(使用网易 MuMu 模拟器)辅助。支持御魂,觉醒,御灵,结界突破,秘闻副本,地域鬼王。

阴阳师后台全平台辅助 Python 版本:Python 3.8.3 模拟器:网易 MuMu | 雷电模拟器 模拟器分辨率:1024*576 显卡渲染模式:兼容(OpenGL) 兼容 Windows 系统和 MacOS 系统 思路: 利用 adb 截图后,使用 opencv 找图找色,模拟点击。使用

简讯 27 Jul 09, 2022
Visualizations of linear algebra algorithms for people who want a deep understanding

Visualising algorithms on symmetric matrices Examples QR algorithm and LR algorithm Here, we have a GIF animation of an interactive visualisation of t

ogogmad 3 May 05, 2022
Practical-statistics-for-data-scientists - Code repository for O'Reilly book

Code repository Practical Statistics for Data Scientists: 50+ Essential Concepts Using R and Python by Peter Bruce, Andrew Bruce, and Peter Gedeck Pub

1.7k Jan 04, 2023
Drag’n’drop Pivot Tables and Charts for Jupyter/IPython Notebook, care of PivotTable.js

pivottablejs: the Python module Drag’n’drop Pivot Tables and Charts for Jupyter/IPython Notebook, care of PivotTable.js Installation pip install pivot

Nicolas Kruchten 512 Dec 26, 2022