Skip to content
Snippets Groups Projects
Commit e7dbaa22 authored by Fabian Wachsmann's avatar Fabian Wachsmann
Browse files

Debugged some infos

parent 983d76da
No related branches found
No related tags found
No related merge requests found
...@@ -114,6 +114,11 @@ class Tzis: ...@@ -114,6 +114,11 @@ class Tzis:
# raise ValueError("Dataset '{0}' must either be a string or a list of strings") # raise ValueError("Dataset '{0}' must either be a string or a list of strings")
if mf: if mf:
if self.verbose:
print("Resetting disk size and compression ratio")
self._disk_size=None
self._cratio=None
if type(mf) == str: if type(mf) == str:
mf = [mf] mf = [mf]
...@@ -132,7 +137,9 @@ class Tzis: ...@@ -132,7 +137,9 @@ class Tzis:
else: else:
self.provenance.gen_input("input_file_name", mf) self.provenance.gen_input("input_file_name", mf)
self._disk_size=sum([os.path.getsize(mf_input) if not any([os.path.isfile(mf_input) == False
for mf_input in mf]) :
self._disk_size=sum([os.path.getsize(mf_input)
for mf_input in mf] for mf_input in mf]
) )
...@@ -378,7 +385,20 @@ class Tzis: ...@@ -378,7 +385,20 @@ class Tzis:
if not a == c or l_differ: if not a == c or l_differ:
if self.verbose: if self.verbose:
notinc=[key for key in a.keys()
if key not in c.keys()]
notina=[key for key in c.keys()
if key not in a.keys()]
print("Attributes of cloud store and source dataset differ.") print("Attributes of cloud store and source dataset differ.")
if notina:
print(f"Attribute not in source: {','.join(notinc)}")
if notinc:
print(f"Attribute not in cloud: {','.join(notina)}")
if not notina and not notinc:
for key in list(set(a.keys(),c.keys())):
if a[key] != c[key]:
print(f"Values of attribute {key} differ:")
print(f"source: {c[key]} cloud: {a[key]} ")
return True return True
for coord in already.coords: for coord in already.coords:
...@@ -831,10 +851,12 @@ class Tzis: ...@@ -831,10 +851,12 @@ class Tzis:
f" which is {self.varname}") f" which is {self.varname}")
dset_to_write = self.mf_dset[[self.varname]] dset_to_write = self.mf_dset[[self.varname]]
totalsize=dset_to_write.nbytes/1024/1024/1024 totalsize=dset_to_write.nbytes
if self._disk_size and not self._cratio: if self._disk_size and not self._cratio:
self._cratio=self._disk_size/totalsize self._cratio=self._disk_size/totalsize
if self.verbose:
print(f"Could determine compression ratio by disk size: {self._cratio}")
if "chunks" in dset_to_write[self.varname].encoding.keys(): if "chunks" in dset_to_write[self.varname].encoding.keys():
del dset_to_write[self.varname].encoding["chunks"] del dset_to_write[self.varname].encoding["chunks"]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment