-
Notifications
You must be signed in to change notification settings - Fork 136
Revision/simplify indexes #1158
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
base: dev
Are you sure you want to change the base?
Conversation
This is an attempt to remove redundancies from the c'tor signature.
Systems with storage do not build at the moment. Results cannot be processed.
Optimisation using aggregated time should now work using the tsam.TimeSeriesAggregation object as the time index. To be adjusted (not working): * GenericStorage * result processing * ...
The new name reflects what it is. (The name "invest" was often read if it were the investment costs.)
These periods do not exist anymore.
It doesn't make sense to adjust everything (esp. result processing) for the deletion of the old multi-period feature just to have to adjust it again when introducing the new one. Thus, there is a placeholder (one period hard-coded).
At the moment, it is single period.
First asigning processed results to a variable before accessing the relevant information allows to see the results while debugging.
In the multi-period model, it will not really be an added capacity, so the old name might just stay as well.
* :math:`Y_{invest}(p)` | ||
|
||
Binary variable for the status of the investment, if | ||
:attr:`nonconvex` is `True`. | ||
""" | ||
m = self.parent_block() | ||
|
||
def _investvar_bound_rule(block, i, o, p): | ||
def _investvar_bound_rule(_, i, o, p): |
Check notice
Code scanning / CodeQL
Explicit returns mixed with implicit (fall through) returns Note
* :math:`Y_{invest}(p)` | ||
|
||
Binary variable for the status of the investment, if | ||
:attr:`nonconvex` is `True`. | ||
""" | ||
m = self.parent_block() | ||
|
||
def _investvar_bound_rule(block, i, o, p): | ||
def _investvar_bound_rule(_, i, o, p): |
Check notice
Code scanning / CodeQL
Unused local variable Note
Processing expects the key "scalars" to be set. There is no reason we have to break the API here.
Optimises but results processing does not work, yet. (It's also unclear if results are correct.)
Name was present twice which caused problems.
|
||
def _inter_storage_balance_rule(block, n, i): | ||
""" | ||
Rule definition for the storage balance of every storage n and | ||
every timestep. | ||
""" | ||
ii = 0 | ||
for p in m.PERIODS: | ||
ii += len(m.es.tsa_parameters[p]["order"]) | ||
for p in m.CAPACITY_PERIODS: |
Check failure
Code scanning / CodeQL
Suspicious unused loop iteration variable Error
These are no unit tests but integration test following the structure of example scripts. Collecting the examples using pytest fails, so they need to go.
The info was redundant, so the need to give it should be removed.
Casting collections.Counter to a list will lead to the keys being stored instead of the values. This eventually results in wrong tsam_weights (0 for single period).
Period/step is easier to stistinguish than inter/intra.
Simplify indexes in the TSAM compatible version (esp. removing the current multi-period investment).