-
Notifications
You must be signed in to change notification settings - Fork 249
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
Sweep across multiple weather years #204
Conversation
Leap years! Set as early as Option A: Ignore/cut leap day. def cut_leap_days(n):
if not n.snapshots.is_leap_year.any(): return
snapshots = pd.DatetimeIndex([sn for sn in n.snapshots if (sn.month != 2) | (sn.day != 29)])
n.set_snapshots(snapshots)
n.snapshot_weightings[:] = 8760/len(n.snapshots) Option B: Accept lower snapshot weightings (e.g. 2.99 instead of 3.0). [EDIT: but for option B need to consider that we fall back to non-leap years for load and hydro total annual generation, also in leap years data on Feb 29 might be missing (e.g. load)] |
|
I am quite happy with the removal of the Thanks, @koen-vg, for the transition to scenario management. It was very fast and easy to implement, and it saved a lot of time!
The
Yes, that's the plan, but for a separate PR.
Yes, that's a feature I would also want, but I would propose this for a separate PR after this one (just to keep the changes somewhat digestible). It requires a rule to merge cutouts, but I think you already implemented this in https://github.com/aleks-g/intersecting-near-opt-spaces/, right? In the scripts, there shouldn't be too many hurdles as far as I can see. I know of one I built on purpose for now in |
for more information, see https://pre-commit.ci
Thanks, glad to know that I could help a little!
Yes, this looks nice to me; if the scenario system is used anyway to select the weather year, then it seems very sensible to use it also to select the correct cutout for the solar thermal etc. cutouts instead of adding extra complexity in input functions. One could always think about streamlining these things but I 100% agree that these "nice-to-have"s should be left for future PRs.
Yes, the merging of cutouts was quite simple, see https://github.com/koen-vg/pypsa-eur/blob/7ea264f2744a8bd165f9301f23dfc0e2c4b86c6a/scripts/build_renewable_profiles.py#L220-L224 (from the pypsa-eur commit included in the repo you linked). It's a bit quirky that we found we had to supply a filename to the atlite.Cutout constructor and used a named temporary file for this, but it should never be written to. Maybe there is a better way, but it did work fine. I can see if I have any time going forward to open a PR for this. The approach I've used before is to write an input function for the relevant rules (mainly I'm looking forward to seeing this merged; I definitely agree it makes sense to get the basic functionality merged at first and worry about additional features in later PRs. I'll be using the multiyear functionality quite actively in the next couple of months and I'll be sure to nail down and fix any potential issues I find on the way. Thanks so much for the amazing work! |
only after looming around for 3.5 years (Oct 20, 2020) ;) |
Closes #200 .
Changes proposed in this Pull Request
How To Use
Run
create_scenarios.py
to build ascenarios.yaml
with the following snippet for the template:Future PRs