Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

[BUG] Global commodities column name mapping conflict

Abierto
#795 5 comentarios 0 reacciones 2 asignados Ver en GitHub

@tsmbland ya está trabajando en esto.

Desde el 3/10/2025.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

bug

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
Lenguaje dominante
Python
Estrellas
29
Forks
12
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

  • Sin Dockerfile ni archivo de Docker Compose
  • Tiene una plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de EnergySystemsModellingLab/MUSE_OS

Todos los issues de EnergySystemsModellingLab/MUSE_OS

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.