Skip to content

Commit

Permalink
Merge pull request #295 from DeepSenseCA/rel_1.1.0
Browse files Browse the repository at this point in the history
REL: Release version 1.1.0
  • Loading branch information
scottclowe committed Nov 12, 2022
2 parents 895911d + 167971d commit 593a444
Show file tree
Hide file tree
Showing 101 changed files with 10,003 additions and 3,055 deletions.
23 changes: 23 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[run]
branch = True
omit = */tests/*

[report]
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover

# Don't complain about missing debug-only code:
def __repr__
if self\.debug:
if debug:
if DEBUG:

# Don't complain if tests don't hit defensive assertion code:
raise AssertionError
raise NotImplementedError

# Don't complain if non-runnable code isn't run:
if 0:
if False:
if __name__ == .__main__.:
13 changes: 10 additions & 3 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
[flake8]
max-line-length = 120
# C408 ignored because we like the dict keyword argument syntax
ignore = E203,E305,E402,E721,E741,F401,F403,F405,F821,F841,F999,W503,W504,C408
exclude = docs/src,venv,third_party,caffe2,scripts,docs/caffe2,tools/amd_build/pyHIPIFY,torch/lib/include,torch/lib/tmp_install,build,torch/include
# C408 ignored because pytorch likes the dict keyword argument syntax
# E203: whitespace before ":". Sometimes violated by black.
# E402: Module level import not at top of file. Violated by lazy imports.
# F401: Module imported but unused.
# D100-D107: Missing docstrings
# D200: One-line docstring should fit on one line with quotes.
extend-ignore = C408,E203,E402,F401,D100,D101,D102,D103,D104,D105,D106,D107,D200
docstring-convention = numpy
# Ignore missing docstrings within unit testing functions.
per-file-ignores = **/tests/:D100,D101,D102,D103,D104,D105,D106,D107
74 changes: 55 additions & 19 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,57 +1,86 @@
##---------------------------------------------------
# Common .gitattributes
##---------------------------------------------------
# Common settings that generally should always be used with your language specific settings

# Auto detect text files and perform LF normalization
* text=auto
# https://www.davidlaing.com/2012/09/19/customise-your-gitattributes-to-become-a-git-ninja/
* text=auto

#
# The above will handle all files NOT found below
#

# Documents
# ============
*.doc diff=astextplain
*.DOC diff=astextplain
*.bibtex text diff=bibtex
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
*.md text
*.tex text
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
*.md text diff=markdown
*.tex text diff=tex
*.adoc text
*.textile text
*.mustache text
*.csv text
*.tab text
*.tsv text
*.txt text
*.sql text
*.ps1 text eol=crlf

# Graphics
# ============
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.tif binary
*.tiff binary
*.ico binary
# SVG treated as an asset (binary) by default. If you want to treat it as text,
# comment-out the following line and uncomment the line after.
*.svg binary
#*.svg text
# SVG treated as an asset (text) by default.
*.svg text
# If you want to treat it as binary, use the following line instead.
# *.svg binary
*.eps binary

# Scripts
*.bash text eol=lf
*.fish text eol=lf
*.sh text eol=lf
# These are explicitly windows files and should use crlf
*.bat text eol=crlf
*.cmd text eol=crlf

# Serialisation
*.json text
*.toml text
*.xml text
*.yaml text
*.yml text

# Archives
*.7z binary
*.gz binary
*.tar binary
*.tgz binary
*.zip binary

# Text files where line endings should be preserved
*.patch -text

#
# Exclude files from exporting
#

.gitattributes export-ignore
.gitignore export-ignore
.gitignore export-ignore
.gitkeep export-ignore


##---------------------------------------------------
Expand All @@ -73,9 +102,9 @@
*.db binary
*.p binary
*.pkl binary
*.pyc binary
*.pyc binary export-ignore
*.pyo binary export-ignore
*.pyd binary
*.pyo binary

# Note: .db, .p, and .pkl files are associated
# with the python modules ``pickle``, ``dbm.*``,
Expand All @@ -84,5 +113,12 @@

# Jupyter Notebooks
# =================
*.ipynb filter=nbstripout
*.ipynb diff=ipynb
*.ipynb text


##---------------------------------------------------
# Project specific
##---------------------------------------------------

