Skip to content

Commit

Permalink
fix: move actual function to test wrapper (#74)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
Glatzel and pre-commit-ci[bot] authored Nov 2, 2024
1 parent a0f47d1 commit 7fda332
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,9 @@ jobs:

pytest-arithmetic:
uses: Glatzel/template/.github/workflows/pytest.yml@main
strategy:
matrix:
os: [windows-latest]
with:
name: test
machine: ${{matrix.os}}
machine: windows-latest
cache_write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
pixi_python_env: arithmetic-cpu
test_path: ./src/arithmetic
Expand Down
13 changes: 6 additions & 7 deletions src/arithmetic/test_datum_compense_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@ def sample_coords(request):
return 10**request.param, 2821940.796, 469704.6693, 400.0


def foo(x1, y1, h1):
q = h1 / 6378_137
factor = q / (1 + q)
x1 = x1 - factor * (x1 - 500000)
y1 = y1 - factor * (y1 - 0)


def test_python(benchmark, sample_coords):
def foo(x1, y1, h1):
q = h1 / 6378_137
factor = q / (1 + q)
x1 = x1 - factor * (x1 - 500000)
y1 = y1 - factor * (y1 - 0)

def loop(n, x, y, h):
for _ in range(n):
foo(x, y, h)
Expand Down

0 comments on commit 7fda332

Please sign in to comment.