Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/condor/implementations/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
def options_to_kwargs(new_cls):
"""Process a model clasa and create the kwarg dictionary for the :class:`Options`"""
opts = getattr(new_cls, "Options", None)
def options_to_kwargs(new_cls, attr_name="Options"):
"""Process a model class and create the kwarg dictionary for the :class:`Options`"""
opts = getattr(new_cls, attr_name, None)
if opts is not None:
backend_option = {
k: v for k, v in opts.__dict__.items() if not k.startswith("_")
Expand Down
14 changes: 14 additions & 0 deletions tests/test_more_options.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import condor as co
from condor.implementations.utils import options_to_kwargs


def test_options_to_kwargs():
class ExampleModel(co.ExplicitSystem):
class Options:
in_options = True

class MiscOptions:
in_misc_options = True

assert options_to_kwargs(ExampleModel)["in_options"]
assert options_to_kwargs(ExampleModel, attr_name="MiscOptions")["in_misc_options"]