Skip to content

Commit

Permalink
small fixes for V4r4 checkpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
DuncanBark committed Aug 15, 2022
1 parent cb38de4 commit 4f5aa56
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion aws/configs/created_jobs.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[0,'latlon','AVG_MON',[15, 16, 17, 18, 19]]
[15,'native','AVG_MON',12]
2 changes: 1 addition & 1 deletion aws/configs/jobs.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#grouping_to_process,product_type,output_frequency,num_time_steps_to_process

[0,'latlon','AVG_MON',[15, 16, 17, 18, 19]]
10,latlon,AVG_MON,12
done

[0,'latlon','AVG_MON',[15, 16, 17, 18, 19]]
Expand Down
15 changes: 9 additions & 6 deletions aws/src/ecco_v4_py/ecco_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,17 @@ def add_global_metadata(metadata, G, dataset_dim, less_output=True):
# if we do add the field, we have to convert to the
# appropriate data type
if add_field == True:
if mtype == 's':
if isinstance(mc['value'], str) and 'TBD_' in mc['value']:
G.attrs[mname] = mc['value']
elif mtype == 'f':
G.attrs[mname] = float(mc['value'])
elif mtype == 'i':
G.attrs[mname] = np.int32(mc['value'])
else:
print('INVALID MTYPE ! ', mtype)
if mtype == 's':
G.attrs[mname] = mc['value']
elif mtype == 'f':
G.attrs[mname] = float(mc['value'])
elif mtype == 'i':
G.attrs[mname] = np.int32(mc['value'])
else:
print('INVALID MTYPE ! ', mtype)
# else:
# print('\t> not adding ', mc)

Expand Down
2 changes: 1 addition & 1 deletion aws/src/utils/jobs_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from collections import defaultdict

# Local imports
main_path = Path(__file__).parent.parent.resolve()
main_path = Path(__file__).parent.parent.parent.resolve()
sys.path.append(f'{main_path / "src"}')
sys.path.append(f'{main_path / "src" / "utils"}')
import file_utils as file_utils
Expand Down

0 comments on commit 4f5aa56

Please sign in to comment.