Skip to content

Commit

Permalink
Display note for deprecated irdb modes
Browse files Browse the repository at this point in the history
  • Loading branch information
oczoske committed Jul 14, 2023
1 parent a0e08a8 commit e9a61dd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scopesim/commands/user_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ def set_modes(self, modes=None):
for mode in modes:
if mode in self.modes_dict:
defyam["properties"]["modes"].append(mode)
if "deprecate" in self.modes_dict[mode]:
logging.warning(self.modes_dict[mode]["deprecate"])

Check warning on line 235 in scopesim/commands/user_commands.py

View check run for this annotation

Codecov / codecov/patch

scopesim/commands/user_commands.py#L235

Added line #L235 was not covered by tests
else:
raise ValueError(f"mode '{mode}' was not recognised")

Expand All @@ -243,6 +245,8 @@ def list_modes(self):
dic = self.modes_dict[mode_name]
desc = dic["description"] if "description" in dic else "<None>"
modes[mode_name] = desc
if "deprecate" in dic:
modes[mode_name] += " (deprecated)"

Check warning on line 249 in scopesim/commands/user_commands.py

View check run for this annotation

Codecov / codecov/patch

scopesim/commands/user_commands.py#L249

Added line #L249 was not covered by tests

msg = "\n".join([f"{key}: {value}" for key, value in modes.items()])
else:
Expand Down

0 comments on commit e9a61dd

Please sign in to comment.