Skip to content

Commit

Permalink
Merge pull request #188 from Deltares/fix/GEOLIB-217-result-serialize…
Browse files Browse the repository at this point in the history
…r-issue-dstability

Fix/geolib 217 result serializer issue dstability
  • Loading branch information
wfaustmann authored Jul 26, 2024
2 parents e4f8f66 + de1df14 commit d07e708
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ requests.egg-info/
*.pyc
*.swp
*.egg
.env/
env/
.venv/
venv/
Expand Down
5 changes: 4 additions & 1 deletion geolib/models/dgeoflow/serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,10 @@ def write(self, filepath: Union[FilePath, BytesIO]) -> Union[FilePath, BytesIO]:
if isinstance(data, dict):
folder = filename
for ffilename, fdata in data.items():
fn = folder + "/" + ffilename
if folder[-1] == "/":
fn = folder + ffilename
else:
fn = folder + "/" + ffilename
with zip.open(fn, "w") as io:
io.write(fdata.encode("utf-8"))
else:
Expand Down
5 changes: 4 additions & 1 deletion geolib/models/dstability/serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,10 @@ def write(self, filepath: Union[FilePath, BytesIO]) -> Union[FilePath, BytesIO]:
if isinstance(data, dict):
folder = filename
for ffilename, fdata in data.items():
fn = folder + "/" + ffilename
if folder[-1] == "/":
fn = folder + ffilename
else:
fn = folder + "/" + ffilename
with zip.open(fn, "w") as io:
io.write(fdata.encode("utf-8"))
else:
Expand Down

0 comments on commit d07e708

Please sign in to comment.