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

Remove redundant integration tests #259

Merged
merged 3 commits into from
Jun 19, 2020
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
71 changes: 71 additions & 0 deletions phys2bids/heuristics/heur_test_multifreq.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import fnmatch


def heur(physinfo):
"""
Set of if .. elif statements to fill BIDS names.

It requires the user (you!) to adjust it accordingly!
It needs an ``if`` or ``elif`` statement for each file that
needs to be processed.
The statement will test if the ``physinfo``:
- is similar to a string (first case), or
- exactly matches a string (second case).

Parameters
----------
physinfo: str
Name of an input file that should be bidsified (See Notes)

Returns
-------
info: dictionary of str
Dictionary containing BIDS keys

Notes
-----
The `if ..` structure should always be similar to
```
if physinfo == 'somepattern':
info['var'] = 'somethingelse'
```
or, in case it's a partial match
```
if fnmatch.fnmatchcase(physinfo, '*somepattern?'):
info['var'] = 'somethingelse'
```
Where:
- `physinfo` and `info` are dedicated keywords,
- 'somepattern' is the name of the file,
- 'var' is a bids key in the list below
- 'somethingelse' is the value of the key
"""
info = {}
# ################################# #
# ## Modify here! ## #
# ## ## #
# ## Possible variables are: ## #
# ## -info['task'] (required) ## #
# ## -info['run'] ## #
# ## -info['rec'] ## #
# ## -info['acq'] ## #
# ## -info['dir'] ## #
# ## ## #
# ## Remember that they are ## #
# ## dictionary keys ## #
# ## See example below ## #
# ################################# #

if fnmatch.fnmatchcase(physinfo, '*onescan*'):
info['task'] = 'test'
info['run'] = '01'
info['rec'] = 'biopac'
elif physinfo == 'Example':
info['task'] = 'rest'
info['run'] = '01'
info['acq'] = 'resp'

# ############################## #
# ## Don't modify below this! ## #
# ############################## #
return info
Loading