-
Notifications
You must be signed in to change notification settings - Fork 56
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
Replace parameterized type variables #1012
Conversation
get_available_components(T, sys, get_attribute(model, "filter_function")) | ||
add_parameters!(container, ActivePowerTimeSeriesParameter, devices, model) | ||
get_available_components(T, sys, get_attribute(device_model, "filter_function")) | ||
add_parameters!(container, ActivePowerTimeSeriesParameter, devices, device_model) |
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.
This was an existing bug because model
was not defined. Please confirm the fix.
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.
This is a bug
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.
I made some comments that need to be implemented across. Particularly the use of get_network_formulation
src/devices_models/device_constructors/hvdcsystems_constructor.jl
Outdated
Show resolved
Hide resolved
D <: AbstractThermalDispatchFormulation, | ||
S <: PM.AbstractActivePowerModel, | ||
} | ||
model::DeviceModel{T, <:AbstractThermalDispatchFormulation}, |
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.
Changes to DeviceModel were not required. However, since these type variables were not used, I removed them.
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.
That's ok
container, | ||
devices, | ||
device_model, | ||
typeof(network_model).parameters[1], |
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.
This was an existing bug because S
was not defined. Please confirm the change.
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.
This is correct. We probably should extend the tests to cover this area of the code
D <: AbstractThermalDispatchFormulation, | ||
S <: PM.AbstractActivePowerModel, | ||
} | ||
model::DeviceModel{T, <:AbstractThermalDispatchFormulation}, |
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.
That's ok
container, | ||
devices, | ||
device_model, | ||
get_network_formulation(network_model) |
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 🐶
get_network_formulation(network_model) | |
get_network_formulation(network_model), |
e7b38ae
to
4b23a31
Compare
This change allows SnoopCompile.jl to generate precompile statements. For a reason unknown as of now, SnoopCompile.jl generates invalid statements for PowerModels.AbstractPowerModel and PowerModels.AbstractActivePowerModel when type variables are used.
4b23a31
to
0eacd45
Compare
Performance Results
|
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1012 +/- ##
==========================================
- Coverage 79.94% 79.94% -0.01%
==========================================
Files 116 116
Lines 12338 12337 -1
==========================================
- Hits 9864 9863 -1
Misses 2474 2474
Flags with carried forward coverage won't be shown. Click here to find out more.
|
This PR allows SnoopCompile.jl to generate precompile statements for PowerSimulations.jl. In many cases I removed unused parameterized type variables. In other cases they were being used and I replaced uses with
typeof(x)
. There should not be any functional or performance difference.If this change is approved, I can move forward with integrating SnoopCompile.jl with this package in a separate branch. The only other realistic alternative is to report an issue with SnoopCompile.jl and see if they can help.