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

new debug logging, fix logic #1230

Merged
merged 1 commit into from
Jan 30, 2025
Merged

new debug logging, fix logic #1230

merged 1 commit into from
Jan 30, 2025

Conversation

jd-lara
Copy link
Member

@jd-lara jd-lara commented Jan 30, 2025

No description provided.

@jd-lara jd-lara merged commit 1c0eaf9 into jd/outages Jan 30, 2025
4 of 8 checks passed
@jd-lara jd-lara deleted the mb/debug-outages branch January 30, 2025 06:32
@@ -290,6 +293,7 @@ function update_decision_state!(
@error "update $name to come back online after $off_time_step_count"
end
end
@warn "AvailableStatusChangeParameter decision state after update: $state_data"
Copy link
Contributor

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
@warn "AvailableStatusChangeParameter decision state after update: $state_data"
@warn "AvailableStatusChangeParameter decision state after update: $state_data"

@@ -304,7 +308,8 @@ function update_decision_state!(
) where {T <: PSY.Component}
event_ocurrence_data = get_decision_state_data(state, AvailableStatusChangeParameter(), T)
Copy link
Contributor

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
event_ocurrence_data = get_decision_state_data(state, AvailableStatusChangeParameter(), T)
event_ocurrence_data =
get_decision_state_data(state, AvailableStatusChangeParameter(), T)

Comment on lines +335 to +337
while true
state_data.values[name, outage_index] = 0.0
if (event_ocurrence_data.values[name, outage_index] == 1.0) || outage_index == length(state_data.values[name, :]) #If another change is detected or you have reached the end of the state
Copy link
Contributor

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
while true
state_data.values[name, outage_index] = 0.0
if (event_ocurrence_data.values[name, outage_index] == 1.0) || outage_index == length(state_data.values[name, :]) #If another change is detected or you have reached the end of the state
while true
state_data.values[name, outage_index] = 0.0
if (event_ocurrence_data.values[name, outage_index] == 1.0) ||
outage_index == length(state_data.values[name, :]) #If another change is detected or you have reached the end of the state

state_data.values[name, outage_index] = 0.0
if (event_ocurrence_data.values[name, outage_index] == 1.0) || outage_index == length(state_data.values[name, :]) #If another change is detected or you have reached the end of the state
break
end
Copy link
Contributor

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
end
end

Comment on lines 354 to +357
set_last_recorded_row!(state_data, state_range[end])
state_data_index += resolution_ratio
end
=#
end =#
@warn "AvailableStatusParameter decision state after update: $state_data"
Copy link
Contributor

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
set_last_recorded_row!(state_data, state_range[end])
state_data_index += resolution_ratio
end
=#
end =#
@warn "AvailableStatusParameter decision state after update: $state_data"
end
#= offset = resolution_ratio - 1
result_time_index = axes(store_data)[2]
set_update_timestamp!(state_data, simulation_time)
for t in result_time_index
state_range = state_data_index:(state_data_index + offset)
for name in column_names, i in state_range
state_data.values[name, i] = store_data[name, t]
end
set_last_recorded_row!(state_data, state_range[end])
state_data_index += resolution_ratio
end =#
@warn "AvailableStatusParameter decision state after update: $state_data"

@@ -525,27 +545,20 @@ function update_system_state!(
simulation_time::Dates.DateTime,
rng,
) where T <: PSY.Device
Copy link
Contributor

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
) where T <: PSY.Device
) where {T <: PSY.Device}

Comment on lines +551 to +552
available_status_change_parameter = get_system_state_data(state, AvailableStatusChangeParameter(), T)
available_status_change_parameter_values = get_last_recorded_value(available_status_change_parameter)
Copy link
Contributor

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
available_status_change_parameter = get_system_state_data(state, AvailableStatusChangeParameter(), T)
available_status_change_parameter_values = get_last_recorded_value(available_status_change_parameter)
available_status_change_parameter =
get_system_state_data(state, AvailableStatusChangeParameter(), T)
available_status_change_parameter_values =
get_last_recorded_value(available_status_change_parameter)

for name in column_names_
current_status = available_status_parameter_values[name]
current_status_change = available_status_change_parameter_values[name]
if current_status == 1.0 && current_status_change == 1.0
Copy link
Contributor

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 current_status == 1.0 && current_status_change == 1.0
if current_status == 1.0 && current_status_change == 1.0

Comment on lines +559 to 561
available_status_parameter.values[name, 1] = 0.0
end
end
Copy link
Contributor

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
available_status_parameter.values[name, 1] = 0.0
end
end
available_status_parameter.values[name, 1] = 0.0
end
end

@error "Changed status for $name, $outage_ocurrence"
else
@warn "$name status $current_status, outage draw: $outage_ocurrence"
available_status_change_parameter.values[name, 1] = outage_ocurrence
Copy link
Contributor

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
available_status_change_parameter.values[name, 1] = outage_ocurrence
available_status_change_parameter.values[name, 1] = outage_ocurrence

Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

end
end
end
#= offset = resolution_ratio - 1
result_time_index = axes(store_data)[2]
set_update_timestamp!(state_data, simulation_time)
for t in result_time_index
state_range = state_data_index:(state_data_index + offset)
for name in column_names, i in state_range
state_data.values[name, i] = store_data[name, t]

Copy link
Contributor

Performance Results

Version Precompile Time
Main 5.904398353
This Branch 6.239450005
Version Build Time
Main-Build Time Precompile 66.475876507
Main-Build Time Postcompile 0.802019058
This Branch-Build Time Precompile 66.355946703
This Branch-Build Time Postcompile 1.133280459
Version Solve Time
Main-Solve Time Precompile 613.651086753
Main-Solve Time Postcompile 582.693458614
This Branch-Solve Time Precompile 408.44144922
This Branch-Solve Time Postcompile 368.371604704

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