Skip to content

Commit

Permalink
Add option to register CompositeAlgorithm.from_list (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
tbody-cfs authored Oct 28, 2024
1 parent 8e88cc6 commit ebb1e9f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cfspopcon/algorithm_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,10 @@ def wrapper(**kwargs: Any) -> xr.Dataset:
self.__doc__ = self._make_docstring()

@classmethod
def from_list(cls, keys: list[str]) -> CompositeAlgorithm:
def from_list(cls, keys: list[str], name: Optional[str] = None, register: bool = False) -> CompositeAlgorithm:
"""Build a CompositeAlgorithm from a list of Algorithm names."""
algorithms = [Algorithm.get_algorithm(key) for key in keys]
return CompositeAlgorithm(algorithms=algorithms)
return CompositeAlgorithm(algorithms=algorithms, name=name, register=register)

def _make_docstring(self) -> str:
"""Makes a doc-string detailing the function inputs and outputs."""
Expand Down

0 comments on commit ebb1e9f

Please sign in to comment.