Skip to content
Snippets Groups Projects
develop.md 1.82 KiB
Newer Older
  • Learn to ignore specific revisions
  • Jeremy M Fee's avatar
    Jeremy M Fee committed
    Development Dependencies
    ========================
    
    
    These instructions only need to be completed if you plan on developing new
    
    code for this project, and may also be used to run a local copy of the code.
    
    Eddie McWhirter's avatar
    Eddie McWhirter committed
    Begin Developing
    ----------------
    
    Jeremy M Fee's avatar
    Jeremy M Fee committed
    1. Install `obspy`, `pycurl`, `flake8`, `pytest`, `pytest-cov`, `webtest`.
    
    > Using Anaconda is recommended ( https://conda.io/miniconda.html ).
    
            conda config --add channels conda-forge
    
    Jeremy M Fee's avatar
    Jeremy M Fee committed
            conda create --name geomagenv obspy pycurl flake8 pytest pytest-cov webtest
    
            source activate geomagenv
    
    2. Fork this project on Github ( https://guides.github.com/activities/forking/ ).
    
            https://github.com/{YOUR_GITHUB_ACCOUNT}/geomag-algorithms.git
    
            git clone https://github.com/{YOUR_GITHUB_ACCOUNT}/geomag-algorithms.git
            cd geomag-algorithms
            git remote add upstream https://github.com/usgs/geomag-algorithms.git
    
    4. Use branches to develop new features and submit pull requests.
    
    Developer Tools
    ---------------
    
    - **Linting errors**
    Check for linting errors using Flake8
    
            cd geomag-algorithms
            flake8
    
    Jeremy M Fee's avatar
    Jeremy M Fee committed
    Run unit tests using PyTest
    
            cd geomag-algorithms
    
    Jeremy M Fee's avatar
    Jeremy M Fee committed
            pytest
    
    - **Unit test coverage**
    
            cd geomag-algorithms
    
    Jeremy M Fee's avatar
    Jeremy M Fee committed
            pytest --cov=geomagio
    
    - **Automatically run linting and tests while developing**
    (Requires NodeJS)
    
            cd geomag-algorithms
            npm install
            npm run watch
    
    Jeremy M Fee's avatar
    Jeremy M Fee committed
        There are also "npm run" aliases for individual commands which are listed by running
    
    
    Coding Standards
    ----------------
    
    
    This project adheres to PEP8 standards in most cases:
        https://www.python.org/dev/peps/pep-0008
    
    
    - Hanging/Visual indents (E122, E126, E127, E128, E131)
    
    
        - line continuations should use two indentations (8 spaces).
        - do not use visual indents.