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

Introduce regions filtering #161

Merged
merged 3 commits into from
Jan 16, 2024
Merged

Introduce regions filtering #161

merged 3 commits into from
Jan 16, 2024

Conversation

olejandro
Copy link
Member

No description provided.

xl2times/datatypes.py Outdated Show resolved Hide resolved
xl2times/transforms.py Show resolved Hide resolved
@Antti-L
Copy link

Antti-L commented Jan 16, 2024

We have the ~BookRegions_Map in SysSettings, with columns BookName and Region. VEDA will define only those regions that 1) have an existing Excel workbook file included (given by the BookName) and 2) which are also selected in the model RUN as internal regions (SET REG). All other regions should be only defined as external regions (SET ALL_REG). I wonder if the first condition is taken into account already? I guess it is the second condition (Regions selected for a model run) that is being referred to as filtering here?

@olejandro
Copy link
Member Author

@Antti-L, yes that the intention of this PR.

@Antti-L
Copy link

Antti-L commented Jan 16, 2024

@Antti-L, yes that the intention of this PR.

But which that? I had two questions, do you mean the second question? How about the first one?

@olejandro
Copy link
Member Author

Regarding external regions, we currently add IMPEXP and MINRNW to ALL_REG. Is there anything else we should be adding?

@Antti-L
Copy link

Antti-L commented Jan 16, 2024

Regarding external regions, we currently add IMPEXP and MINRNW to ALL_REG. Is there anything else we should be adding?

Yes, absolutely! Like I said, all the Regions in the ~BookRegions_Map, including all those that are not internal regions (i.e. do not have an Excel workbook included).

@olejandro

This comment was marked as outdated.

@olejandro
Copy link
Member Author

...including all those that are not internal regions (i.e. do not have an Excel workbook included).

Could you clarify this a little bit more? Currently all regions on the ~BookRegions_Map list are included in REG and also in ALL_REG. They are internal regions. Where would one find a list of external regions?

@Antti-L
Copy link

Antti-L commented Jan 16, 2024

  1. is done already, while this PR adds posibility to select regions that should be included in the resulting dd files.

Just to confirm, are you sure: In times_mapping, I can see REG[REG,TEXT] = ~BookRegions_Map(Region,Region). But only a subset of those Regions should be REG, and the rest only in ALL_REG. As I explained, only those regions that do have an Excel workbook (with its name having BookName) should be in the SET REG, and all others must be only external regions.

@olejandro
Copy link
Member Author

Just to confirm, are you sure: In times_mapping, I can see REG[REG,TEXT] = ~BookRegions_Map(Region,Region). But only a subset of those Regions should be REG, and the rest only in ALL_REG.

How is the subset determined? I am asking, because several internal regions may be present in a workbook (i.e. internal regions may not have a dedicated workbook).

@Antti-L
Copy link

Antti-L commented Jan 16, 2024

How is the subset determined? I am asking, because several internal regions may be present in a workbook (i.e. internal regions may not have a dedicated workbook).

Surely all internal regions have a dedicated workbook (identified by BookName). And those that do not have, should be only external regions. It works like that in VEDA, and I am using this distinction in my models.

@olejandro
Copy link
Member Author

olejandro commented Jan 16, 2024

I think an example would be helpful here: in this file on the Region Definition sheet, would you classify any region in the Region column as external?

@olejandro
Copy link
Member Author

@Antti-L, n the example above, would inserting a row above row 5 and specifying a value in column Region without specifying a value in column BookName make that region external?

@Antti-L
Copy link

Antti-L commented Jan 16, 2024

I think a example would be helpful here: in [this file]{https://github.com/esma-cgep/TIM/blob/main/SysSettings.xlsx) on the Region Definition sheet, would you classify any region in the Region column as external?

By looking at that SysSettings.xlsx, one can see that all regions under ~BookRegions_Map have IE as the BookName. Therefore, either all those regions are internal regions, or all of those regions are external. One cannot tell which they are, without seeing the contents of the model folder: Does it contain a Workbook with the name VT_IE_*.xlsx or not? That would give you the answer. All regions that do not have a corresponding workbook must be defined external.

@olejandro
Copy link
Member Author

@Antti-L I've opened a separate issue (#162) to address user-defined external regions.

@olejandro olejandro merged commit b0a55cf into main Jan 16, 2024
1 check passed
@olejandro olejandro deleted the olex/filter-regions branch January 16, 2024 15:42
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