Closed AstroRobin closed 3 years ago
Should both "centre" and "center" spellings be accepted and lead to the same result? Or should we go for only one? I would need to check, but if we decide the latter then we should follow what matplotlib does (which I guess is "center").
Yes, in fact, I have now implemented the following validation:
# Validate ha and va:
ha = 'centre' if ha == 'center' else ha
va = 'centre' if va == 'center' else va
if ha not in ['left','right','centre']:
raise ValueError(f"'{ha}' was not recognised for `ha`, must be one of 'left', 'right' or 'centre'")
if va not in ['top','bottom','centre']:
raise ValueError(f"'{va}' was not recognised for `va`, must be one of 'top', 'bottom' or 'centre'")
Fixed as of 0.5.4.5.
When passing strings into ha and va in
splotch.subplots()
, if a string is not recognised, instead of raising an error, the function will continue and take the default value instead. This is an issue for example if the user spells 'centre' as 'center'.