Skip to content

Commit

Permalink
Modify first argument to be file path
Browse files Browse the repository at this point in the history
Add comments about parameter arguments
Cast string to Path before using .exists
  • Loading branch information
sinhaharsh committed Feb 21, 2024
1 parent eae290a commit 98207f8
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions protocol/imaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -2028,8 +2028,18 @@ def import_string(dotted_path):
class BidsImagingSequence(ImagingSequence):
"""
Class representing an Imaging sequence for BIDS datasets
Parameters
----------
bidsfile : Path or str
Path to the BIDS JSON file
name : str
Name of the sequence
path : Path or str
Path to the folder containing the files
"""
def __init__(self, name='MRI', bidsfile=None,

def __init__(self, bidsfile=None, name='MRI',
path=None):
"""constructor"""
super().__init__(name=name, path=path)
Expand Down Expand Up @@ -2076,7 +2086,7 @@ def set_img_path(self, path):

def parse(self, bidsfile, params=None):
"""Parses the parameter values from a given BIDS JSON object or file."""

bidsfile = Path(bidsfile)
if self.parameters is None:
if params is None:
raise ValueError('imaging_params must be provided either during'
Expand Down Expand Up @@ -2128,8 +2138,8 @@ class DicomImagingSequence(ImagingSequence):
"""

def __init__(self,
name='MRI',
dicom=None,
name='MRI',
imaging_params=None,
required_params=None,
store_demographics=True,
Expand Down

0 comments on commit 98207f8

Please sign in to comment.