Skip to content

Commit

Permalink
Merge pull request #251 from AstarVienna/oc/deprecated_modes
Browse files Browse the repository at this point in the history
Display note for deprecated irdb modes
  • Loading branch information
hugobuddel committed Jul 14, 2023
2 parents a0e08a8 + e9a61dd commit f03211c
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"])
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)"

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

0 comments on commit f03211c

Please sign in to comment.