Skip to content

Commit

Permalink
Desingleton creator (#527)
Browse files Browse the repository at this point in the history
* De-singleton creator and wrapper and update docstring

* Sneak a fix for 522 while we're here
  • Loading branch information
liamhuber authored Jan 3, 2025
1 parent c4fca19 commit afe4904
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions pyiron_workflow/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,18 @@

from executorlib import Executor as ExecutorlibExecutor
from pyiron_snippets.dotdict import DotDict
from pyiron_snippets.singleton import Singleton

from pyiron_workflow.executors import CloudpickleProcessPoolExecutor
from pyiron_workflow.nodes.function import as_function_node, function_node


class Creator(metaclass=Singleton):
class Creator:
"""
A container class for providing access to various workflow objects.
Gives access to various workflow tools and, by virtue of being a singleton, makes them
available to all composite nodes holding a creator.
Gives access to various workflow tools.
In addition to node objects, the creator also provides workflow-compliant executors
for parallel processing.
This includes a very simple in-house executor that is useful for learning, but also
choices from the :mod:`executorlib` packages.
Some :mod:`executorlib` executors may not be available on your machine (e.g. flux-
and/or slurm-based executors), in which case these attributes will return `None`
instead.
"""

def __init__(self):
Expand Down Expand Up @@ -97,10 +90,9 @@ def transformer(self):
]
}
)
return super().__dir__() + list(self._package_access.keys())


class Wrappers(metaclass=Singleton):
class Wrappers:
"""
A container class giving access to the decorators that transform functions to nodes.
"""
Expand Down

0 comments on commit afe4904

Please sign in to comment.