Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

Commit

Permalink
Patch read_vis for another release
Browse files Browse the repository at this point in the history
  • Loading branch information
amcnicho committed Mar 22, 2021
1 parent 9a05227 commit 8ee8b64
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions cngi/dio/read_vis.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,16 @@ def read_vis(

# at this point, s3_url should be compatible and reference top level of a mxds
if partition is None:
# the [1:]s here are both necessary to avoid the .version object
# avoid the .version object
contents_map = s3.listdir(s3_url)[1:]
object_names = [
object_dict["name"].split("/")[-1] for object_dict in contents_map[1:]
object_dict["name"].split("/")[-1] for object_dict in contents_map
]
object_names = [
oname for oname in object_names if not oname.startswith(".")
]
partition = object_names
print(object_names)

if "global" in partition:
# attempt to replicate behavior of os.listdir (i.e., ignore .zattrs etc.)
Expand Down Expand Up @@ -151,7 +155,7 @@ def read_vis(
INPUT = s3fs.S3Map(root=uri, s3=s3, check=False)
xds_list += [
(
uri.replace(s3_url+"/","").replace("global/", ""),
uri.replace(s3_url + "/", "").replace("global/", ""),
open_zarr(
INPUT,
chunks=chunks,
Expand All @@ -163,6 +167,7 @@ def read_vis(
else:
print(f"Requested partition {part} not found in dataset")
else:
# this case should hit only for single str input (unencased by list) to partition kwarg
uri = "/".join([s3_url, partition])
INPUT = s3fs.S3Map(root=uri, s3=s3, check=False)
xds = open_zarr(
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name='cngi_prototype',
version='0.0.80',
version='0.0.81',
description='CASA Next Generation Infrastructure Prototype',
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit 8ee8b64

Please sign in to comment.