Skip to content

Commit

Permalink
Allow None as the type in the description generator
Browse files Browse the repository at this point in the history
  • Loading branch information
joezuntz committed Oct 3, 2023
1 parent 3d5eac8 commit 3f17cec
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ceci/stage.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,9 +418,15 @@ def _describe_configuration_text(cls):
for name, val in cls.config_options.items():
if isinstance(val, StageParameter):
if val.required:
txt = f"[{val.dtype.__name__}]: {val._help} (required)"
if val.dtype is None:
txt = f"[type not specified]: {val._help} (required)"
else:
txt = f"[{val.dtype.__name__}]: {val._help} (required)"
else:
txt = f"[{val.dtype.__name__}]: {val._help} (default={val.default})"
if val.dtype is None:
txt = f"[{val.dtype.__name__}]: {val._help} (default={val.default})"
else:
txt = f"[type not specified]: {val._help} (default={val.default})"
elif isinstance(val, type):
txt = f"[{val.__name__}]: (required)"
else:
Expand Down

0 comments on commit 3f17cec

Please sign in to comment.