Skip to content

Commit

Permalink
refactor(everything): Refactor for easier to maintain code
Browse files Browse the repository at this point in the history
CI based on Github workflows, EyeVolume class as a standard way for handling OCT volumes, support for HEXEX VOL/XML, Bscans from folder, DUKE and RETOUCH data

BREAKING CHANGE:
  • Loading branch information
Oli4 committed Feb 17, 2022
1 parent 9d5dbc1 commit 117ef89
Show file tree
Hide file tree
Showing 77 changed files with 5,100 additions and 3,466 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/_quality.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Test

on: workflow_call

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: [ "3.8" ]#, "3.9", "3.10"]

steps:
- uses: actions/checkout@v2

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

- name: Cache Poetry
uses: actions/cache@v2
id: poetry-cache
with:
path: |
~/.local
key: poetry-1.1.13
restore-keys: |
poetry-1.1.13
- name: Cache virtualenv
uses: actions/cache@v2
id: virtualenv-cache
with:
path: |
~/.cache
key: virtualenv-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
virtualenv-${{ hashFiles('**/poetry.lock') }}
- name: Install and configure Poetry
if: steps.poetry-cache.outputs.cache-hit != 'true'
uses: snok/install-poetry@v1.3
with:
version: 1.1.13
virtualenvs-create: true
virtualenvs-in-project: false
installer-parallel: true

- name: Install Dependencies
if: steps.virtualenv-cache.outputs.cache-hit != 'true'
run: poetry install

- name: Test with pytest
run: poetry run pytest --cov .
26 changes: 26 additions & 0 deletions .github/workflows/_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Semantic release

on:
workflow_call:
secrets:
PYPI_PASSWORD:
required: true

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.x"

- name: Python Semantic Release
uses: relekang/python-semantic-release@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
repository_username: __token__
repository_password: ${{ secrets.PYPI_PASSWORD }}
21 changes: 21 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: CI

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

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
Quality:
uses: MedVisBonn/eyepy/.github/workflows/_quality.yaml@master

Release:
needs: Quality
uses: MedVisBonn/eyepy/.github/workflows/_release.yaml@master
secrets:
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.idea/
examples/notebooks

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down Expand Up @@ -102,4 +105,4 @@ ENV/
.mypy_cache/

# Pycharm
.idea/
old/.idea/
54 changes: 16 additions & 38 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,39 +1,17 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
minimum_pre_commit_version: 1.20.0
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- id: requirements-txt-fixer
- id: fix-encoding-pragma
- id: check-docstring-first
- repo: https://github.com/asottile/blacken-docs
rev: v1.3.0
hooks:
- id: blacken-docs
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.4.2
hooks:
- id: python-use-type-annotations
- repo: https://github.com/myint/docformatter
rev: v1.3.1
hooks:
- id: docformatter
- repo: https://github.com/pycqa/isort
rev: 5.6.3
hooks:
- id: isort
name: isort (python)
- id: isort
name: isort (cython)
types: [cython]
- repo: https://github.com/psf/black
rev: 19.10b0
hooks:
- id: black
language_version: python3 # Should be a command that runs python3.6+
- hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
- hooks:
- id: black
repo: https://github.com/psf/black
rev: 21.12b0
- hooks:
- id: commitizen
stages:
- commit-msg
repo: https://github.com/commitizen-tools/commitizen
rev: v2.20.4
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

133 changes: 0 additions & 133 deletions CONTRIBUTING.rst

This file was deleted.

8 changes: 0 additions & 8 deletions HISTORY.rst

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020, Olivier Morelle
Copyright (c) 2022, Olivier Morelle

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
11 changes: 0 additions & 11 deletions MANIFEST.in

This file was deleted.

0 comments on commit 117ef89

Please sign in to comment.