Skip to content

Commit

Permalink
Merge branch 'main' into samw/faster_apply_transform_tables
Browse files Browse the repository at this point in the history
  • Loading branch information
SamRWest committed Mar 11, 2024
2 parents cf60203 + 6e23fb4 commit 6802c7e
Show file tree
Hide file tree
Showing 4 changed files with 147 additions and 50 deletions.
1 change: 1 addition & 0 deletions xl2times/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ def convert_xl_to_times(
transforms.apply_transform_tables,
transforms.apply_final_fixup,
transforms.convert_aliases,
transforms.assign_model_attributes,
transforms.fix_topology,
transforms.resolve_remaining_cgs,
transforms.complete_dictionary,
Expand Down
123 changes: 98 additions & 25 deletions xl2times/config/veda-attr-defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -213,37 +213,47 @@
},
"CEFF": {
"defaults": {
"commodity": [
"other_indexes": [
"commodity",
"commodity-in",
"commodity-out"
"commodity-out",
"commodity-in-aux",
"commodity-out-aux"
],
"ts-level": "ANNUAL"
},
"times-attribute": "ACT_EFF"
},
"CEFF-I": {
"defaults": {
"commodity": [
"commodity-in"
"other_indexes": [
"commodity",
"commodity-in",
"commodity-in-aux"
],
"ts-level": "ANNUAL"
},
"times-attribute": "ACT_EFF"
},
"CEFF-O": {
"defaults": {
"commodity": [
"commodity-out"
"other_indexes": [
"commodity",
"commodity-out",
"commodity-out-aux"
],
"ts-level": "ANNUAL"
},
"times-attribute": "ACT_EFF"
},
"CEFFICIENCY": {
"defaults": {
"commodity": [
"other_indexes": [
"commodity",
"commodity-in",
"commodity-out"
"commodity-out",
"commodity-in-aux",
"commodity-out-aux"
],
"ts-level": "ANNUAL"
},
Expand Down Expand Up @@ -399,7 +409,8 @@
"DELIV": {
"defaults": {
"commodity": [
"commodity-in"
"commodity-in",
"commodity-in-aux"
],
"ts-level": "ANNUAL"
},
Expand Down Expand Up @@ -434,12 +445,18 @@
},
"EFF": {
"defaults": {
"other_indexes": [
"ACT"
],
"ts-level": "ANNUAL"
},
"times-attribute": "ACT_EFF"
},
"EFFICIENCY": {
"defaults": {
"other_indexes": [
"ACT"
],
"ts-level": "ANNUAL"
},
"times-attribute": "ACT_EFF"
Expand All @@ -457,7 +474,12 @@
"defaults": {
"commodity": [
"commodity-out",
"commodity-in"
"commodity-in",
"commodity-out-aux",
"commodity-in-aux"
],
"other_indexes": [
"ACT"
],
"ts-level": "ANNUAL"
},
Expand All @@ -479,7 +501,12 @@
"defaults": {
"commodity": [
"commodity-out",
"commodity-in"
"commodity-in",
"commodity-out-aux",
"commodity-in-aux"
],
"other_indexes": [
"ACT"
],
"ts-level": "ANNUAL"
},
Expand All @@ -501,7 +528,9 @@
"defaults": {
"commodity": [
"commodity-out",
"commodity-in"
"commodity-in",
"commodity-out-aux",
"commodity-in-aux"
],
"ts-level": "ANNUAL"
},
Expand All @@ -510,14 +539,13 @@
"FIXOM": {
"times-attribute": "NCAP_FOM"
},
"FLOP": {
"times-attribute": "VDA_FLOP"
},
"FLOSHAR": {
"defaults": {
"commodity": [
"commodity-in",
"commodity-out"
"commodity-out",
"commodity-in-aux",
"commodity-out-aux"
],
"limtype": "FX",
"ts-level": "ANNUAL"
Expand All @@ -534,7 +562,9 @@
"defaults": {
"commodity": [
"commodity-in",
"commodity-out"
"commodity-out",
"commodity-in-aux",
"commodity-out-aux"
],
"ts-level": "ANNUAL"
}
Expand All @@ -547,7 +577,8 @@
"FLO_DELIV": {
"defaults": {
"commodity": [
"commodity-in"
"commodity-in",
"commodity-in-aux"
],
"ts-level": "ANNUAL"
}
Expand All @@ -556,16 +587,21 @@
"defaults": {
"commodity": [
"commodity-out",
"commodity-in"
"commodity-in",
"commodity-out-aux",
"commodity-in-aux"
],
"ts-level": "ANNUAL"
}
},
"times-attribute": "FLO_EMIS"
},
"FLO_EMIS": {
"defaults": {
"commodity": [
"commodity-out",
"commodity-in"
"commodity-in",
"commodity-out-aux",
"commodity-in-aux"
],
"ts-level": "ANNUAL"
}
Expand All @@ -584,7 +620,9 @@
"defaults": {
"commodity": [
"commodity-in",
"commodity-out"
"commodity-out",
"commodity-in-aux",
"commodity-out-aux"
],
"limtype": "UP"
}
Expand All @@ -593,7 +631,9 @@
"defaults": {
"commodity": [
"commodity-in",
"commodity-out"
"commodity-out",
"commodity-in-aux",
"commodity-out-aux"
],
"limtype": "FX",
"ts-level": "ANNUAL"
Expand All @@ -603,7 +643,9 @@
"defaults": {
"commodity": [
"commodity-out",
"commodity-in"
"commodity-in",
"commodity-out-aux",
"commodity-in-aux"
],
"ts-level": "ANNUAL"
}
Expand All @@ -612,7 +654,9 @@
"defaults": {
"commodity": [
"commodity-out",
"commodity-in"
"commodity-in",
"commodity-out-aux",
"commodity-in-aux"
],
"ts-level": "ANNUAL"
}
Expand Down Expand Up @@ -671,6 +715,17 @@
"ILED": {
"times-attribute": "NCAP_ILED"
},
"INPUT": {
"defaults": {
"other_indexes": [
"commodity",
"commodity-in",
"commodity-in-aux"
],
"ts-level": "ANNUAL"
},
"times-attribute": "VDA_FLOP"
},
"INVCOST": {
"times-attribute": "NCAP_COST"
},
Expand Down Expand Up @@ -765,6 +820,17 @@
"OLIFE": {
"times-attribute": "NCAP_OLIFE"
},
"OUTPUT": {
"defaults": {
"other_indexes": [
"commodity",
"commodity-out",
"commodity-out-aux"
],
"ts-level": "ANNUAL"
},
"times-attribute": "VDA_FLOP"
},
"PASTI": {
"times-attribute": "NCAP_PASTI"
},
Expand Down Expand Up @@ -1055,6 +1121,13 @@
},
"VDA_FLOP": {
"defaults": {
"other_indexes": [
"commodity",
"commodity-in",
"commodity-out",
"commodity-in-aux",
"commodity-out-aux"
],
"ts-level": "ANNUAL"
}
},
Expand Down
6 changes: 6 additions & 0 deletions xl2times/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,7 @@ def _read_veda_attr_defaults(
veda_attr_defaults = {
"aliases": defaultdict(list),
"commodity": {},
"other_indexes": {},
"limtype": {"FX": [], "LO": [], "UP": []},
"tslvl": {"DAYNITE": [], "ANNUAL": []},
}
Expand All @@ -511,6 +512,11 @@ def _read_veda_attr_defaults(
if "commodity" in attr_defaults:
veda_attr_defaults["commodity"][attr] = attr_defaults["commodity"]

if "other_indexes" in attr_defaults:
veda_attr_defaults["other_indexes"][attr] = attr_defaults[
"other_indexes"
]

if "limtype" in attr_defaults:
limtype = attr_defaults["limtype"]
veda_attr_defaults["limtype"][limtype].append(attr)
Expand Down
Loading

0 comments on commit 6802c7e

Please sign in to comment.