-
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
Jd/parameter update fixes #1013
Merged
+715
−516
Merged
Changes from 44 commits
Commits
Show all changes
125 commits
Select commit
Hold shift + click to select a range
be930e8
add fix for resolution mismatches
jd-lara 6762934
add fix for resolution mismatches
jd-lara b1339e3
Merge branch 'jd/parameter_update_fixes' of https://github.com/NREL-S…
jd-lara 6e661bb
fix t_step calc
jd-lara 731f0b1
allow 3D datasets
jd-lara 64509f4
fix get_columns
jd-lara 36c1d4f
add method for 1 d data set
jd-lara e3ecbfd
fix return
jd-lara b23c108
fix results processing
jd-lara 318d9fc
fix results testing
jd-lara cde7af7
update hdf debug for 3 dims
rodrigomha 33b270c
Merge branch 'jd/parameter_update_fixes' of https://github.com/NREL-S…
rodrigomha c061ec6
support 3D HDFD dataset
jd-lara 7ad9adf
fix dims count
jd-lara 26ce135
fix to dims
jd-lara bf7c6a3
use max
jd-lara d9b65a3
force permute order
rodrigomha 6936835
fix results
jd-lara 32c0759
remove subcomp set param val
rodrigomha 7263ecc
formatter
jd-lara 9335564
Merge branch 'jd/parameter_update_fixes' of https://github.com/NREL-S…
jd-lara c5ca8c2
add missing method
jd-lara 404d165
update tests
jd-lara 8197b8c
formatter
jd-lara 22d3e72
add min_res
jd-lara ecf9a0a
add code to store 3D in HDF
jd-lara ba4e377
fixes to run
jd-lara 5e83cfb
fix columns call
jd-lara 8c4e109
formatter
jd-lara 194d72a
fix passing of key
jd-lara 9a06de3
add logging
jd-lara 723ee76
move logger
jd-lara 761bad1
remove @error
jd-lara c7c9e01
add logging
jd-lara fadf8f7
add method for results deserialize
jd-lara acd5f6e
remove FF code
jd-lara b878bdf
remove constraints code
jd-lara edd5080
remove additional params
rodrigomha cb179a2
remove upd parameter limit FF
rodrigomha 7590ef3
Update adding_new_problem_model.md
pitmonticone 4171ab1
Update quick_start_guide.md
pitmonticone 9e46190
Update debugging_infeasible_models.md
pitmonticone b91cbcd
Update README.md
pitmonticone 5ccf75a
Update definitions.jl
pitmonticone c50eca2
Update formulations.jl
pitmonticone 47c9d40
Update powermodels_interface.jl
pitmonticone 1b65aa5
Update decision_problems.jl
pitmonticone ab7fbfc
Update operation_problem_templates.jl
pitmonticone e4522fd
Update agc.jl
pitmonticone 9cf92cd
Update reserve_group.jl
pitmonticone fff7151
Merge pull request #1015 from pitmonticone/master
jd-lara 1cad58c
enable 3D dataframes
jd-lara 7da3309
add missing methods
jd-lara 6f304e0
add comment to the code about the use of dims
jd-lara eb8de6f
remove unnecessary assertions
jd-lara 00b2134
add missing variable in function
jd-lara a21d9bc
fix tests
jd-lara c8b1388
add comment
jd-lara 3ebd3d3
add vector defs
jd-lara 66c04c0
Merge pull request #1014 from NREL-Sienna/jd/move_energy_limit_ff_out
jd-lara c19a60d
Update Project.toml
jd-lara 8cb2bae
fix read results interface
jd-lara 1d149fc
remove stale code
jd-lara 4010e16
Merge pull request #1016 from NREL-Sienna/jd/fix_tests
jd-lara 026e5bc
Update Project.toml
jd-lara de326b5
add meta field to ff parameter getter
jd-lara 960fe8e
Merge pull request #1017 from NREL-Sienna/jd/fix_fixedvalue_ff_bug
jd-lara c1b9007
Update Project.toml
jd-lara aefa549
Update Project.toml
jd-lara 1ef8e6f
add missing compats
jd-lara 6f1eb69
fix sha version
jd-lara 29ff39f
fix compats
jd-lara 6dfcc11
afc/changes to consider ac branche in FixValueFeedForward
alefcastelli 06525f5
Update src/devices_models/devices/AC_branches.jl
jd-lara 712532b
Merge pull request #1019 from NREL-Sienna/afc/FixValueFeedForward-for…
jd-lara fce8884
remove not needed comments
jd-lara 03e2764
remove bad check
jd-lara 6039d27
formatter
jd-lara d3c29ee
re-enable threads
jd-lara 3552fb0
add fix for resolution mismatches
jd-lara 3b31244
fix t_step calc
jd-lara be854a1
allow 3D datasets
jd-lara 5f9589c
fix get_columns
jd-lara 0febf07
add method for 1 d data set
jd-lara 39e012e
fix return
jd-lara ddd6f27
fix results processing
jd-lara 97c60e2
update hdf debug for 3 dims
rodrigomha ed29e5c
fix results testing
jd-lara bdff35f
support 3D HDFD dataset
jd-lara 4cfab76
fix dims count
jd-lara 420c6d3
fix to dims
jd-lara 34254fc
use max
jd-lara ea9d639
force permute order
rodrigomha caa018f
fix results
jd-lara b9f3f10
formatter
jd-lara 24ec546
remove subcomp set param val
rodrigomha f6e67a7
add missing method
jd-lara 1fa2f9f
update tests
jd-lara f2e57ce
formatter
jd-lara 1691a94
add min_res
jd-lara 11d3777
add code to store 3D in HDF
jd-lara ea64d4f
fixes to run
jd-lara 2eb8c38
fix columns call
jd-lara d3fe841
formatter
jd-lara 456e717
fix passing of key
jd-lara 01d42b7
add logging
jd-lara 49b7366
move logger
jd-lara 739350a
remove @error
jd-lara 18a6362
add logging
jd-lara ef5a6f9
add method for results deserialize
jd-lara a6926ad
enable 3D dataframes
jd-lara 616cc35
add missing methods
jd-lara 28cce32
add comment to the code about the use of dims
jd-lara cbbfe61
remove unnecessary assertions
jd-lara 3302cc1
add missing variable in function
jd-lara 439f7b2
fix tests
jd-lara b41fda7
add comment
jd-lara 84bb449
add vector defs
jd-lara dc6c53a
fix read results interface
jd-lara ede6147
remove not needed comments
jd-lara 73178c3
remove bad check
jd-lara 31e1afc
formatter
jd-lara 901ec14
re-enable threads
jd-lara 0da8a4e
Merge branch 'jd/parameter_update_fixes' of https://github.com/NREL-S…
jd-lara ffd6238
fix pretty table issue
jd-lara File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,53 @@ | ||
mutable struct ResultsByTime{T} | ||
mutable struct ResultsByTime{T, N} | ||
key::OptimizationContainerKey | ||
data::SortedDict{Dates.DateTime, T} | ||
resolution::Dates.Period | ||
column_names::Vector{String} | ||
column_names::NTuple{N, Vector{String}} | ||
end | ||
|
||
function ResultsByTime(key, data, resolution, column_names) | ||
function ResultsByTime( | ||
key::OptimizationContainerKey, | ||
data::SortedDict{Dates.DateTime, T}, | ||
resolution::Dates.Period, | ||
column_names, | ||
) where {T} | ||
_check_column_consistency(data, column_names) | ||
ResultsByTime(key, data, resolution, column_names) | ||
end | ||
|
||
function _check_column_consistency( | ||
data::SortedDict{Dates.DateTime, DenseAxisArray{Float64, 2}}, | ||
cols::Vector{String}, | ||
cols::Tuple{Vector{String}}, | ||
) | ||
for val in values(data) | ||
if axes(val)[1] != cols | ||
if axes(val)[1] != cols[1] | ||
error("Mismatch in DenseAxisArray column names: $(axes(val)[1]) $cols") | ||
end | ||
end | ||
end | ||
|
||
function _check_column_consistency( | ||
data::SortedDict{Dates.DateTime, Matrix{Float64}}, | ||
cols::Vector{String}, | ||
cols::Tuple{Vector{String}}, | ||
) | ||
for val in values(data) | ||
if size(val)[2] != length(cols) | ||
error("Mismatch in length of Matrix columns: $(size(val)[2]) $(length(cols))") | ||
if size(val)[2] != length(cols[1]) | ||
error( | ||
"Mismatch in length of Matrix columns: $(size(val)[2]) $(length(cols[1]))", | ||
) | ||
end | ||
end | ||
end | ||
|
||
function _check_column_consistency( | ||
data::SortedDict{Dates.DateTime, DenseAxisArray{Float64, 2}}, | ||
cols::NTuple{N, Vector{String}}, | ||
) where {N} | ||
# TODO: | ||
end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to check something? |
||
|
||
# TODO: Implement consistency check for other sizes | ||
|
||
# This struct behaves like a dict, delegating to its 'data' field. | ||
Base.length(res::ResultsByTime) = length(res.data) | ||
Base.iterate(res::ResultsByTime) = iterate(res.data) | ||
|
@@ -73,6 +89,19 @@ function make_dataframe( | |
return df | ||
end | ||
|
||
function make_dataframe( | ||
results::ResultsByTime{DenseAxisArray{Float64, 3}}, | ||
timestamp::Dates.DateTime, | ||
) | ||
df = DataFrames.DataFrame() | ||
array = results.data[timestamp] | ||
for idx in Iterators.product(array.axes[1:2]...) | ||
df[!, "$(idx)"] = array[idx..., :].data | ||
end | ||
# _add_timestamps!(df, results, timestamp, array) | ||
return df | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TODO? |
||
end | ||
|
||
function make_dataframe(results::ResultsByTime{Matrix{Float64}}, timestamp::Dates.DateTime) | ||
array = results.data[timestamp] | ||
df = DataFrames.DataFrame(array, results.column_names) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 check could be common.