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

Support configuration in multiple ways #44

Closed
Peter9192 opened this issue Feb 13, 2023 · 4 comments · Fixed by #178
Closed

Support configuration in multiple ways #44

Peter9192 opened this issue Feb 13, 2023 · 4 comments · Fixed by #178

Comments

@Peter9192
Copy link
Collaborator

  • default config
  • override based on (partial) config file in standard location
  • override based on (partial) config file in location passed through CLI/API
  • override individual options through CLI or API

Perhaps use hydra https://hydra.cc/docs/intro/

@Peter9192 Peter9192 added this to the Sprint one: data retrieval milestone Feb 13, 2023
@Peter9192 Peter9192 added the Long term Ideas/suggestions/plans for the longer term label Mar 20, 2023
@sverhoeven
Copy link
Collaborator

sverhoeven commented Jun 28, 2023

Now not ideal, as config fields are used on import time. For example at

phenocam_data_dir = CONFIG.data_dir / "phenocam"

You need to change configuration before importing things that use config.

@sverhoeven
Copy link
Collaborator

Use https://pypi.org/project/xdg-base-dirs/ to get cache and config dir

@sverhoeven sverhoeven removed the Long term Ideas/suggestions/plans for the longer term label Jul 13, 2023
@sverhoeven
Copy link
Collaborator

springtime --output-dir /tmp/outputdir --cache ~/.cache/springtime --config ~/.config/springtime <recipe>
# for example ~/.config/springtime/pep725_credentials.txt

@sverhoeven
Copy link
Collaborator

sverhoeven commented Jul 14, 2023

I would like to have several options for output location:

  1. output in specific folder
    • With --output-dir /tmp/myoutput so data.csv is written in /tmp/myoutput/data.csv`.
  2. output in current working directory.
    • With --output-dir . so data.csv is written in ./data.csv.
  3. output in sub directory like the current time of specific folder. for example /tmp/springtime-jobs/springtime-24072023T14:18:23/data.csv
    • can configure /tmp/springtime-jobs with --output-root-dir.

If --output-dir is absent then <output-root-dir>/springtime-24072023T14:18:23/data.csv
If --output-root-dir is absent then it is ..

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 a pull request may close this issue.

2 participants