# Don't manipulate test resources
test-resources/* binary
40 changes: 40 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Docs workflow
#
# Ensures that the docs can be built with sphinx.
# - On every push and PR, checks the HTML documentation builds on linux.
# - On every PR and tag, checks the documentation builds as a PDF on linux.
# - If your repository is public, on pushes to the default branch (i.e. either
# master or main), the HTML documentation is pushed to the gh-pages branch,
# which is automatically rendered at the publicly accessible url
# https://USER.github.io/PACKAGE/

name: docs

on: [push, pull_request]

jobs:
docs-html:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Check if README.md needs to be converted
id: check_readme
run: |
if [ ! -f "README.rst" ] && [ -f "README.md" ]; then
echo '::set-output name=convert::true';
fi
- name: Convert README.md to README.rst
if: steps.check_readme.outputs.convert == 'true'
uses: docker://pandoc/core:2.9
with:
args: >-
README.md
--from=gfm
--output=README.rst
- name: Build HTML docs
uses: ammaraskar/sphinx-action@master
with:
docs-folder: "docs/"
21 changes: 21 additions & 0 deletions .github/workflows/system_info.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
"""
Print out some handy system info.
"""

import os
import platform
import sys

print("Build system information")
print()

print("sys.version\t\t", sys.version.split("\n"))
print("os.name\t\t\t", os.name)
print("sys.platform\t\t", sys.platform)
print("platform.system()\t", platform.system())
print("platform.machine()\t", platform.machine())
print("platform.platform()\t", platform.platform())
print("platform.version()\t", platform.version())
print("platform.uname()\t", platform.uname())
if sys.platform == "darwin":
print("platform.mac_ver()\t", platform.mac_ver())
106 changes: 106 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# Regular tests
#
# Use this to ensure your tests are passing on every push and PR (skipped on
# pushes which only affect documentation).
# There is also a cron job set to run weekly on the default branch, to check
# against dependency chain rot.
#
# You should make sure you run jobs on at least the *oldest* and the *newest*
# versions of python that your codebase is intended to support.

name: tests

on:
push:
pull_request:
schedule:
- cron: "0 0 * * 1"
branches: [ $default-branch ]

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.6", "3.7"]
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: System information
run: python .github/workflows/system_info.py

- name: Get pip cache dir
id: pip-cache
run: echo "::set-output name=dir::$(pip cache dir)"

- name: pip cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-py${{ matrix.python-version }}-${{ hashFiles('**/requirements*.txt') }}
restore-keys: ${{ runner.os }}-pip-

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8
python -m pip install torch==1.4.0+cpu torchvision==0.5.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
python -m pip install -r frozen_requirements.txt
python -m pip install .[test]
- name: Get appdirs cache dir
id: appdirs-cache
run: echo "::set-output name=dir::$(python -c 'from echofilter.ui.checkpoints import get_default_cache_dir as c; print(c())')"

- name: Cache checkpoints
uses: actions/cache@v3
with:
path: ${{ steps.appdirs-cache.outputs.dir }}
key: checkpoints-${{ hashFiles('**/echofilter/checkpoints.yaml') }}
restore-keys: checkpoints-

- name: Sanity check with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
python -m flake8 . --count --select=E9,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings
python -m flake8 . --count --exit-zero --statistics
- name: Debug environment
run: python -m pip freeze

- name: Test with pytest
run: |
python -m pytest --cov=echofilter --cov-report term --cov-report xml --cov-config .coveragerc --junitxml=testresults.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
flags: unittests
env_vars: OS,PYTHON
name: Python ${{ matrix.python-version }} on ${{ runner.os }}

- name: Test show help
run: echofilter -h

- name: Test show version
run: echofilter --version

- name: Test list-checkpoints
run: echofilter --list-checkpoints

- name: Test list-colors
run: echofilter --list-colors

- name: Test dry-run
run: echofilter test-resources -n
31 changes: 28 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,38 @@ echofilter/checkpoints
# Auto-generated rST root file for exporting docs to PDF
docs/index_pdf.rst

# Ignore all built documentation (including Guide and PDF)
docs/_build*

# Ignore extra directories
image_samples/
models/
notes/
processed/
results/
test-output/
test-resources-source/


##---------------------------------------------------
# Automated documentation .gitignore files
##---------------------------------------------------

# Automatically generated API documentation stubs from sphinx-apidoc
docs/source/packages

# Automatically converting README from markdown to rST
docs/bin
docs/source/readme.rst


##---------------------------------------------------
# Continuous Integration .gitignore files
##---------------------------------------------------

# Ignore test result XML files
testresults.xml
coverage.xml


##---------------------------------------------------
Expand Down Expand Up @@ -97,9 +122,6 @@ instance/

# Sphinx documentation
docs/_build/
docs/_build*
# sphinx-apidoc automatically generated documentation
docs/source/packages

# PyBuilder
target/
Expand Down Expand Up @@ -154,6 +176,9 @@ dmypy.json
# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/


##---------------------------------------------------
# Windows default .gitignore
Expand Down
Loading

0 comments on commit 593a444

Please sign in to comment.