PyPSA / pypsa-ariadne

High resolution, sector-coupled model of the German Energy System
https://ariadneprojekt.de/en/model-documentation-pypsa/
MIT License
6 stars 4 forks source link

Use environment secrets #12

Closed lindnemi closed 5 months ago

lindnemi commented 5 months ago

Like @fneum suggested, Snakemake environment variables can be used to avoid accidental commits of private usernames and passwords to the repository. Since we are working more and more with the IIASA Database it became tedious to keep adding and removing the login details from the config. With this PR you will need to add the Username and password only once to you .bashrc

Step 1:

vim ~/.bashrc

Step 2:

at the end of the file add

export IIASA_USERNAME='usr'
export IIASA_PASSWORD='pwd'

(Insert correct usr and pwd and don't forget the quotation marks)

Step 3:

(Maybe) restart your vscode / terminal session

lindnemi commented 5 months ago

sorry about the two minor commits in the branch, they accidentally snug in, they won't hurt, but i can remove them if you want a cleaner PR

fneum commented 5 months ago

Looks good! Could you add these instructions to the README?

lindnemi commented 5 months ago

Done

fneum commented 5 months ago

Great, is it intended that the PyPSA-Eur submodule also moves forward?

lindnemi commented 5 months ago

nope, good catch

lindnemi commented 5 months ago

not working completley with vscode yet...

fneum commented 5 months ago

Works for me. Did you also source in vscode?