-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DB Parser #19
DB Parser #19
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rudimentary parser takes in the db first design successful
type = "" | ||
|
||
# Check if the timestamps are within the hours of the day | ||
is_within_hours = all(row -> parse(Int, split(row["timestamp"], "-")[end]) in 1:24, eachrow(df)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
is_within_hours = all(row -> parse(Int, split(row["timestamp"], "-")[end]) in 1:24, eachrow(df)) | |
is_within_hours = | |
all(row -> parse(Int, split(row["timestamp"], "-")[end]) in 1:24, eachrow(df)) |
end | ||
|
||
return unique(xy_values) | ||
end | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
|
||
function parse_heatrate_to_array(json_str::String) | ||
xy_vector = parse_json_to_arrays(json_str) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
if length(unique(getfield.(xy_vector, :x))) < 2 | ||
return 0.0 | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
return InputOutputCurve(function_data=PiecewiseLinearData(points=xy_vector)) | ||
end | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
down_time=op_data[!, "downtime"][1], | ||
heat_rate_mmbtu_per_mwh=heat_rate_piecewise_lin, | ||
co2=co2_value, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
if row["fuel_type"] == "Solar" || row["fuel_type"] == "Wind" | ||
# Put in time series for the solar and Wind | ||
eaid = row["unit_id"] | ||
ts_index = filter("entity_id" => isequal(eaid), df_dict["entities"])[!, "entity_id"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
ts_index = filter("entity_id" => isequal(eaid), df_dict["entities"])[!, "entity_id"] | |
ts_index = | |
filter("entity_id" => isequal(eaid), df_dict["entities"])[!, "entity_id"] |
dates = DateTime("2020-01-01T00:00:00"):Hour(1):DateTime("2020-12-31T23:00:00") | ||
demand = ts_parsed[2] | ||
# ts_index = filter("entity_id" => isequal(eaid), df_dict["entities"])[!, "entity_id"] | ||
ts_index = filter(row -> row["entity_id"] == eaid && row["entity_type"] == "demand_requirements", df_dict["entities"])[!, "entity_id"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
ts_index = filter(row -> row["entity_id"] == eaid && row["entity_type"] == "demand_requirements", df_dict["entities"])[!, "entity_id"] | |
ts_index = filter( | |
row -> | |
row["entity_id"] == eaid && row["entity_type"] == "demand_requirements", | |
df_dict["entities"], | |
)[ | |
!, | |
"entity_id", | |
] |
|
||
# Parsing the timestamps into Dates | ||
timestamps = DateTime.(ts[!, :timestamp], "yyyy-m-d-H") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
@@ -559,12 +725,11 @@ | |||
|
|||
tx = TransportTechnology{Branch}(; | |||
name=string(rownumber(row)), | |||
network_lines=rownumber(row), | |||
network_id = rownumber(row), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
network_id = rownumber(row), | |
network_id=rownumber(row), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merging pipeline into update fields
No description provided.