334 locational eligibility based on operation rates#513
Draft
334 locational eligibility based on operation rates#513
Conversation
Collaborator
|
closes #133 |
Collaborator
|
@lovinduw can you check this comment i made last time? #133 (comment) |
…gibility-based-on-operation-rates
…ional-eligibility-based-on-operation-rates
…ional-eligibility-based-on-operation-rates
JohannesBehrens
requested changes
Jan 22, 2026
Collaborator
JohannesBehrens
left a comment
There was a problem hiding this comment.
Does this code update include code to set loc elig to 0 when operation rate max is 0 for all time steps/ investment periods?
| name="transmission", | ||
| commodity="energy", | ||
| operationRateMax=operationRateMax, | ||
| ) |
Collaborator
There was a problem hiding this comment.
Please add assertion statements to make sure the test works as intended
| index.append(loc) | ||
| data_.append(data[loc]) | ||
| data_ = pd.Series(data_, index=index) | ||
| data_.sort_index(inplace=True) |
Collaborator
There was a problem hiding this comment.
This code looks like it would simply ignore data, which is zero? Doesn't this result in Nones which are ignored later?
Collaborator
There was a problem hiding this comment.
This becomes a problem when we want to set for example operationRateMax = 0. If this is ignored the operation would not be constrained
Collaborator
Author
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

When looking into the issue we identified that Transmission capacity min/max/fix or operation min/max/fix can be submitted as Dataframes or as Dataseries. These values are pre-processed in the preprocess2dimData function in Utils. During this pre-processing, if these values are in Dataframe format, only the locations which has a value > 0 are considered. But, if they are in Series format, all the values are considered including 0s. If locationEligibility is not set by the user in the beginning, it will be automatically set such that only the locations which has a value > 0 for capacity min/max/fix or operation min/max/fix are considered as eligible. Later, this locationEligibility is checked with the locations in the processed capacity min/max/fix or operation min/max/fix data and the process fails if they are not the same.
Therefore, if the inputs (capacity min/max/fix) are in Series format with some values 0, this creates error. To avoid this, we added new lines to Utils in preprocess2dimData function and now it only considers values greater than 0 for Series as well (similar to Dataframes) if the LocationEligibility is not set at the beginning.