Comments (4)
I guess we will quickly run into a use case like "give me primary energy, final energy, CO2 emissions, GDP, ..." from an upstream-repo, so repeating the "name" attribute many time will be tedious. So I would say the following logic makes most sense:
- OR within a filter-dimension if it's a list
- AND across filter-dimensions within one filters-list items
- OR across filters-list items
from nomenclature.
This looks great, but I'm wondering about two issues.
- Wouldn't be more intuitive to have the filters as an attribute of the repository, instead of repeating the repository-attribute many times?
- Not clear whether the list of filters would work as AND or OR...?
See a more explicit
definitions:
variable:
repository:
common-definitions:
filters:
- name: Primary Energy*
tier: 1
- name: Final Energy*
to get all final-energy variables and only primary-energy-variables at tier 1.
from nomenclature.
Good points.
Regarding your first point, you're right, it does look better to me as well. The reason I did intentionally opt against it in my proposed structure is that this would require bigger changes to the code. Nothing crazy but more difficult to implement than just adding another attribute at the repository level. I do agree though that it's nicer that way.
For your second point, I'd take your example exactly the way you suggested. Meaning that within a filter entry it's an AND and between filters it's an OR.
One point that's remaining is to cover is if we allow lists as filter values, and if so how they're evaluated:
definitions:
variable:
repository:
common-definitions:
filters:
- name: Primary Energy*
tier: [1, 2]
i.e. would the above translate to: "Everything that starts with Primary Energy* and has the tier attribute [1, 2]" or "Everything that starts with Primary Energy* and has the tier attribute 1 or 2". In this example only the latter makes sense but there might be attributes where we actually want to match a list.
Alternatively, we could also only allow for single values, so if you wanted to achieve the above you'd have to use:
definitions:
variable:
repository:
common-definitions:
filters:
- name: Primary Energy*
tier: 1
- name: Primary Energy*
tier: 2
in this example we could even allow for list values but then they have to match exactly.
from nomenclature.
Sounds good, that should cover what we need. I cannot think of a use case where we'd need to explicitly match for a list anyway.
from nomenclature.
Related Issues (20)
- Add units for unknown variables so they can be copied directly into the variable template
- Remove the warning of missing model mapping HOT 2
- Automate region descriptions from Excel to YAML HOT 1
- Windows tests failing due to matplotlib error HOT 3
- Add ruff to nomenclature
- Windows tests currently (Aug 29 2024) broken HOT 1
- Model registration template does not contain the "ISO3" code for Kosovo HOT 3
- Add link to project template to errors for unknown values (regions, variables, ...)
- ErrorCollection for countries-validation
- Testing does not actually test if DataStructureDefinition can be instantiated
- Testing might not be compatible anymore with NomenclatureConfig
- Add exclude filter for external repos
- Tag substitution does not work across imported definitions HOT 2
- Check that tags occur in variable names
- Check if data contains inf values
- Add NUTS to docs
- `countries` attribute doesn't allow for single country string input
- Clean up the test data folder
- Check for forbidden characters in attributes
- Use all attributes in tag-list
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.