Skip to content

Workflow restructuring #166

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

Merged
merged 4 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
34 changes: 34 additions & 0 deletions .github/workflows/pytest_coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This workflow will install Python dependencies, run tests for a single versions of Python and commit test results to coveralls
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: pytest

on: pull_request

jobs:
pytest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
lfs: true
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
run: |
git lfs pull
python -m pip install --upgrade pip
python -m pip install pytest coverage coveralls
- name: Install package
run: |
python -m pip install .
- name: Test with pytest
run: |
coverage run -m pytest -sv --show-capture=no tests
- name: Submit to coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
coveralls --service=github
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ name: pytest
on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
pytest:
Expand Down
11 changes: 11 additions & 0 deletions tests/calibrator/test_momentum.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,20 @@ def test_apply_registration(
[248.29, 248.62],
],
)
# store dummy deformation
mc.reset_deformation()
dummy_inv_dfield = np.asarray(
[
np.asarray([np.arange(0, 2048) for _ in range(2048)]),
np.asarray([np.arange(0, 2048) for _ in range(2048)]).T,
],
)
mc.inverse_dfield = dummy_inv_dfield
mc.add_features(features=features, rotsym=6)
mc.spline_warp_estimate()
mc.pose_adjustment(**transformations, apply=True)
# disable re-calculation of inverse defield to save time, as we are just testing meta data here
mc.dfield_updated = False
df, metadata = mc.apply_corrections(df=df)
assert "Xm" in df.columns
assert "Ym" in df.columns
Expand Down