Skip to content

Commit

Permalink
Add meta data for Settings in REopt.jl for tracking API
Browse files Browse the repository at this point in the history
  • Loading branch information
Bill-Becker committed Feb 4, 2025
1 parent a2091fd commit da16816
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
4 changes: 3 additions & 1 deletion julia_src/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,9 @@ uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"

[[deps.REopt]]
deps = ["ArchGDAL", "CSV", "CoolProp", "DataFrames", "Dates", "DelimitedFiles", "HTTP", "JLD", "JSON", "JuMP", "LinDistFlow", "LinearAlgebra", "Logging", "MathOptInterface", "Requires", "Roots", "Statistics", "TestEnv"]
git-tree-sha1 = "324394f21cb7e2db3d9e7ebde19c4e83c5a64e0f"
git-tree-sha1 = "51f351313ff5c4ce51e5c8cbbf36447997b3e9f2"
repo-rev = "track-api"
repo-url = "https://github.com/NREL/REopt.jl.git"
uuid = "d36ad4e8-d74a-4f7a-ace1-eaea049febf6"
version = "0.50.0"

Expand Down
1 change: 1 addition & 0 deletions reoptjl/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -8237,6 +8237,7 @@ def filter_none_and_empty_array(d:dict):

d = dict()
d["user_uuid"] = meta.user_uuid
d["portfolio_uuid"] = meta.portfolio_uuid
d["api_key"] = meta.api_key
d["Settings"] = filter_none_and_empty_array(meta.Settings.dict)
d["Financial"] = filter_none_and_empty_array(meta.FinancialInputs.dict)
Expand Down
10 changes: 9 additions & 1 deletion reoptjl/src/run_jump_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,15 @@ def run_jump_model(run_uuid):
name = 'run_jump_model'
data = get_input_dict_from_run_uuid(run_uuid)
user_uuid = data.get('user_uuid')

# data['Settings']['name'] = data.get('description', "")
if data.get('webtool_uuid') not in [None, ""]:
data['Settings']['webtool_run'] = True
else:
data['Settings']['direct_api_run'] = True
data['Settings']['webtool_user_uuid'] = user_uuid
data['Settings']['webtool_portfolio_uuid'] = data.get('portfolio_uuid', "")
data['Settings']['api_run_uuid'] = run_uuid
print("data['Settings'] = ", data['Settings'])
data.pop('user_uuid',None) # Remove user uuid from inputs dict to avoid downstream errors

# can uncomment for debugging
Expand Down

0 comments on commit da16816

Please sign in to comment.