fusion-energy / openmc-plasma-source

Creates a plasma source as an openmc.source object from input parameters that describe the plasma
MIT License
28 stars 11 forks source link

classes are now SourceWithPlotting #63

Closed shimwell closed 2 years ago

shimwell commented 2 years ago

This PR adds some plotting features to the package.

The sources are now instances of openmc_source_plotter.SourceWithPlotting() which is just a class that inherits openmc.Source and adds some plotting methods.

The additional plotting methods are .plot_source_position, .plot_source_energy, .plot_source_direction and there is also a sampling method called sample_initial_particles

This doesn't remove any of the existing plotting methods but adds a few new ones.

shimwell commented 2 years ago

Looks like the tests/test_tokamak_source.py::test_strengths_are_normalised is failing but I think that might be unrelated to this PR

RemDelaporteMathurin commented 2 years ago

Looks like the tests/test_tokamak_source.py::test_strengths_are_normalised is failing but I think that might be unrelated to this PR

The tests pass on develop so it has to be related to this PR

shimwell commented 2 years ago

ok fair enough, I shall refactor and come back with an improved version. I was perhaps a bit lazy here.