Tidy up process input code + make input/input commodities => "other" commodities#629
Merged
Tidy up process input code + make input/input commodities => "other" commodities#629
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR tidies up the process input code by refactoring functions to use a unified ProcessMap, while also transitioning input/output commodities to “other” commodities. Key changes include:
- Removing redundant process ID arguments and simplifying API calls by using ProcessMap in process parameter, flow, and availability reading functions.
- Updating tests and error messages to reflect the new commodity type “Other” and revised function signatures.
- Adjusting the commodity type definitions in commodity.rs and updating the corresponding CSV example.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/input/process/parameter.rs | Refactored to remove process_ids and use ProcessMap |
| src/input/process/flow.rs | Refactored to remove process_ids and adjust error messages |
| src/input/process/availability.rs | Updated parameter list to use ProcessMap and improved error context |
| src/input/process.rs | Consolidated process map handling; updated commodity validations |
| src/commodity.rs | Converted input/output commodity definitions into a single “Other” type |
| examples/simple/commodities.csv | Updated commodity type identifier from ouc to oth |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #629 +/- ##
=======================================
Coverage ? 87.04%
=======================================
Files ? 38
Lines ? 3372
Branches ? 3372
=======================================
Hits ? 2935
Misses ? 250
Partials ? 187 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
I started making the change from input/output commodities to "other" commodities, but realised some of the input code for processes could be tidied up, so did that while I was at it. Hope it's not too annoying that I've mixed these things in one PR.
Cleanups:
Other:
Closes #603. Closes #560. Closes #627.
Type of change
Key checklist
$ cargo test$ cargo docFurther checks