Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Version - Development

## Features

- Formatting commodity names in technodata enduse ([#237](https://github.com/EnergySystemsModellingLab/MUSE_OS/pull/237))
- Separate publish workflow and add upload of executable to release ([#231](https://github.com/EnergySystemsModellingLab/MUSE_OS/pull/231))
- Update main branch ([#225](https://github.com/EnergySystemsModellingLab/MUSE_OS/pull/225))
- Notebooks in the documentation are run as tests ([#178](https://github.com/SGIModel/MUSE_OS/pull/178))
Expand Down
8 changes: 7 additions & 1 deletion src/muse/readers/csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,17 @@ def to_agent_share(name):
result = xr.Dataset.from_dataframe(data.sort_index())
if "fuel" in result.variables:
result["fuel"] = result.fuel.isel(region=0, year=0)
result["fuel"].values = [camel_to_snake(name) for name in result["fuel"].values]
if "type" in result.variables:
result["tech_type"] = result.type.isel(region=0, year=0)
result["tech_type"].values = [
camel_to_snake(name) for name in result["tech_type"].values
]
if "enduse" in result.variables:
result["enduse"] = result.enduse.isel(region=0, year=0)
result["enduse"].values = [
camel_to_snake(name) for name in result["enduse"].values
]

units = csv[csv.process_name == "Unit"].drop(
["process_name", "region_name", "time", "level"], axis=1
Expand Down Expand Up @@ -171,7 +178,6 @@ def read_io_technodata(filename: Union[Text, Path]) -> xr.Dataset:
data.index = ts
data.columns.name = "commodity"
data.index.name = "technology"

data = data.rename(columns=camel_to_snake)
data = data.apply(partial(pd.to_numeric, errors="ignore"), axis=0)

Expand Down