fusion-energy / openmc-dagmc-wrapper

A Python package that extends OpenMC base classes to provide convenience features and standardized tallies when simulating DAGMC geometry with OpenMC.
https://openmc-dagmc-wrapper.readthedocs.io/
MIT License
7 stars 2 forks source link

bounding box not subscriptable error #75

Closed shimwell closed 2 years ago

shimwell commented 2 years ago

when making a 3d mesh tally like so

tally1 = odw.MeshTally3D(
    mesh_resolution=(200, 200, 200),
    bounding_box=None,
    tally_type="heating",
)

I am getting the following error

  File "/opt/conda/lib/python3.8/site-packages/openmc_dagmc_wrapper/Tally.py", line 254, in __init__
    self.add_mesh_filter(bounding_box)
  File "/opt/conda/lib/python3.8/site-packages/openmc_dagmc_wrapper/Tally.py", line 266, in add_mesh_filter
    mesh.lower_left = self.bounding_box[0]
TypeError: 'NoneType' object is not subscriptable
RemDelaporteMathurin commented 2 years ago

Yes this issue is related to #67

bounding_box in MeshTally2D, MeshTally3D and TetMeshTally should never be None.

Instead it should be either a h5 filename or a list of coordinates.

Therefore, it shouldn't have a default value.