Skip to content

Commit

Permalink
Merge branch 'master' into use_pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dachengx authored Aug 31, 2023
2 parents 9baf3be + 34e12b6 commit 2602f92
Show file tree
Hide file tree
Showing 3 changed files with 8 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 @@ -159,10 +159,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
1 change: 1 addition & 0 deletions straxen/storage/rucio_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ def _get_metadata(self, did: str, **kwargs):
with open(metadata_path, mode="r") as f:
return json.loads(f.read())

@strax.check_chunk_n
def _read_chunk(self, did, chunk_info, dtype, compressor):
scope, name = did.split(":")
did = f"{scope}:{chunk_info['filename']}"
Expand Down
1 change: 1 addition & 0 deletions straxen/storage/rucio_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ def _get_metadata(self, dset_did, **kwargs):
with open(metadata_path, mode="r") as f:
return json.loads(f.read())

@strax.check_chunk_n
def _read_chunk(self, dset_did, chunk_info, dtype, compressor):
base_dir = os.path.join(self.staging_dir, did_to_dirname(dset_did))
chunk_file = chunk_info["filename"]
Expand Down

0 comments on commit 2602f92

Please sign in to comment.