Skip to content

Commit

Permalink
Merge pull request #35 from NREL/fix_undefined_values_in_run_site
Browse files Browse the repository at this point in the history
Fix undefined values in run site
  • Loading branch information
anyaelena authored Jun 30, 2022
2 parents 741948a + bdd283b commit a8b589b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
24 changes: 12 additions & 12 deletions alfalfa_client/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,22 +174,22 @@ def start_one(args):

mutation = 'mutation { runSite(siteRef: "%s"' % site_id

if "timescale" in kwargs:
mutation = mutation + ', timescale: %s' % kwargs["timescale"]
mutation = mutation + ', timescale: %s' % kwargs.get("timescale", 5)

if "start_datetime" in kwargs:
mutation = mutation + ', startDatetime: "%s"' % kwargs["start_datetime"]
if "end_datetime" in kwargs:
mutation = mutation + ', endDatetime: "%s"' % kwargs["end_datetime"]
if "realtime" in kwargs:
mutation = mutation + ', realtime: %s' % kwargs["realtime"]
if "external_clock" in kwargs:
# check if external_clock is bool, if so then convert to
# downcase string
v = kwargs["external_clock"]
if isinstance(v, bool):
v = 'true' if v else 'false'

mutation = mutation + ', externalClock: %s' % v.lower()

mutation = mutation + ', realtime: %s' % kwargs.get("realtime", "false")

# check if external_clock is bool, if so then convert to
# downcase string
v = kwargs.get("external_clock", "false")
if isinstance(v, bool):
v = 'true' if v else 'false'

mutation = mutation + ', externalClock: %s' % v.lower()

mutation = mutation + ') }'

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "alfalfa-client"
version = "0.3.0"
version = "0.3.1"
description = "A standalone client for the NREL Alfalfa application"
authors = [
'Kyle Benne <kyle.benne@nrel.gov>',
Expand Down

0 comments on commit a8b589b

Please sign in to comment.