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

Copernicus environment variables not being read from .env file #38

Open
GilesFearon opened this issue Apr 19, 2023 · 1 comment
Open

Comments

@GilesFearon
Copy link
Collaborator

I was having another go at downloading mercator data from the toolkit cli i.e. following the Algoa Bay operational model example in the toolkit docs, at step 3. I have COPERNICUS_PASSWORD and COPERNICUS_USERNAME defined in $SOMISANA_DIR/.env as provided in the docs. It only works if I export these manually in my shell environment (or add them to my .bashrc), but my understanding is that it should be read from the .env file.

By the way, I also tried defining these in the .env file in the toolkit dir in the source code (but same result). This actually got me wondering if we need these multiple .env files? They should probably be defined in the temp working dir to keep them out of the source code right?

@zachsa
Copy link
Collaborator

zachsa commented Apr 20, 2023

It should work in the .env file placed in the same directory as the __main__.py file.

There are two .env files:

  1. The env file for the toolkit
  2. A matlab .env file - the toolkit writes to this file, that is then read by matlab (https://github.com/SAEON/somisana/blob/stable/toolkit/cli/applications/ops/download/__init__.py#L38-L53)

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

No branches or pull requests

2 participants