[BUG] Global commodities column name mapping conflict
@tsmbland is already working on this.
Since Oct 3, 2025.
Assessment
This issue has not been assessed yet.
Description
Describe the bug
Older global_commodities input files will have headings Commodity, CommodityName etc.
The mapping from these old columns names to the new names is:
Commodity -> description
CommodityName - > commodity
There is a problem here: how does muse know whether a column called "commodity" is in the old parlance or the new parlance?
At present the mapping Commodity -> description does not seem to be listed in csv.py
If we added it, it would incorrectly map a new style column name, because the mapping is done after reducing to camel case.
One tempting fix would be to do the mapping before the case change. However, this would put us back into a situation of being case-sensitive, which we were trying to get away from...
Hopefully there is a better solution? (Or I have misunderstood the cause of the problem..?)
To Reproduce
Run the function standardize_dataframe() from csv.py on the input file global_commodities.csv
Expected behavior
`ValueError: Duplicate columns in Index(['commodity', 'commodity_type', 'commodity', 'emmission_factor'], dtype='object')'
Context
Please, complete the following to better understand the system you are using to run MUSE.
- Operating system (eg. Windows 10): Mac OSX
- MUSE version (eg. 1.0.1): b779f2339abaddcc76e0b196192f8625ebb4486a
- Installation method (eg. pipx, pip, development mode): development mode
- Python version (you can get this running
python --version): 3.9.18
- Dominant language
- Python
- Stars
- 29
- Forks
- 12
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing 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/MUSE_OS
-
Release notes for v2.2.0May be free again @tsmbland claimed this 43 days ago, and no pull request is open. Open
EnergySystemsModellingLab/MUSE_OS#850 · 1 assignee ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
[BUG] MUSE stopping without error/warning messageMay be free again @sharwaridixit claimed this 318 days ago, and no pull request is open. Openbug
EnergySystemsModellingLab/MUSE_OS#804 · 2 comments · 3 assignees ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
All issues in EnergySystemsModellingLab/MUSE_OS
Similar issues
-
adr
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
kristofdegrave/homeassistant-smart-charging#1607 ·
Maintainers usually reply within 1 day
-
namespace operations
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
EclipseFdn/open-vsx.org#13665 ·
Maintainers usually reply within 1 day
-
doc good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
collective/icalendar#1865 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
canonical/opentelemetry-collector-operator#409 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
mozilla/addons-release-tests#1243 ·
Maintainers usually reply within 1 day