Skip to content

Conversation

@louispt1
Copy link

@louispt1 louispt1 commented Dec 22, 2025

Description

Interpolation runner, methods on Session and Scenario, notebook demonstrating functionality, tests.

Still TODO:

  • Add convenience methods on the collection models that take an array of years and interpolate the scenarios within that set.

@kndehaan I have tagged you as a reviewer here as well, perhaps you can take a quick look at the notebook and method signatures to see if you are happy with the implementation as per the user story etc.

@louispt1 louispt1 marked this pull request as draft December 22, 2025 13:37
@kndehaan
Copy link

kndehaan commented Dec 23, 2025

Looking nice! I was wondering if it was possible to setup the commands in a way as how we discussed. So that a user would only give relevant saved scenarios and the relevant years for interpolation:

scenarios = [saved_2030, saved_2050]
interpolation_years = [2025, 2040]

It feels that in the current notebook, there's more writing required from the user. For example this part:

saved_2040 = saved_2050.interpolate(
    end_year=2040,
    start_scenario=saved_2030,
    title="Demo Interpolated 2040",
    description="Interpolated between conservative and ambitious scenarios"
)

You'd rather have that the user doesn't have to specify the saved_2050.interpolate() here and which start_scenario it should take, but it would be nice if this would be determined automatically from the provided input in scenarios and interpolation_years.

Please let me know if this makes sense. If there's a lot of additional work required to enable this, we should discuss this further.

@kndehaan
Copy link

Looking good so far! You already mentioned that the final notebook will be more minimal. Here are some comments that you can take into account for the final version.

  • Example 2 Two-session interpolation: is done for end year 2041, this should be 2040
  • Example 2 and Example 4 use area_code nl. It would be better to either use nl2019 or nl2023 here, as nl is a very outdated dataset. We don't want to encourage new scenarios being created with this dataset.
  • Input value comparison: including the start year value in the output table would be useful. Other than that, I would not spend to much time on this comparison example as I'm not sure whether the client will use this comparison setup in the notebook. I think they'll rather do comparisons in excel.
  • Example 6, specifically the featured scenario example:
    • Conceptually, I think this example is very useful to the client since I expect that this is how the will want to use the interpolation; providing saved scenario IDs of existing saved scenarios for interpolation (rather than creating new scenarios within the notebook for interpolation). So it would be good to keep this example in the notebook, perhaps even move it up a bit more instead of providing it at the end. I think you could generally rephrase this as using saved (featured) scenarios, since any existing saved scenario ID can be provided here.
    • Content-wise, I feel that the provided example should give an error message or warning. The provided saved scenario IDs [Scenario.load(5135), Scenario.load(5136)] are respectively II3050v2 DEC 2050 and II3050v2 NAT 2050 (at least for me locally); two scenarios with the same end year. The interpolation succeeds and when I look at the results, I think the interpolation is done based on the first saved scenario provided (i.e. id 5135), see for example the results for hydrogen and electricity buses of the interpolated scenarios and the two 2050 scenarios in the final columns:
image

In the interpolation function, I would expect an error or warning message to indicate that two (saved) scenarios with the same end year have been provided, which to my opinion should not have been allowed. Wonder if you agree and if it's easy to build this in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants