Comments (9)
Ah yes, agree it should be at the same level as native_regions
. I would prefer exclude_regions
.
from nomenclature.
That is a difficult design decision, as you said there are cases to be made for both options.
The crux of the decision lies in my opinion in the fact that there are two possible root causes for additional regions:
- They are somehow model internal debug/test regions which are not intended for upload but exported as results anyway. (If such a use case exists)
- A region that is intended to be uploaded bu was forgotten in the model mapping.
In the first case we (and the user for that matter) would probably prefer just a warning.
In the second case an error should be raised as that would cause unexpected behavior with regions missing.
Now the problem is that there is no way for us to distinguish between 1. and 2. (at least none that I can think of quickly).
So we're stuck between forcing users to clean up their output before uploading it or potentially missing regions from a scenario explorer.
My personal (although not strong) preference would be to throw an error but I don't know how often cases 1. or 2. occur.
from nomenclature.
Good points. I would say have a common way for variables, scenarios, and regions.
Right now, it seems variables and scenarios that are "unexpected" cause an error. So by that rule error also for regions would make sense.
Overall, and from a user experience, I think on the other hand in all three cases it might be preferable to have warnings instead. These errors are easy to see in the log file, and one can then decide if it would be good to fix the issue or one is OK with what has been accepted by the script.
from nomenclature.
Having a common expextable behaviour for regions, variables and scenarios as Johannes suggest sounds very sensable.
I tend to prefer getting an error message. Then I'm sure that I know that something went different then I might have expected. However, in our scripts that bring the results into IAMC format it is rather easy to exclude e.g. variables that I don't want to upload. But I also see that it might be reasonable to just give a warning, e.g. that I have a country or a region in the results that I do not yet have in the region mapping but might not want to add yet.
from nomenclature.
One more option (slightly more involved though but maybe worth considering), would be to raise an error for unexpected regions unless they are specified as exclude in the model mapping, something like this:
model: model_a
native_regions:
- region_a
- region_b
- exclude:
- diagnostic_region
The difference would be that the presence of diagnostic_region would initially cause an error which would prompt the user to either remove it from the upload or add it to the exclude
section. Once it is in the exclude
section it could not prompt anything or simply an INFO level log entry "excluding region diagnostic_region".
If at some point regions are unexpectedly missing from an upload it should be easy to go to the model mapping and look at the exclude
section.
If this is not a good way to go I would still prefer raising an error, keeping consistency with the approach for regions, variables and scenarios.
In my opinion it's better to cause a little bit of an overhead of removing results than to have potentially missing results without any errors. I agree with @danielhuppmann that if an upload is successful it is very unlikely that a user will actually go back and search the log file for potential warnings. In the spirit of "better safe than sorry" I would vote in favor of the error.
from nomenclature.
Sounds like a good approach to me, but I would add this as a section at the same level as native_regions
and common_regions
. Maybe called exclude_regions
or ignore_regions
...?
from nomenclature.
@danielhuppmann as I'm looking into the implementation I've thought of the following case and was wondering how to handle that.
Assuming we have a model that reports "World" level data and we want to make use of partial region aggregation, we put "World" on the category common_regions
(instead of native_regions
).
If we now add "World" to exclude_regions
what should happen? Should we raise an error since a region cannot be in common_regions
and exclude_regions
or should this just mean that model native results are ignored and World is created with only results region aggregation?
Another case would be having "World" in both native_regions
as well as exclude_regions
but there I would say the case is pretty clear cut and we throw an error.
from nomenclature.
I would say that any region name can only one of
- a (target) name of the
native-region
OR - a
common-region
OR - an
exclude-region
raising an error if a region is in more than one group.
I would keep the current behavior:
- native-regions: keep (with rename)
- common-regions: keep as reported if region exists, otherwise compute aggregate (and compare for info purposes)
from nomenclature.
Perfect, fully agree. Anything else would not be intuitive and lead to unexpected results.
I'll implement it that way.
from nomenclature.
Related Issues (20)
- Align Processor structure HOT 2
- Use different name for ISO3-code attribute
- Improve required data output
- pydantic 2.0 breaks nomenclature
- General options for a DataStructureDefinition HOT 3
- Enable using model mappings from external repository
- Implement MetaCodeList-validation using pandera
- Get relative path fails if file is not part of current working directory
- nomenclature install from GitHub fails exclude tests HOT 1
- Refactor and extend RequiredDataValidator HOT 2
- Invalid regions do not raise an error as part of RegionProcessor
- General-config fails if folder is not present
- country names HOT 2
- Potential conflicts with overlapping region-aggregation instructions
- Upgrade to use latest pydantic HOT 1
- Allow wildcard variables HOT 1
- Mix multiple external repos in a single dimension
- Nightly tests fail to run
- CLI is gone in v0.13.0 release
- Explicit CLI check does not work on Windows as part of GH action
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nomenclature.