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

Great migration #113

Merged
merged 35 commits into from
Sep 29, 2021
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
fe7f3dd
copy everything
ejm714 Sep 28, 2021
298135c
first round of deletion
ejm714 Sep 28, 2021
3d38d1c
more deletions
ejm714 Sep 28, 2021
5ace030
more deletions
ejm714 Sep 28, 2021
0bcba05
put everything under zamba
ejm714 Sep 28, 2021
625b993
remove old readme
ejm714 Sep 28, 2021
b6889c7
replace zamba_algorithms with zamba
ejm714 Sep 28, 2021
a1d52a1
integrate makefile
ejm714 Sep 28, 2021
065e490
changed files
ejm714 Sep 28, 2021
f9e428f
updates from save dir overwrite
ejm714 Sep 28, 2021
7e9b394
add gitignore
ejm714 Sep 28, 2021
779c9b7
use gitignore from zamba algo
ejm714 Sep 28, 2021
13aa358
remove load metadata
ejm714 Sep 28, 2021
85d9252
remove old dirs
ejm714 Sep 28, 2021
08b4ae8
lint
ejm714 Sep 28, 2021
1e0a944
remove load metadata
ejm714 Sep 28, 2021
8b4b49a
remove load_metadata test
ejm714 Sep 28, 2021
7416f24
fix datamodule tests
ejm714 Sep 28, 2021
1e7ff94
simplify time dist model since there is only one
ejm714 Sep 28, 2021
85758d6
flake8
ejm714 Sep 28, 2021
ea7d7c7
remove unused file
ejm714 Sep 28, 2021
69ca5c2
put back lost code
ejm714 Sep 28, 2021
1e2e295
back to long name because that is was model is registered as
ejm714 Sep 28, 2021
2c27906
species is no longer on model
ejm714 Sep 29, 2021
433b6a6
use models without species prefix and zamba backbone finetune params;
ejm714 Sep 29, 2021
69846b2
rename time dist head since there is only one
ejm714 Sep 29, 2021
d8add1d
further remove species
ejm714 Sep 29, 2021
e5ad223
use lstrip instead
ejm714 Sep 29, 2021
09f0a2f
passing tests
ejm714 Sep 29, 2021
a095e47
add missing underscore
ejm714 Sep 29, 2021
51f5cd7
update links to setup.cfg
ejm714 Sep 29, 2021
03344d6
specify branches in workflow
ejm714 Sep 29, 2021
e8dad5e
update setup.cfg
ejm714 Sep 29, 2021
a1103ca
Update setup.cfg
ejm714 Sep 29, 2021
fc7d28c
Update setup.cfg
ejm714 Sep 29, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: tests

on:
push:
branches: [master]
pull_request:
branches:
- v2
- master

jobs:
code-quality:
name: Code Quality
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
pip install -e .[cpu,dev]
- name: Lint package
run: |
make lint
tests:
name: Test suite (${{ matrix.os }}, Python ${{ matrix.python-version }})
needs: code-quality
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.7, 3.8]

steps:
- uses: actions/checkout@v2

- name: Setup FFmpeg
uses: FedericoCarboni/setup-ffmpeg@v1
with:
# Not strictly necessary, but it may prevent rate limit
# errors especially on GitHub-hosted macos machines.
token: ${{ secrets.GITHUB_TOKEN }}

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
pip install -e .[dev]
- name: Run tests
run: |
make tests

test-install:
name: Install and CLI test (non-editable install)
needs: tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.8]

steps:
- uses: actions/checkout@v2

- name: Setup FFmpeg
uses: FedericoCarboni/setup-ffmpeg@v1
with:
# Not strictly necessary, but it may prevent rate limit
# errors especially on GitHub-hosted macos machines.
token: ${{ secrets.GITHUB_TOKEN }}

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

- name: Install package (non-editable)
run: |
python -m pip install --upgrade pip setuptools
pip install .
- name: Run zamba CLI to ensure proper install
run: |
zamba --help
89 changes: 89 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# DotEnv configuration
.env

# Database
*.db
*.rdb

# Pycharm
.idea

# VS Code
.vscode/

