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

Unify meta/settings files (e.g. times_mapping.txt and times-info.json) #105

Open
siddharth-krishna opened this issue Aug 13, 2023 · 3 comments

Comments

@siddharth-krishna
Copy link
Collaborator

Here's a proposal for how the combined mapping/category file could look. For the mapping G_DRATE[REG,DATAYEAR,CUR,VALUE] = ~FI_T(Region,Year,Curr,VALUE,Attribute:G_DRATE), we could have the entry:

- name: G_DRATE
  category: parameter
  times-cols:
    - REG
    - DATAYEAR
    - CUR
    - VALUE
  xl-cols:
    - Region
    - Year
    - Curr
    - VALUE
  filter-attribute: G_DRATE

Alternatively, in JSON format (though perhaps YAML is a bit more readable? YAML also allows comments)

[
  {
    "name": "G_DRATE",
    "category": "parameter",
    "times-cols": [
      "REG",
      "DATAYEAR",
      "CUR",
      "VALUE"
    ],
    "xl-cols": [
      "Region",
      "Year",
      "Curr",
      "VALUE"
    ],
    "filter-attribute": "G_DRATE"
  }
]

A benefit of having a unified file is that it is less likely that an entity will be in one and not another, a bug that we've seen e.g. in:
#102 (comment) (cc @olejandro )

@olejandro
Copy link
Member

olejandro commented Aug 14, 2023

Ideally time-info should already have priority over the mapping file, i.e. we should only use the mapping file for the entities present in it. But let's not do anything about it yet, until we are clear on the way forward?

@olejandro
Copy link
Member

@siddharth-krishna let's start by utilising time-info where it is straightforward to do so already? E.g. we can already use it to specify a list of legal attribute names (UC_*) in process_user_constraint_tables.

@siddharth-krishna
Copy link
Collaborator Author

We should also consider using the TOML format, which many Python projects have been adopting as a replacement for JSON and YAML files: https://realpython.com/python-toml/

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

No branches or pull requests

2 participants