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

Proposal to add a test folder on the v2.0.0 template #390

Open
JMasr opened this issue Jun 27, 2024 · 0 comments
Open

Proposal to add a test folder on the v2.0.0 template #390

JMasr opened this issue Jun 27, 2024 · 0 comments

Comments

@JMasr
Copy link

JMasr commented Jun 27, 2024

I wanna propose an adition to the v2.0.0 template. Adding support for testing, with a test folder and a make test step.

pros:

  • Promote TDD and best testing practice on the data science comunity
  • Validate the code before using it by a make test step on the workflow
  • Clean Code for all ;)

cons

  • What testing tool the comunity should use?
  • Dev a generic tools that scan the test framework used on the project and run the test using that framework
  • Standarization could be hard :`(

Possible road map:

  1. Add a folder to the project structure on the same lv of docs folder and {{ cookiecutter.module_name }}
├── LICENSE            <- Open-source license if one is chosen
├── Makefile           <- Makefile with convenience commands like `make data` or `make train`
├── README.md          <- The top-level README for developers using this project.
├── data
│   ├── external       <- Data from third party sources.
│   ├── interim        <- Intermediate data that has been transformed.
│   ├── processed      <- The final, canonical data sets for modeling.
│   └── raw            <- The original, immutable data dump.
│

├── test <- A default pytest module for testing the source code of the project

│
├── docs               <- A default mkdocs project; see www.mkdocs.org for details
│
├── models             <- Trained and serialized models, model predictions, or model summaries
│
├── notebooks          <- Jupyter notebooks. Naming convention is a number (for ordering),
│                         the creator's initials, and a short `-` delimited description, e.g.
│                         `1.0-jqp-initial-data-exploration`.
│
├── pyproject.toml     <- Project configuration file with package metadata for 
│                         {{ cookiecutter.module_name }} and configuration for tools like black
│
├── references         <- Data dictionaries, manuals, and all other explanatory materials.
│
├── reports            <- Generated analysis as HTML, PDF, LaTeX, etc.
│   └── figures        <- Generated graphics and figures to be used in reporting
│
├── requirements.txt   <- The requirements file for reproducing the analysis environment, e.g.
│                         generated with `pip freeze > requirements.txt`
│
├── setup.cfg          <- Configuration file for flake8
│
└── {{ cookiecutter.module_name }}   <- Source code for use in this project.
    │
    ├── __init__.py             <- Makes {{ cookiecutter.module_name }} a Python module
    │
    ├── config.py               <- Store useful variables and configuration
    │
    ├── dataset.py              <- Scripts to download or generate data
    │
    ├── features.py             <- Code to create features for modeling
    │
    ├── modeling                
    │   ├── __init__.py 
    │   ├── predict.py          <- Code to run model inference with trained models          
    │   └── train.py            <- Code to train models
    │
    └── plots.py                <- Code to create visualizations   
  1. Add a step to the Makefile
## Install Python Dependencies
.PHONY: test
requirements:
	$(PYTHON_INTERPRETER) -m pip install -U pip, pytest
	$(PYTHON_INTERPRETER) -m pytest tests
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

1 participant