Skip to content

Commit

Permalink
fix instance of class
Browse files Browse the repository at this point in the history
  • Loading branch information
killiansheriff committed Jan 18, 2024
1 parent 4f1706c commit 39d9086
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/WarrenCowleyParameters/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ def get_type_name(self, id: int) -> str:
particle_type = self.data.particles["Particle Type"].type_by_id(id)
except:
# This is to deal with the case whenever type 3 and 1 are assigned but no atoms have type 2
particle_type.name = False
ParticleType = lambda name=False: type('ParticleType', (), {'name': name})()
particle_type = ParticleType()
return particle_type.name or f"Type {id}"

def create_visualization_tables(self, unique_types, nshells, wc_for_shells):
Expand Down

0 comments on commit 39d9086

Please sign in to comment.