Skip to content

Commit

Permalink
Customize github actions (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
jankrepl committed Aug 2, 2022
1 parent ecddac7 commit 4ff9d7f
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 22 deletions.
54 changes: 36 additions & 18 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,61 @@
name: Python application
name: Lint and test

on:
push:
branches: [master]
pull_request:

permissions:
contents: read

jobs:
build:
linting:
runs-on: ubuntu-latest

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macost-latest]
python-version: [3.7, 3.8, 3.9]

steps:
- uses: actions/checkout@v3
- name: Cancel previous workflows that are still running
uses: styfle/cancel-workflow-action@0.8.0
with:
access_token: ${{ github.token }}

- name: Set up Python ${{ matrix.python-version }}
- name: Checkout most recent commit
uses: actions/checkout@v3

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

- name: List dependencies
run: |
pip freeze
- name: Lint
run: |
pip install flake8, pydocstyle
pip install 'flake8==5.0.3' 'pydocstyle==6.1.1'
flake8 deepdow tests
pydocstyle deepdow
testing:
needs: linting
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.7, 3.8, 3.9]
steps:
- name: Checkout most recent commit
uses: actions/checkout@v3

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

- name: Install dependencies
run: |
pip install .[docs,examples]
pip install .[dev,docs,examples]
- name: List dependencies
run: |
pip freeze
- name: Run unittests
run: |
Expand All @@ -48,5 +66,5 @@ jobs:
pip install sphinx
sphinx-build -b doctest docs/ temp_doctest
- name: Run cover coverage
uses: codecov/codecov-action@v1
- name: Run coverage
uses: codecov/codecov-action@v3
1 change: 1 addition & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
comment: false
4 changes: 2 additions & 2 deletions deepdow/experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ def metrics(self):
`lookback`, `metric`, `model`, `timestamp`, `value`.
"""
master_list = [] # over all epochs
for l in self.database.values():
master_list.extend(l)
for el in self.database.values():
master_list.extend(el)

return pd.DataFrame(master_list)

Expand Down
2 changes: 1 addition & 1 deletion deepdow/visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def plot_weight_anim(weights, always_visible=None, n_displayed_assets=None, n_se
colors_ = None

elif isinstance(colors, dict):
colors_ = [colors.get(l, 'black') for l in labels]
colors_ = [colors.get(label, 'black') for label in labels]

elif isinstance(colors, cm.colors.ListedColormap):
colors_ = cycle(colors.colors)
Expand Down
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ convention = numpy

[tool:pytest]
addopts = -v
--color=yes
--cov=deepdow/
--cov-report=term
--disable-warnings
--tb=short
--tb=short

0 comments on commit 4ff9d7f

Please sign in to comment.