annotate tests/common.py @ 93:36c141f0f0bd default tip

add tensorflow dependency + console scripts
author Jeff Hammel <k0scist@gmail.com>
date Sun, 17 Dec 2017 14:31:35 -0800
parents 4f197c057e26
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
63
b911a7c01727 add test common functionality
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
1 """
b911a7c01727 add test common functionality
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
2 testing common
b911a7c01727 add test common functionality
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
3 """
b911a7c01727 add test common functionality
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
4
b911a7c01727 add test common functionality
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
5 import os
78
4f197c057e26 namespace issues
Jeff Hammel <k0scist@gmail.com>
parents: 63
diff changeset
6 from tvii import read
63
b911a7c01727 add test common functionality
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
7
b911a7c01727 add test common functionality
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
8 here = os.path.dirname(os.path.abspath(__file__))
b911a7c01727 add test common functionality
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
9 data = os.path.join(here, 'data')
b911a7c01727 add test common functionality
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
10
b911a7c01727 add test common functionality
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
11 def datafile(*path):
b911a7c01727 add test common functionality
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
12 """returns path within `tests/data`"""
b911a7c01727 add test common functionality
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
13
b911a7c01727 add test common functionality
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
14 return os.path.join(data, *path)
b911a7c01727 add test common functionality
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
15
b911a7c01727 add test common functionality
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
16 def load(*path, **kwargs):
b911a7c01727 add test common functionality
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
17 """load a data file"""
b911a7c01727 add test common functionality
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
18
b911a7c01727 add test common functionality
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
19 return read.read(datafile(*path), **kwargs)
b911a7c01727 add test common functionality
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
20