Skip to content

Commit

Permalink
fix naming
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanLaserGit committed Sep 30, 2024
1 parent 9f02a8a commit 67bea3c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
8 changes: 4 additions & 4 deletions forcingprocessor/src/forcingprocessor/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -931,9 +931,9 @@ def prep_ngen_data(conf):

metadata_df = pd.DataFrame.from_dict(metadata)
if storage_type == 's3':
bucket, key = convert_url2key(output_path,forcing_path)
bucket, key = convert_url2key(output_path,storage_type)

meta_path = f"{key}/metadata/forcings_metadata/"
meta_path = f"{key}metadata/forcings_metadata/"
buf = BytesIO()
if "parquet" in output_file_type:
filename = f"metadata.parquet"
Expand Down Expand Up @@ -994,8 +994,8 @@ def prep_ngen_data(conf):
log_time("TAR_END", log_file)

if storage_type == "s3":
bucket, key = convert_url2key(metaf_path,forcing_path)
log_path = key + '/profile_fp.txt'
bucket, key = convert_url2key(metaf_path,storage_type)
log_path = key + 'profile_fp.txt'
s3.upload_file(
f'./profile_fp.txt',
bucket,
Expand Down
7 changes: 1 addition & 6 deletions forcingprocessor/src/forcingprocessor/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,7 @@ def convert_url2key(nwm_file,fs_type):
_nc_file_parts = nwm_file.split('/')
layers = _nc_file_parts[3:]
for jlay in layers:
bucket_key += "/" + jlay
bucket_key += jlay + "/"

if fs_type == 's3':
bucket_key = _nc_file_parts[2][:-17] + bucket_key
elif fs_type == 'google':
bucket_key = "gs:/" + bucket_key
if "s3://" in nwm_file: bucket_key = bucket_key[1:]
bucket = _nc_file_parts[2]
return bucket, bucket_key
1 change: 0 additions & 1 deletion forcingprocessor/tests/test_hf2ds.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from forcingprocessor.weights_hf2ds import hf2ds
from pathlib import Path
import os
import pandas as pd

HF_VERSION="v2.1.1"
test_dir = Path(__file__).parent
Expand Down

0 comments on commit 67bea3c

Please sign in to comment.