Skip to content

Commit

Permalink
Fix TelescopeParameter for traitlets 5.1 (#1784)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxnoe authored Sep 1, 2021
1 parent a4b8e54 commit 1fd747b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ctapipe/core/traits.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,10 @@ def validate(self, obj, value):
return normalized_value

def set(self, obj, value):
# Support a single value for all (check and convert into a default value)
if not isinstance(value, (list, List, UserList, TelescopePatternList)):
value = [("type", "*", self._trait.validate(obj, value))]

# Retain existing subarray description
# when setting new value for TelescopeParameter
try:
Expand Down

0 comments on commit 1fd747b

Please sign in to comment.