Skip to content

Commit

Permalink
handle case where diskless_write is not in kwargs (e.g. from pysurfex… (
Browse files Browse the repository at this point in the history
#43)

* handle case where diskless_write is not in kwargs (e.g. from pysurfex-experiment)

* format with the proper black
  • Loading branch information
asmundb authored Aug 21, 2024
1 parent a05989c commit 310a861
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pysurfex/forcing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Forcing."""

import abc
import copy
import json
Expand Down Expand Up @@ -764,6 +765,7 @@ def set_forcing_config(**kwargs):
co2 = "default"
co2_converter = "none"

diskless_write = False
analysis = False
interpolation = None
try:
Expand All @@ -772,7 +774,6 @@ def set_forcing_config(**kwargs):
input_format = kwargs["input_format"]
output_format = kwargs["output_format"]
outfile = kwargs["of"]
diskless_write = kwargs["diskless_write"]
zref = kwargs["zref"]
uref = kwargs["uref"]
config = kwargs["config"]
Expand Down Expand Up @@ -848,6 +849,8 @@ def set_forcing_config(**kwargs):
co2 = kwargs["co2"]
if "co2_converter" in kwargs:
co2_converter = kwargs["co2_converter"]
if "diskless_write" in kwargs:
diskless_write = kwargs["diskless_write"]

except ValueError:
raise Exception("Needed input is missing") from ValueError
Expand Down

0 comments on commit 310a861

Please sign in to comment.