Skip to content

Commit 1e06e84

Browse files
committed
tweak correct JASMIN S3 path
1 parent 9170653 commit 1e06e84

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

activestorage/active.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,10 @@ def load_from_s3(uri):
4040
# client_kwargs={'endpoint_url': S3_URL}) # eg "http://localhost:9000" for Minio
4141
fs = s3fs.S3FileSystem(anon=True,
4242
client_kwargs={'endpoint_url': "https://" + S3_URL})
43-
print("S3 file URI:", uri)
44-
with fs.open(uri, 'rb') as s3file:
43+
print("Complete S3 file URI:", uri)
44+
clip_uri = os.path.join(S3_BUCKET, os.path.basename(uri))
45+
print("JASMIN S3-specific uri:", clip_uri)
46+
with fs.open(clip_uri, 'rb') as s3file:
4547
ds = h5netcdf.File(s3file, 'r', invalid_netcdf=True)
4648
print(f"Dataset loaded from S3 via h5netcdf: {ds}")
4749
yield ds

0 commit comments

Comments
 (0)