Skip to content

Commit

Permalink
Move the extinction curve test to tests/
Browse files Browse the repository at this point in the history
  • Loading branch information
jobovy committed Feb 27, 2023
1 parent 63b4c45 commit e2f68bf
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 16 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,9 @@ jobs:
DUST_DIR: ${{github.workspace}}/data/
run: |
pip install .
- name: Test package
env:
DUST_DIR: ${{github.workspace}}/data/
run: |
pip install pytest hypothesis
pytest -v tests/
16 changes: 0 additions & 16 deletions nose/test_drimmel03.py

This file was deleted.

20 changes: 20 additions & 0 deletions tests/test_extcurve.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from datetime import timedelta
from hypothesis import given, strategies, settings
import numpy

@given(strategies.floats(min_value=0.,max_value=360.,
allow_nan=False,allow_infinity=False),
strategies.floats(min_value=-90.,max_value=90.,
allow_nan=False,allow_infinity=False),
strategies.floats(min_value=0.,max_value=20.,
allow_nan=False,allow_infinity=False))
@settings(max_examples=20,
deadline=timedelta(milliseconds=100000))
def test_avebv(ll,bb,dist):
# Simple test of the extinction curve, using Drimmel03 as an example
# Test that A_V/E(B-V) = 3.1 for the CTIO V filter
from mwdust import Drimmel03
drim_av= Drimmel03(filter='CTIO V')
drim_ebv= Drimmel03()
assert numpy.fabs(drim_av(ll,bb,dist)/drim_ebv(ll,bb,dist)/0.86-3.1) < 0.02
return None

0 comments on commit e2f68bf

Please sign in to comment.