Skip to content

Commit 407d12c

Browse files
committed
bug correction
1 parent 77a7eb5 commit 407d12c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/py_eddy_tracker/observations/observation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ def load_from_zarr(cls, filename, remove_vars=None, include_vars=None):
429429
if var_inv not in cls.ELEMENTS and var_inv not in array_variables:
430430
kwargs["track_extra_variables"].append(var_inv)
431431
kwargs["raw_data"] = False
432-
kwargs["only_variables"] = [VAR_DESCR_inv[i] for i in include_vars]
432+
kwargs["only_variables"] = None if include_vars is None else [VAR_DESCR_inv[i] for i in include_vars]
433433
eddies = cls(size=nb_obs, **kwargs)
434434
for variable in var_list:
435435
var_inv = VAR_DESCR_inv[variable]
@@ -503,7 +503,7 @@ def load_from_netcdf(cls, filename, raw_data=False, remove_vars=None, include_va
503503
if var_inv not in cls.ELEMENTS and var_inv not in array_variables:
504504
kwargs["track_extra_variables"].append(var_inv)
505505
kwargs["raw_data"] = raw_data
506-
kwargs["only_variables"] = [VAR_DESCR_inv[i] for i in include_vars]
506+
kwargs["only_variables"] = None if include_vars is None else [VAR_DESCR_inv[i] for i in include_vars]
507507
eddies = cls(size=nb_obs, **kwargs)
508508
for variable in var_list:
509509
var_inv = VAR_DESCR_inv[variable]
@@ -1134,7 +1134,7 @@ def global_attr(self):
11341134

11351135
def set_global_attr_zarr(self, h_zarr):
11361136
for key, item in self.global_attr.items():
1137-
h_zarr.attrs[key] = item
1137+
h_zarr.attrs[key] = str(item)
11381138

11391139
def set_global_attr_netcdf(self, h_nc):
11401140
for key, item in self.global_attr.items():

src/scripts/EddyTranslate

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def id_parser():
1717

1818

1919
def is_nc(filename):
20-
return args.filename_in.endswith('.nc')
20+
return filename.endswith('.nc')
2121

2222

2323
def get_variable_name(filename):
@@ -26,7 +26,7 @@ def get_variable_name(filename):
2626
return h.variables.keys()
2727
else:
2828
h = zarr.open(filename)
29-
return list(h.keys())
29+
return list(h.keys())
3030

3131

3232
def get_variable(filename, varname):

0 commit comments

Comments
 (0)