Closed DanRyanIrish closed 2 months ago
Did you fix it or was the report wrong?
Looks correct to me
The for...else
structure is not very commonly used, so I can understand it causing confusion. An alternative could be to rewrite
for array_type, masked_type in ARRAY_MASK_MAP.items():
if isinstance(self.data, array_type):
break
else:
masked_type = np.ma.masked_array
warn_user("data and mask arrays of different or unrecognized types. Casting them into a numpy masked array.")
as
try:
masked_type = next(array_type, masked_type in ARRAY_MASK_MAP.items() if isinstance(self.data, array_type))
except StopIteration:
masked_type = np.ma.masked_array
warn_user("data and mask arrays of different or unrecognized types. Casting them into a numpy masked array.")
Describe the bug
https://github.com/sunpy/ndcube/blob/main/ndcube/ndcube.py#L1138
To Reproduce
import sunpy
sunpy.map.Map(...) etc
Screenshots
No response
System Details
No response
Installation method
No response