Skip to content

Commit

Permalink
Make sure max() gets a default when argument is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
paulromano committed Jan 17, 2024
1 parent 77759da commit f5147c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dagmc/dagnav.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def material(self, name: str):

if not existing_group:
# Create new group and add entity
group_id = max(g.id for g in self.model.groups.values()) + 1
group_id = max((g.id for g in self.model.groups.values()), default=0) + 1
new_group = Group.create(self.model, name=f"mat:{name}", group_id=group_id)
new_group.add_set(self)

Expand Down

0 comments on commit f5147c6

Please sign in to comment.