# Spyder
.spyproject/

# Jupyter NB Checkpoints
.ipynb_checkpoints/

# exclude data from source control by default
/data/

# Mac OS-specific storage files
.DS_Store

# vim
*.swp
*.swo

# Mypy cache
.mypy_cache/
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include zamba/models/configs/*.yaml
include zamba/models/yolox_models/assets/yolox_nano_20210901.pth
114 changes: 112 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,119 @@
.PHONY: docs docs-serve
.PHONY: docs docs-serve clean lint requirements sync_data_down sync_data_up tests

#################################################################################
# GLOBALS #
#################################################################################

PROJECT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
PROJECT_NAME = zamba
PYTHON_VERSION = 3.8
PYTHON_INTERPRETER = python

ifeq (, $(shell which nvidia-smi))
CPU_OR_GPU ?= cpu
else
CPU_OR_GPU ?= gpu
endif


#################################################################################
# COMMANDS #
#################################################################################

## Install Python Dependencies
requirements:
ifeq (${CPU_OR_GPU}, gpu)
conda install cudatoolkit=11.0.3 cudnn=8.0 -c conda-forge
endif
$(PYTHON_INTERPRETER) -m pip install -U pip setuptools wheel
$(PYTHON_INTERPRETER) -m pip install -e .[dev,internal]


## Delete all compiled Python files
clean:
find . -type f -name "*.py[co]" -delete
find . -type d -name "__pycache__" -delete


## Lint using flake8
lint:
flake8 zamba tests
black --check zamba tests

## Generate assets and run tests
tests:
pytest tests -vv

## Set up python interpreter environment
create_environment:
conda create --name $(PROJECT_NAME) python=$(PYTHON_VERSION) -y
@echo ">>> conda env created. Activate with:\nconda activate $(PROJECT_NAME)"

## Build the static version of the docs
docs:
cd docs && mkdocs build

## Serve documentation to livereload while you work on them
docs-serve:
cd docs && mkdocs serve
cd docs && mkdocs serve

#################################################################################
# Self Documenting Commands #
#################################################################################

.DEFAULT_GOAL := help

# Inspired by <http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html>
# sed script explained:
# /^##/:
# * save line in hold space
# * purge line
# * Loop:
# * append newline + line to hold space
# * go to next line
# * if line starts with doc comment, strip comment character off and loop
# * remove target prerequisites
# * append hold space (+ newline) to line
# * replace newline plus comments by `---`
# * print line
# Separate expressions are necessary because labels cannot be delimited by
# semicolon; see <http://stackoverflow.com/a/11799865/1968>
.PHONY: help
help:
@echo "$$(tput bold)Available rules:$$(tput sgr0)"
@echo
@sed -n -e "/^## / { \
h; \
s/.*//; \
:doc" \
-e "H; \
n; \
s/^## //; \
t doc" \
-e "s/:.*//; \
G; \
s/\\n## /---/; \
s/\\n/ /g; \
p; \
}" ${MAKEFILE_LIST} \
| LC_ALL='C' sort --ignore-case \
| awk -F '---' \
-v ncol=$$(tput cols) \
-v indent=19 \
-v col_on="$$(tput setaf 6)" \
-v col_off="$$(tput sgr0)" \
'{ \
printf "%s%*s%s ", col_on, -indent, $$1, col_off; \
n = split($$2, words, " "); \
line_length = ncol - indent; \
for (i = 1; i <= n; i++) { \
line_length -= length(words[i]) + 1; \
if (line_length <= 0) { \
line_length = ncol - indent - length(words[i]) - 1; \
printf "\n%*s ", -indent, " "; \
} \
printf "%s ", words[i]; \
} \
printf "\n"; \
}' \
| more $(shell test $(shell uname) = Darwin && echo '--no-init --raw-control-chars')
19 changes: 19 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[build-system]
requires = [
"setuptools>=42",
"wheel",
]
build-backend = "setuptools.build_meta"

[tool.black]
line-length = 99
target-version = ["py36", "py37", "py38"]
include = '\.pyi?$'
exclude = '''
(
/(
\.git
| \.venv
)/
)
'''
Loading