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
Add default config file to src/ #37
Comments
Hey @ohenrik thanks for the thoughts. Generally, we want anything that varies from machine to machine to be stored in the environment. Check out the 12-factor app's section on configuration for more reasons why. Projects with a large number of settings do grow into having a separate importable settings or config module (e.g., a Happy to consider if there are really compelling use cases for needing a |
Hope the question fits here... what about a helper module or In src/data/make_data.py you have: cookiecutter-data-science/{{ cookiecutter.repo_name }}/src/data/make_dataset.py Lines 23 to 24 in be7f8d7
Myself I use something like below to locate the repo root folder: from pathlib import Path
DATA_PATH = Path(__file__).parents[2] / 'data'
def make_data_path(folder: str, file_name: str) -> str:
folder = DATA_PATH / folder
if not folder.exists():
folder.mkdir(parents=True)
return str(folder / file_name) Once the data directory structure is there template, maybe path to it should be in |
Closing as possible in the future but based on participation in this |
Hi
Should we add a
src/config.py
orsrc/settings.py
file? I believe this would make it easier to get paths to folders etc. in make_data.py for example.I can then import the config variable like so:
However note that importing settings in this way also requires me to change the make file from this:
to this:
I'm not sure if this has any downsides to it. An alternative is also to add the src and/or settings file to the python path.
I'm still learning both Python and Data Science so please bear with me if what I'm suggesting or my code is Silly :)
The text was updated successfully, but these errors were encountered: