From f5147c6591074e5a78d86cb3a7ca17d5a52a70d0 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 17 Jan 2024 07:12:07 -0600 Subject: [PATCH] Make sure max() gets a default when argument is empty --- dagmc/dagnav.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dagmc/dagnav.py b/dagmc/dagnav.py index e8a8d78..385451e 100644 --- a/dagmc/dagnav.py +++ b/dagmc/dagnav.py @@ -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)