Skip to content

Commit 5043a94

Browse files
committed
Use bullet point list for notes
1 parent c98ddd3 commit 5043a94

13 files changed

Lines changed: 59 additions & 42 deletions

docs/generate_input_format_doc.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def load_file(path: Path) -> File:
6363
name = f"{path.stem}.csv"
6464
desc = add_full_stop(data["description"])
6565
if note := data.get("notes", None):
66-
note = add_full_stop(note)
66+
note = format_notes(note)
6767
return File(name, desc, table, note)
6868

6969

@@ -91,6 +91,18 @@ def fields2table(fields: list[dict[str, str]]) -> tuple[str, str | None]:
9191
return table
9292

9393

94+
def format_notes(notes) -> str:
95+
if isinstance(notes, list):
96+
items = [add_full_stop(item) for item in notes]
97+
elif isinstance(notes, str):
98+
items = [add_full_stop(notes)]
99+
else:
100+
items = []
101+
if not items:
102+
return ""
103+
return "\n".join(f"- {item}" for item in items)
104+
105+
94106
if __name__ == "__main__":
95107
output_path = _DOCS_DIR / "input_format.md"
96108
output_path.write_text(generate_markdown(), encoding="utf-8")

schemas/input/agent_commodity_portions.yaml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
description: |
22
Portions of commodity demand for which agents are responsible.
33
4-
notes: |
5-
If an entry is specified for one agent and commodity, there must be entries covering all milestone
6-
years. For each agent listed in this file, the total portions for each region/commodity/year
7-
combination must sum to one. In addition, there must be entries for every SVD and SED commodity
8-
for all regions and milestone years.
4+
notes:
5+
- If an entry is specified for one agent and commodity, there must be entries covering all
6+
milestone years.
7+
- For each agent listed in this file, the total portions for each region/commodity/year
8+
combination must sum to one.
9+
- In addition, there must be entries for every SVD and SED commodity for all regions and
10+
milestone years.
911

1012
fields:
1113
- name: agent_id

schemas/input/agent_cost_limits.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
description: |
22
Limits on expenditure for agents.
33
4-
notes: |
5-
If cost limits are provided for an agent, they must be present for all years.
4+
notes:
5+
- If cost limits are provided for an agent, they must be present for all years.
66

77
fields:
88
- name: agent_id

schemas/input/agent_objectives.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
description: |
22
Describes the agents' objectives.
33
4-
notes: |
5-
Every agent must have one objective for each milestone year. If the weighted sum decision rule is
6-
in use, the `decision_weight` value must be provided, otherwise it must be omitted. If the lexico
7-
decision rule is in use, the `decision_lexico_order` value must be provided, otherwise it must be
8-
omitted.
4+
notes:
5+
- Every agent must have one objective for each milestone year.
6+
- If the weighted sum decision rule is in use, the `decision_weight` value must be provided,
7+
otherwise it must be omitted.
8+
- If the lexico decision rule is in use, the `decision_lexico_order` value must be provided,
9+
otherwise it must be omitted.
910

1011
fields:
1112
- name: agent_id

schemas/input/agent_search_space.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
description: |
22
Defines the processes in which an agent will invest for given parameters.
33
4-
notes: |
5-
If entries are missing for any combination of agent, commodity or milestone year, then it is
6-
assumed that all processes can be considered in this case.
4+
notes:
5+
- If entries are missing for any combination of agent, commodity or milestone year, then it is
6+
assumed that all processes can be considered in this case.
77

88
fields:
99
- name: agent_id

schemas/input/commodities.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
description: |
22
Describes commodities in the system.
33
4-
notes: |
5-
Every SED (supply equals demand) commodity must have both producer and consumer processes for
6-
every region and milestone year. Every SVD (service demand) commodity must have a producer for
7-
every region and milestone year.
4+
notes:
5+
- Every SED (supply equals demand) commodity must have both producer and consumer processes for
6+
every region and milestone year.
7+
- Every SVD (service demand) commodity must have a producer for every region and milestone year.
88

99
fields:
1010
- name: id

schemas/input/commodity_levies.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
description: |
22
Defines levies for commodities (or, if `value` is negative, incentives).
33
4-
notes: |
5-
If an entry is included for a given combination of commodity and region, entries must be provided
6-
covering all milestone years and time slices.
4+
notes:
5+
- If an entry is included for a given combination of commodity and region, entries must be
6+
provided covering all milestone years and time slices.
77

88
fields:
99
- name: commodity_id

schemas/input/demand.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
description: |
22
Specifies the demand for service demand commodities.
33
4-
notes: Every service demand commodity must have entries in this file covering every combination of
5-
milestone year and region
4+
notes:
5+
- Every service demand commodity must have entries in this file covering every combination of
6+
milestone year and region
67

78
fields:
89
- name: commodity_id

schemas/input/demand_slicing.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
description: |
22
Specifies how demand is distributed throughout the year (i.e. for different milestones).
33
4-
notes: |
5-
The user must provide entries covering every combination of service demand commodity, region and
6-
time slice. For each combination, the sum of the fractions must equal one.
4+
notes:
5+
- The user must provide entries covering every combination of service demand commodity, region
6+
and time slice.
7+
- For each combination, the sum of the fractions must equal one.
78

89
fields:
910
- name: commodity_id

schemas/input/process_availabilities.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
description: |
22
Defines how much of a process's capacity is available throughout the year.
33
4-
notes: |
5-
Must be provided for every process.
6-
Only one type of limit can be supplied for each combination of process/region/year/time slice.
4+
notes:
5+
- Must be provided for every process.
6+
- Only one type of limit can be supplied for each combination of process/region/year/time slice.
77

88
fields:
99
- name: process_id

0 commit comments

Comments
 (0)