Skip to content
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

Merged
merged 21 commits into from
Dec 30, 2024
Merged

DB Parser #19

merged 21 commits into from
Dec 30, 2024

Conversation

jerrypotts
Copy link
Contributor

No description provided.

Copy link
Collaborator

@prao7 prao7 left a 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))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
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


Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change


function parse_heatrate_to_array(json_str::String)
xy_vector = parse_json_to_arrays(json_str)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change

if length(unique(getfield.(xy_vector, :x))) < 2
return 0.0
end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change

return InputOutputCurve(function_data=PiecewiseLinearData(points=xy_vector))
end


Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change

down_time=op_data[!, "downtime"][1],
heat_rate_mmbtu_per_mwh=heat_rate_piecewise_lin,
co2=co2_value,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change

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"]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
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"]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
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")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change

@@ -559,12 +725,11 @@

tx = TransportTechnology{Branch}(;
name=string(rownumber(row)),
network_lines=rownumber(row),
network_id = rownumber(row),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
network_id = rownumber(row),
network_id=rownumber(row),

Copy link
Collaborator

@prao7 prao7 left a 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

@prao7 prao7 merged commit 80716f6 into jp/update_fields Dec 30, 2024
0 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants