Comments (3)
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 django
application). My inclination is to keep things simple by default and not roll our own settings module that would need development/support/documentation at the base level of the cookiecutter.
Happy to consider if there are really compelling use cases for needing a config.py
as a default, but I think environment variables will cover most of them.
from cookiecutter-data-science.
Hope the question fits here... what about a helper module or src/settings.py
to access data folder?
In src/data/make_data.py you have:
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 src/settings.py
too? For me it is seems a good convenience feature.
from cookiecutter-data-science.
Closing as possible in the future but based on participation in this question
issue it's not a commonly desired feature (or is easily slotted in on a per-project basis).
from cookiecutter-data-science.
Related Issues (20)
- add documentation for running make on Windows HOT 8
- Make v1 template docs accessible in new docs
- Termynal markdown page should not be included HOT 1
- v2 release logistics checklist HOT 1
- ideas for documentation about just+pyproject.toml+mkdocs HOT 1
- Defend against broken paths from non-editable installs
- Document how to use the Python source code scaffolding
- Document conda-forge as a way to install make
- Option for Poetry support for package managent
- Update directory structure in README to reflect v2
- Add tag for v2 HOT 1
- Release package on conda-forge HOT 1
- Add badges to README
- config import fails when using V2 scaffolding HOT 2
- Consolidate linting and formatting to use ruff
- Add documentation about contributing and requesting tools
- Is there an example project? HOT 1
- Ruff lint configuration names are incorrect HOT 1
- Release tagging mechanics HOT 3
- Proposal to add a test folder on the v2.0.0 template
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cookiecutter-data-science.