Skip to content

Commit

Permalink
No need to get map shape for 0D placeholder map (#1245)
Browse files Browse the repository at this point in the history
  • Loading branch information
dachengx committed Aug 28, 2023
1 parent f543647 commit 3258746
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions straxen/itp_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,12 @@ def __init__(self, data, method='WeightedNearestNeighbors', **kwargs):
for map_name in self.map_names:
# Specify dtype float to set Nones to nan
map_data = np.array(self.data[map_name], dtype=np.float64)
if len(self.coordinate_system) == len(map_data):
array_valued = len(map_data.shape) == 2
else:
array_valued = len(map_data.shape) == self.dimensions + 1

if self.dimensions != 0:
if len(self.coordinate_system) == len(map_data):
array_valued = len(map_data.shape) == 2
else:
array_valued = len(map_data.shape) == self.dimensions + 1

if self.dimensions == 0:
# 0 D -- placeholder maps which take no arguments
Expand Down

0 comments on commit 3258746

Please sign in to comment.