Skip to content

Commit

Permalink
Merge pull request #99 from LSSTDESC/allow_non_types_description
Browse files Browse the repository at this point in the history
Allow None as the type in the description generator
  • Loading branch information
joezuntz authored Oct 3, 2023
2 parents 3d5eac8 + cfde760 commit 1e20f29
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"[type not specified]: {val._help} (default={val.default})"
else:
txt = f"[{val.dtype.__name__}]: {val._help} (default={val.default})"
elif isinstance(val, type):
txt = f"[{val.__name__}]: (required)"
else:
Expand Down

0 comments on commit 1e20f29

Please sign in to comment.