FireDynamics / fdsreader

Python reader for FDS data
GNU General Public License v3.0
44 stars 18 forks source link

TypeError: unhashable type: 'Mesh' #54

Closed C-Rogge closed 1 year ago

C-Rogge commented 1 year ago

Hallo again,

i stumbled across a strange error while trying to import a simulation via fdsreader.Simulation('path'):

TypeError: unhashable type: 'Mesh'

... seemingly located within the 370th line of the Simulation class:

subobst = self._subobstructions[mesh][int(obst_index) - 1]

I could reproduce this error when trying to import another, totally different and unrelated simulation file while the import of two other simulations did not produce this error. Yet i was not able to wrap my head around the decisive difference between those cases regarding obstructions or meshs, but i keep looking into this. I'll also keep this post updated if i can find something.

I won't attach any data, for the cases are quite complex and i was'nt yet able to narrow the problem down to a vivid example file.

Meanwhile any ideas where this error could be originated?

JanVogelsang commented 1 year ago

Hi, this is indeed a bug in the code, it should be mesh.id instead of mesh. The bug should only appear if you have any SHOW_OBST/HIDE_OBST lines in your simulation, as those are actually considered in the reader as well.

I fixed it in the newest release 1.9.4, please run pip install --upgrade fdsreader to get the latest version.

C-Rogge commented 1 year ago

Done. Works. Thanks. :) And happy new year!