Skip to content

Commit

Permalink
Add travis wait command
Browse files Browse the repository at this point in the history
  • Loading branch information
eurunuela committed Aug 12, 2020
2 parents dcae018 + aa888d8 commit 29413b7
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ before_install:
pip install flake8;
fi
- if [ "${CHECK_TYPE}" == "test" ]; then
pip install "pytest>=4.6" pytest-cov coverage coveralls codecov;
pip install "pytest>=5.3" pytest-cov coverage coveralls codecov;
fi
- if [ "${CHECK_TYPE}" == "docdoctest" ]; then
pip install "sphinx>2.0" sphinx_rtd_theme pandas sphinx-argparse;
Expand Down
6 changes: 3 additions & 3 deletions phys2bids/cli/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ def _get_parser():
dest='chtrig',
type=int,
help='The column number of the trigger channel. '
'Channel numbering starts with 0. '
'Default is 0.',
default=0)
'Channel numbering starts with 1. '
'Default is 1.',
default=1)
optional.add_argument('-chsel', '--channel-selection',
dest='chsel',
nargs='*',
Expand Down
14 changes: 10 additions & 4 deletions phys2bids/interfaces/acq.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,29 @@ def populate_phys_input(filename, chtrig):
filename: str
path to the txt labchart file
chtrig : int
index of trigger channel
index of trigger channel.
!!! ATTENTION: IT'S MEANT TO REPRESENT AN INDEX STARTING FROM 1 !!!
Returns
-------
BlueprintInput
Note
----
chtrig is not a 0-based Python index - instead, it's human readable (i.e., 1-based).
This is handy because, when initialising the class, a new channel corresponding
to time is added at the beginning - that is already taken into account!
See Also
--------
physio_obj.BlueprintInput
"""

with warnings.catch_warnings():
warnings.filterwarnings('ignore', category=DeprecationWarning)
data = read_file(filename).channels

freq = [data[chtrig].samples_per_second, ]
timeseries = [data[chtrig].time_index, ]
freq = [data[chtrig - 1].samples_per_second, ]
timeseries = [data[chtrig - 1].time_index, ]
units = ['s', ]
names = ['time', ]

Expand Down
5 changes: 4 additions & 1 deletion phys2bids/phys2bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def print_json(outfile, samp_freq, time_offset, ch_name):
description='The BIDS specification',
cite_module=True)
def phys2bids(filename, info=False, indir='.', outdir='.', heur_file=None,
sub=None, ses=None, chtrig=0, chsel=None, num_timepoints_expected=None,
sub=None, ses=None, chtrig=1, chsel=None, num_timepoints_expected=None,
tr=None, thr=None, pad=9, ch_name=[], yml='', debug=False, quiet=False):
"""
Run main workflow of phys2bids.
Expand Down Expand Up @@ -191,6 +191,9 @@ def phys2bids(filename, info=False, indir='.', outdir='.', heur_file=None,
# Check options to make them internally coherent pt. II
# #!# This can probably be done while parsing?
indir = utils.check_input_dir(indir)
if chtrig < 1:
raise Exception('Wrong trigger channel. Channel indexing starts with 1!')

filename, ftype = utils.check_input_type(filename,
indir)

Expand Down
6 changes: 6 additions & 0 deletions phys2bids/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,9 @@ def multifreq_lab_file(testpath):
def notime_lab_file(testpath):
return fetch_file('cv5zr', testpath,
'Test2_samefreq_onescan_notime.txt')


@pytest.fixture
def multi_run_file(testpath):
return fetch_file('gvy84', testpath,
'Test2_samefreq_TWOscans.txt')
2 changes: 1 addition & 1 deletion phys2bids/tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,4 +221,4 @@ def test_integration_multirun(multi_run_file):
base_filename = 'Test2_samefreq_TWOscans_'
for run in ['1', '2']:
assert isfile(join(conversion_path, f'Test2_samefreq_TWOscans_{run}_trigger_time.png'))
assert isfile(join(conversion_path, 'Test2_samefreq_TWOscans.png'))
assert isfile(join(conversion_path, 'Test2_samefreq_TWOscans.png'))
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ install_requires =
matplotlib >=3.1.1, !=3.3.0rc1
PyYAML !=*rc*
tests_require =
pytest >=3.6
pytest >=5.3
test_suite = pytest
zip_safe = False
packages = find:
Expand Down

0 comments on commit 29413b7

Please sign in to comment.