Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing biomass transport cost #769

Merged
merged 9 commits into from
May 20, 2024

Conversation

yerbol-akhmetov
Copy link
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
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
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
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
5 of 6 checks passed
@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.

None yet

3 participants