Skip to content

Commit

Permalink
implement tests_data_path in atomic
Browse files Browse the repository at this point in the history
  • Loading branch information
mishinma committed Jul 21, 2016
1 parent ed4854e commit 4a6fb5f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion tardis/io/atomic.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@ class AtomDataNotPreparedError(Exception):

logger = logging.getLogger(__name__)

tardis_dir = os.path.dirname(os.path.realpath(tardis.__file__))

def data_path(fname):
tardis_dir = os.path.dirname(os.path.realpath(tardis.__file__))
return os.path.join(tardis_dir, 'data', fname)

def tests_data_path(fname):
return os.path.join(tardis_dir, 'tests', 'data', fname)


default_atom_h5_path = data_path('atom_data.h5')
atomic_symbols_data = np.recfromtxt(data_path('atomic_symbols.dat'),
Expand Down
2 changes: 1 addition & 1 deletion tardis/io/tests/test_atomic.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def default_atom_h5_path():

@pytest.fixture(scope="module")
def chianti_he_db_h5_path():
return atomic.data_path('chianti_he_db.h5')
return atomic.tests_data_path('chianti_he_db.h5')


def test_data_path():
Expand Down

0 comments on commit 4a6fb5f

Please sign in to comment.