-
Notifications
You must be signed in to change notification settings - Fork 4
Add commodity constraints input and validation #1487
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
Merged
tsmbland
merged 15 commits into
main
from
add-commodity-constraints-input-and-validation
Aug 27, 2026
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
17a888e
Add commodity constraint file reading and validation
dc2917 89fa150
Add schema for commodity constraints input file
dc2917 efbc8e4
Corrections to commodity constraint handling
dc2917 328243d
Add tests for creating commodity constraints
dc2917 03f77ef
Prevent SVD commodities from having commodity constraints
dc2917 24ff422
Remove examples/simple/commodity_constraints.csv
dc2917 4c3f350
State valid balance type options
dc2917 310d9ad
Add notes for time_slice field
dc2917 56a8eaa
Improve top-level schema description
dc2917 1b1897f
Improve commodity and commodity ID extraction
dc2917 b31ff9c
Tidy up csv creation strings with macro
dc2917 14066fe
Remove unused region_id argument in validation tests
dc2917 632d9ef
Fix duplicate time slice
dc2917 9ec63c4
Construct s with constraints
dc2917 3363674
Use valid time slices in test
dc2917 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| $schema: https://specs.frictionlessdata.io/schemas/table-schema.json | ||
| description: | | ||
| Specifies the limits on the total amount of consumption/production of a given | ||
| commodity in a given region, year and time slice(s). | ||
|
|
||
| fields: | ||
| - name: commodity_id | ||
| type: string | ||
| description: The commodity to which this constraint applies | ||
| - name: region_id | ||
| type: string | ||
| description: The region in which this constraint applies | ||
| - name: balance_type | ||
| type: string | ||
| description: The type of balance to which this is applied | ||
| notes: | ||
| Valid options are "cons" and "prod"; the "net" option is not valid here, as net | ||
| production is already constrained by the commodity balance constraints. | ||
| - name: years | ||
| type: string | ||
| description: The year(s) to which this entry applies | ||
| - name: time_slice | ||
| type: string | ||
| description: The time slice(s) to which this entry applies | ||
| notes: | | ||
| Can be a single time slice (e.g. `winter.day`), a whole season (e.g. `winter`) or `annual`, | ||
| representing the whole year | ||
| - name: limits | ||
| type: string | ||
| description: Lower and upper limits on the value of the commodity | ||
| notes: | ||
| A string in the format `min..max`, where `min` and `max` are decimal numbers | ||
| (e.g. "0.12..78.9"). Either `min` or `max` can be omitted (e.g "0.12.." or | ||
| "..78.9"), which will set the corresponding limit to 0 or infinite, respectively. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.