Skip to content

Commit

Permalink
Patch registration to make new dictionaries based off the module path
Browse files Browse the repository at this point in the history
  • Loading branch information
liamhuber committed Feb 15, 2024
1 parent 7d8c354 commit 37f8858
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions pyiron_workflow/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,11 @@ def _register_recursively_from_module(
if domain is not None:
if domain not in container.keys():
container[domain] = DotDict()
subcontainer = container[domain]
container = container[domain]
else:
subcontainer = None
container = None
subcontainer = container

for _, submodule_name, _ in pkgutil.walk_packages(
module.__path__, module.__name__ + "."
):
Expand All @@ -260,9 +262,14 @@ def _register_recursively_from_module(
submodule, subdomain, subcontainer
)
else:
if subdomain not in container.keys():
subcontainer[subdomain] = DotDict()
subcontainer = subcontainer[subdomain]
relative_path = submodule.__name__.replace(
module.__name__ + ".", ""
)
subcontainer = container
for step in relative_path.split("."):
if step not in subcontainer.keys():
subcontainer[step] = DotDict()
subcontainer = subcontainer[subdomain]
else:
self._register_package_from_module(module, domain, container)

Expand Down

0 comments on commit 37f8858

Please sign in to comment.