Giter Site home page Giter Site logo

Comments (3)

pjbull avatar pjbull commented on May 27, 2024

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.

epogrebnyak avatar epogrebnyak commented on May 27, 2024

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:

https://github.com/drivendata/cookiecutter-data-science/blob/be7f8d76b2c542a1f355046d132d6fd39b0b2a6d/%7B%7B%20cookiecutter.repo_name%20%7D%7D/src/data/make_dataset.py#L23-L24

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.

isms avatar isms commented on May 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.