Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Dec 19, 2024
1 parent 60fbaac commit e9c1651
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/integration/test_proj_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def test_node_in_group(proj_path):
project.repro()
assert n.state.group.name == ("MyGrp",)


def test_custom_node_name_in_group(proj_path):
project = zntrack.Project()
with project.group("MyGrp"):
Expand All @@ -99,6 +100,5 @@ def test_custom_node_name_in_group(proj_path):
assert n.state.group.name == ("MyGrp",)



if __name__ == "__main__":
test_groups_io(None)
8 changes: 6 additions & 2 deletions zntrack/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,15 @@ def compute_all_node_names(self) -> dict[uuid.UUID, str]:
)
if node.state.group is None:
if self.active_group is not None:
node_names[node.uuid] = f"{'_'.join(self.active_group.names)}_{node.__dict__['name']}"
node_names[node.uuid] = (
f"{'_'.join(self.active_group.names)}_{node.__dict__['name']}"
)
else:
node_names[node.uuid] = node.__dict__["name"]
else:
node_names[node.uuid] = f"{'_'.join(node.state.group.name)}_{node.__dict__['name']}"
node_names[node.uuid] = (
f"{'_'.join(node.state.group.name)}_{node.__dict__['name']}"
)
else:
if node.state.group is None:
if self.active_group is not None:
Expand Down

0 comments on commit e9c1651

Please sign in to comment.