Coder Social home page Coder Social logo

gdv's Introduction

standard_repo

This is a template for a standard git repository.

Getting started

The core parts of this repo layout are: conda, pre-commit and code organised in a custom package.

conda

Conda takes care of environments. If you haven't already, install conda.

Create a new conda environment:

conda env create -f environment.yaml

pre-commit

pre-commit is an easy way to organise your git hooks.

Set up pre-commit:

pre-commit install

Files

.gitignore

Use gitignore.io to generate .gitignore files. For this default repository the following tags were used: python, jupyternotebooks, macos, windows, linux, visualstudiocode

environment.yaml

Specify a conda environment for a repository. This makes it

name: conda_env_name

dependencies:
  - python=3.9 # change python version
  - pip
  - pip:
    - e . # install package from current directory
    - pre-commit
    # add your requirements

.pre-commit-config.yaml

repos:
-   repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v4.3.0
    hooks:
    -   id: check-yaml
    -   id: end-of-file-fixer
    -   id: trailing-whitespace
    -   id: check-added-large-files
    -   id: detect-private-key

-   repo: https://github.com/psf/black
    rev: 22.8.0
    hooks:
    -   id: black

-   repo: https://github.com/pre-commit/pygrep-hooks
    rev: v1.9.0
    hooks:
    - id: python-use-type-annotations

-   repo: https://github.com/asottile/reorder_python_imports
    rev: v3.8.2
    hooks:
    -   id: reorder-python-imports

Setup

setup_repo.sh

Structure

Most folders should be self-explanatory. For example: Final reports should be in the reports folder, every trained model should be in the models folder. If the files are too large, maybe add a link to where you can download them.

Folder structure

data

Contains all data necessary for analysis or training.

docs

Documentation goes here

logs

Everything regarding logging is going in here

models

All models should be in this folder

notebooks

All notebooks (except final reports) go in here

references

Try to keep all references in this folder.

reports

All final reports go in here.

scripts

All scripts go in here.

src

Here goes the code for the repo specific package. This makes it easy to install the code with pip, so relative imports are a thing of the past. With the -e flag it get's installed in editable mode, which means you don't have to reinstall the package everytime you change something.
Per default this package gets installed with the conda environment setup.

tests

Write tests and put them into this folder.

gdv's People

Contributors

xdf8 avatar

Watchers

 avatar

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.