Read in commodities as `Rc<Commodity>`s directly
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 42/100
Research direction
Start by locating the code that reads commodities and the conversion from IndexMap<CommodityID, Commodity> to CommodityMap. Check whether Rc::make_mut supports the required field assignments, then update the loading path so commodities are read directly as Rcs and verify the existing project checks.
Written by the indexing model from the issue text.
Description
Annoyingly, when we initially read in the commodities they're stored in an IndexMap<CommodityID, Commodity> then we turn it into an IndexMap<CommodityID, Rc<Commodity>> (i.e. a CommodityMap), otherwise I would have just used a CommodityMap.
I think I did this because I was under the impression that you couldn't really modify Rc things easily (and we need to do that to assign various fields to the commodities), but it looks like there is this function that does what we need: https://doc.rust-lang.org/std/rc/struct.Rc.html#method.make_mut
Originally posted by @alexdewar in https://github.com/EnergySystemsModellingLab/MUSE_2.0/pull/599#discussion_r2128775599
- Dominant language
- Rust
- Stars
- 8
- Forks
- 5
- Avg merge
- 11h 31m
- Merged PRs (30d)
- 33
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from EnergySystemsModellingLab/MUSE2
-
bug documentation
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
EnergySystemsModellingLab/MUSE2#1367 · 1 comment ·
-
Remove the `ironing out iteration 0` prefix from debug files when the ironing out loop is turned off Openmuse xiii question
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
EnergySystemsModellingLab/MUSE2#1221 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
EnergySystemsModellingLab/MUSE2#1554 ·
-
bug
EnergySystemsModellingLab/MUSE2#1541 · 2 comments · 1 assignee ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
EnergySystemsModellingLab/MUSE2#1526 ·
All issues in EnergySystemsModellingLab/MUSE2
Similar issues
-
bug CLI custom-model
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
rust-bitcoin/rust-bitcoin#6930 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
fulcrumgenomics/ferro-hgvs#2251 ·
-
A-allocators A-docs C-enhancement T-libs
Difficulty 2/5 1-3 hours Newbie friendliness 75/100