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

make geometric work again #1236

Merged
merged 1 commit into from
Feb 6, 2025
Merged

make geometric work again #1236

merged 1 commit into from
Feb 6, 2025

Conversation

m-bossart
Copy link

For parallel testing on larger system

@m-bossart m-bossart merged commit 408cbe5 into jd/outages Feb 6, 2025
3 of 8 checks passed
@m-bossart m-bossart deleted the mb/works-for-geometric branch February 6, 2025 17:41
@@ -248,7 +248,7 @@ function update_decision_state!(
return
end

function _get_time_to_recover(event::PSY.GeometricDistributionForcedOutage)
function _get_time_to_recover(event::PSY.GeometricDistributionForcedOutage, simulation_time, length)
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
function _get_time_to_recover(event::PSY.GeometricDistributionForcedOutage, simulation_time, length)
function _get_time_to_recover(
event::PSY.GeometricDistributionForcedOutage,
simulation_time,
length,
)

len = state_length,
)
return # do the math on the vals difference
next_outage_start = findfirst(isequal(1.0), vals)
next_outage_length = findfirst(isequal(0.0), vals[next_outage_start:end]) - 1
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
next_outage_length = findfirst(isequal(0.0), vals[next_outage_start:end]) - 1
next_outage_length = findfirst(isequal(0.0), vals[next_outage_start:end]) - 1

Comment on lines +305 to +306
state_length = length(state_timestamps) - state_data_index
mttr = _get_time_to_recover(event, simulation_time, state_length)
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
state_length = length(state_timestamps) - state_data_index
mttr = _get_time_to_recover(event, simulation_time, state_length)
state_length = length(state_timestamps) - state_data_index
mttr = _get_time_to_recover(event, simulation_time, state_length)

off_time_step_count =
Int(mttr) * resolution_ratio + rem(state_data_index, resolution_ratio) #TODO -check if just removing (-1) is correct.
Int(mttr) * resolution_ratio + rem(state_data_index, resolution_ratio)
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
Int(mttr) * resolution_ratio + rem(state_data_index, resolution_ratio)
Int(mttr) * resolution_ratio + rem(state_data_index, resolution_ratio)

@@ -567,7 +568,7 @@
return
end

function _get_outage_ocurrence(event::PSY.GeometricDistributionForcedOutage, rng)
function _get_outage_ocurrence(event::PSY.GeometricDistributionForcedOutage, rng, current_time)
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
function _get_outage_ocurrence(event::PSY.GeometricDistributionForcedOutage, rng, current_time)
function _get_outage_ocurrence(
event::PSY.GeometricDistributionForcedOutage,
rng,
current_time,
)

@@ -623,7 +624,7 @@
state::SimulationState,
key::VariableKey{T, U},
column_names::Set{String},
::PSY.GeometricDistributionForcedOutage,
::PSY.Outage,
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
::PSY.Outage,
::PSY.Outage,

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.

1 participant