Skip to content
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

Select zone from inputs #118

Merged
merged 26 commits into from
Apr 4, 2023
Merged

Select zone from inputs #118

merged 26 commits into from
Apr 4, 2023

Conversation

Betristor
Copy link
Collaborator

Previously we need to create another folder with data to select zone and then create such scenario. With zone selection feature, we could control such behavior in global_model_settings file.

  1. Add zone selection in power inputs selection
  2. Add zone selection in hydrogen inputs selection
  3. Create pipe map and line map in hydrogen pipeline inputs and power inputs using start zone and end zone instaed of matrix

@Betristor Betristor added DOLPHYN structure How DOLPYHN manages sector coupling and model formulation DOLPHYN UX DOLPHYN User Experience enhancement New feature or request Network modelling How networks are modelled in different sectors labels Jan 8, 2023
@Betristor Betristor requested a review from RuaridhMacd January 8, 2023 08:28
@Betristor Betristor self-assigned this Jan 8, 2023
@Betristor
Copy link
Collaborator Author

Pipe map still will have type error if we input zone list in global settings using strings, cause in model part (file h2_pipeline.jl) we need to use Zone column in pipe map to match pipeline flow term. We should discuss how to design this input term and guide user to do like this. Using strings to represent zones is more comfortable for users cause this's meanful.

@RuaridhMacd
Copy link
Collaborator

Hi @Betristor, these look like good additions. I will have time to test them properly on Thursday, so will do the review for this and issue #117 then.

@Betristor
Copy link
Collaborator Author

This branch selects specific zones from global_model_settings.yml file with entry Zones to denote which zones to be modeled. And all zone column should be consistent. Temporarily using string for zones as identifier is tested and verified. Using strings is more readable for users, so I recommend to denote zones with strings.

@Betristor
Copy link
Collaborator Author

@RuaridhMacd Breaking changes include 1. choose zones set from settings (list of string); 2. use start zone and end zone to denote a transmission line or pipeline. This branch doesn't contain modifications in truck route so this should be handled before truck revision.

@RuaridhMacd
Copy link
Collaborator

RuaridhMacd commented Feb 2, 2023

  • Test discontinuous groups of zones, e.g. Zones = [1,3]
  • Make Zones optional, so not including it in global_settings defaults to using Zones = all zones
  • Add warning (@warn) / error() if Zones are not listed sequentially

@Betristor
Copy link
Collaborator Author

@RuaridhMacd I tested a continuous case with Zones = ["z1", "z3"], it worked out.
Then I tested a case with Zones = ["z2", "z1"]. The results are correct in number but wrong in sequence. We need to change the column name when writing outputs to make them match with Zones in global settings. Considering the user experience when zones are selected, I prefer to use strings and use the same list when writing output. So the third task seems not perfect for the code development.
So, instead of add warning for unsequenced input list, I change the correspondence in the writing output part.

@Betristor
Copy link
Collaborator Author

@RuaridhMacd As for the second task, I think based on the current code development, it will cost more convenience to set a default action when zones list is left none. Here are my thoughts and reasons.

  1. Zones are almost surely known to users when a new case is established;
  2. Network and pipeline routes as well as truck routes are to be decided by merely a pair of start zone and end zone to save input trouble for users so that all zones are included in either network.csv or pipelines.csv is not ensured;

But there do exist some other cases where zone set is pretty large and many zones should be included like hundred of zones need to be listed, quite annoying for users, making a "select all" option welcome. But still the zone set need to be known by the model. Previously we construct a matrix containg all zones and is sparse. It's useful when zone set is small, while inconvenient under the assumption that zone set is large.

Regarding all these, I think a "select all" option will be a new feature we need but I may not implement now. (Honestly, I have not come up with a good way to store and access zone list to be compatible with the way Genx took and the way I adopted to construct the spatial matrix.)

@RuaridhMacd
Copy link
Collaborator

Hi @Betristor
Thanks for working through these so quickly.

That looks good for tasks 1 and 3. I'm happy to use strings for the zone names.

It looks like we have more work to do on task 2. I like the idea of having a default action which selects all zones because it avoids issues for users with existing simulations.
Integrating this zone-select feature with GenX will also be tricky if we're moving to using the GenX submodule. Perhaps we should have a discussion / issue with the others working on GenX to hear their opinion on how to implement it.

@Betristor
Copy link
Collaborator Author

@RuaridhMacd Yeah, I. agree with that. I think the main idea we need to discuss is how to design spatial matrix inputs for transmission lines in Genx, pipeline map and truck routes for hydrogen. Based on a widely accepted way of input, we could find out some way to implement zone selection feature with a default action.

Temporarily, I could access zone list from the inputs as a pre-check to save users' trouble when zone list is left none, which means select all zones from the inputs. To filter zones when loading inputs is not only helpful when a subset of zones is needed, but also we could use it as some kind of checks to ensure users' inputs are in match in spatial aspect.

@RuaridhMacd
Copy link
Collaborator

RuaridhMacd commented Feb 13, 2023

  • @Betristor Add basic default behavior to create a Zone list based on the network_data.csv input, if the Zone : [...] setting is missing

@Betristor
Copy link
Collaborator Author

@RuaridhMacd Mac, I enumerated all zones from power transmission lines and hydrogen pipelines to include all zones if no zones entry is provided (no zones entry or empty list). The function is implemented in enumerate_zones.jl.

@RuaridhMacd
Copy link
Collaborator

RuaridhMacd commented Feb 27, 2023

@RuaridhMacd
Copy link
Collaborator

RuaridhMacd commented Apr 3, 2023

Copy link
Collaborator Author

@Betristor Betristor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RuaridhMacd I've reviewed all changes from main, the modifications won't affect existing code. And as the author of this PR, I can't approve it, but I think it's ready to go.

@RuaridhMacd RuaridhMacd merged commit 85617cd into main Apr 4, 2023
@RuaridhMacd
Copy link
Collaborator

Thanks @Betristor . I've just merged it.

@RuaridhMacd RuaridhMacd deleted the zone_selection branch April 4, 2023 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DOLPHYN structure How DOLPYHN manages sector coupling and model formulation DOLPHYN UX DOLPHYN User Experience enhancement New feature or request Network modelling How networks are modelled in different sectors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Select the zone and time data from input data to keep static input files while create multiple scenarios
2 participants