fusion-energy / openmc_source_plotter

A Python package for extracting and plotting the locations, directions, energy distributions of OpenMC source particles
MIT License
10 stars 3 forks source link

Import error openmc=0.13.3 #34

Closed rmchurch closed 8 months ago

rmchurch commented 8 months ago

Not sure if intended to be compatible with openmc=0.13.3. I upgraded to 0.14.0 and error went away.

import openmc
import openmc_source_plotter
--> 230 openmc.SourceBase.sample_initial_particles = sample_initial_particles
    231 openmc.model.Model.sample_initial_particles = sample_initial_particles
    232 openmc.Model.sample_initial_particles = sample_initial_particles

AttributeError: module 'openmc' has no attribute 'SourceBase'
shimwell commented 8 months ago

Yes you are right about the minimum version of openmc

I've added a line to the readme and section to the code that checks the openmc version.

I think this PR solves the issue but open to feedback / reviews

https://github.com/fusion-energy/openmc_source_plotter/pull/35

shimwell commented 8 months ago

PR #35 has now been merged and a new release has been made. Feel free to reopen if this issue comes back