Skip to content

Fixing biomass transport cost#769

Merged
fneum merged 9 commits intoPyPSA:masterfrom
yerbol-akhmetov:fix_biomass_transport
May 20, 2024
Merged

Fixing biomass transport cost#769
fneum merged 9 commits intoPyPSA:masterfrom
yerbol-akhmetov:fix_biomass_transport

Conversation

@yerbol-akhmetov
Copy link
Copy Markdown
Contributor

Changes proposed in this Pull Request

Good day. Here I propose changes to build_biomass_transport_costs.py file to fix the error that happens when biomass_transport is set true in the config. I have uploaded the error. It is related to utf-8 encoding, in particular, the error happens due to EUR sign. I run my code in the windows machine. The error is resolved by explicitly defining encoding as cp1252 which is a windows compatible encoding and an extension of latin-1 encoding. After I have fixed the code, I have checked the resulting csv. The resulting biomass transport costs coincides with the supplementary material in Liza's paper on "Mitigating heat demand ...".

error utf-8
fix_biomass

Checklist

  • I tested my contribution locally and it seems to work fine.
  • A release note doc/release_notes.rst is added.

Copy link
Copy Markdown
Member

@martacki martacki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the currently suggested changes, the script cannot be compiled on Linux. We're working on a fix.

@yerbol-akhmetov
Copy link
Copy Markdown
Contributor Author

Hello, @martacki. I have added encoding based on the OS. For Windows it is cp1252, while for Linux and MacOS it is None, because it works fine without it (while cp1252 causes issue for Linux).

Copy link
Copy Markdown
Member

@martacki martacki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on Linux, seems to run.

The script is furthermore not touched with the default config configuration, only when biomass_transport = True

@fneum fneum enabled auto-merge May 20, 2024 20:25
@fneum fneum added this to the v0.11.0 milestone May 20, 2024
@fneum fneum disabled auto-merge May 20, 2024 20:38
@fneum fneum merged commit 26863c1 into PyPSA:master May 20, 2024
@yerbol-akhmetov yerbol-akhmetov deleted the fix_biomass_transport branch May 21, 2024 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants