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

Fixing the vonmises distribution tests in test_diffusion #1279

Merged
merged 5 commits into from
Jan 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
4 changes: 4 additions & 0 deletions .github/workflows/ci-workflow-integrationtests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@master
- name: Configure pagefile
uses: al-cheb/configure-pagefile-action@v1.2
with:
minimum-size: 8GB
- name: Test Windows
env:
OS_NAME: win
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ci-workflow-unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@master
- name: Configure pagefile
uses: al-cheb/configure-pagefile-action@v1.2
with:
minimum-size: 8GB
- name: Test Windows
env:
OS_NAME: win
Expand Down
7 changes: 4 additions & 3 deletions tests/test_diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ def vonmises(particle, fieldset, time):
angles = np.array([p.angle for p in pset])

assert np.allclose(np.mean(angles), mu, atol=.1)
scipy_mises = stats.vonmises.rvs(kappa, loc=mu, size=10000)
assert np.allclose(np.mean(angles), np.mean(scipy_mises), atol=.1)
assert np.allclose(np.std(angles), np.std(scipy_mises), atol=.1)
vonmises_mean = stats.vonmises.mean(kappa=kappa, loc=mu)
assert np.allclose(np.mean(angles), vonmises_mean, atol=.1)
vonmises_var = stats.vonmises.var(kappa=kappa, loc=mu)
assert np.allclose(np.var(angles), vonmises_var, atol=.1)