-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add vintage version for multi-year #741
Conversation
@abelsiqueira The time resolution part, for assets/flows/constraints, seems to complain about the type as I mentioned earlier.
I'm a bit lost here, maybe you could see what changes I made lead to these errors? |
src/structures.jl
Outdated
rep_periods_partitions = Dict{Int,Vector{TimestepsBlock}}() | ||
timeframe_profiles = Dict{Int,Dict{String,Vector{Float64}}}() | ||
rep_periods_profiles = Dict{Int,Dict{Tuple{String,Int},Vector{Float64}}}() | ||
timeframe_partitions = Dict{Int,PeriodsBlock}() |
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 haven't looked at the whole code, but I think this should be the following:
timeframe_partitions = Dict{Int,PeriodsBlock}() | |
timeframe_partitions = Dict{Int,Vector{PeriodsBlock}}() |
src/time-resolution.jl
Outdated
end for a in MetaGraphsNext.labels(graph) if asset_filter(a) for | ||
y in active_years[a] for iy in ( | ||
if any(graph[a].investable[iy] for iy in years) | ||
filter(iy -> graph[a].investable[iy], years) | ||
else | ||
[0] | ||
end | ||
) for rp in RP[y] |
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.
Maybe this is the issue with the type.
if any(graph[a].investable[iy] for iy in years) | ||
filter(iy -> graph[a].investable[iy], years) | ||
else | ||
[0] |
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.
[0] | |
[false] |
Trying to translate.
If the graph is investable at any of the years, then loop it over the values of investable
for each year.
Else, loop yi
over [0]
.
This is a problem because you are returning a vector of booleans in the first and a vector of integers in the second.
You can also try:
[0] | |
Bool[] |
Unless you need the single value there.
Also, just try for it in filter(iy -> graph[a].investable[iy], years)
. I think maybe it won't work (and you might have tried already).
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.
Actually I want to return a list of investment years, for which iy
(investment year) can be looped over. So I'm trying to say, if the asset is investable at any of the years, then get the list of years for which the graph[a].investable[iy]
is true.
Else, use a default list of [0], i.e., year 0.
I made some comments on what, I think, is an issue. I also don't like the graph creation, but I have to read it more carefully to suggest something. |
@abelsiqueira The other I still have to try but at least I found the cause of this error
I did not realize the change of schemas in #737 3 days ago, and therefore I'm still using |
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.
@datejada I came across a few things about storage when I was doing this PR, maybe you could double-check? Thanks
LinearAlgebra.dot(sub_df_flows.flow, sub_df_flows.duration) * row_map.weight | ||
end | ||
|
||
if !is_storage_level # got an error here, that's why I modified this condition |
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.
@datejada This condition was if is_storage_level
, which is the same as the previous one, is this intentional or a glitch?
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.
It is not a glitch, but the function is confusing, so we will clean it in the refactor. Thanks for the feedback.
("min_storage_level", row.rep_period), | ||
row.timesteps_block, | ||
0.0, | ||
) * ( | ||
graph[row.asset].initial_storage_capacity + | ||
(row.asset ∈ Ai ? energy_limit[row.asset] : 0.0) |
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.
@datejada I also came across this: the same energy_limit
is used for both max and min constraints?
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 since we use a minimum storage level profile for the min constraint 😄
Replaced by #745 |
Pull request details
Describe the changes made in this pull request
This PR is huge, because it involves change the data structure and the model, which does not make sense if this PR gets separated.
List of related issues or pull requests
Closes #740
Collaboration confirmation
As a contributor I confirm