Skip to content

Commit

Permalink
Minor PEP 8 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
pvelasco committed Nov 25, 2020
1 parent b20af7a commit 92c016e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions bidsphysio.base/bidsphysio/base/bidsphysio.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def calculate_timing( self ):
Calculate the recording timing, based on the physiostarttime
and the sampling rate
"""
if self.samples_per_second == None or self.physiostarttime == None:
if self.samples_per_second is None or self.physiostarttime is None:
raise ValueError('Unable to calculate the recording timing')
else:
self.sampling_times = [self.physiostarttime + i/self.samples_per_second for i in range(len(self.signal))]
Expand All @@ -141,7 +141,7 @@ def calculate_trigger_events(self, t_trig):
sampling_times = np.array(self.sampling_times)
trig_signal = np.full( np.shape(self.signal), False ) # initialize to "False"
for t in t_trig:
if t >= self.sampling_times[0] and t <= self.sampling_times[-1]:
if self.sampling_times[0] <= t <= self.sampling_times[-1]:
trig_signal[np.argmax( sampling_times >= t )] = True
return trig_signal

Expand Down
4 changes: 2 additions & 2 deletions bidsphysio.base/tests/test_bidsphysio.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ def test_calculate_trigger_events(
assert PhysioSignal(
label='simulated',
physiostarttime=PHYSIO_START_TIME
).calculate_trigger_events(trigger_timing) == None
).calculate_trigger_events(trigger_timing) is None
assert capfd.readouterr().out == "Unable to calculate the recording timing\n"

# 2) Run it succesfully:
# 2) Run it successfully:
# calculate trigger events:
trig_signal = mySignal.calculate_trigger_events(trigger_timing)

Expand Down
2 changes: 1 addition & 1 deletion bidsphysio.dcm2bids/bidsphysio/dcm2bids/dcm2bidsphysio.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
PhysioData)


def dcm2bids( physio_dcm, verbose=False ):
def dcm2bids(physio_dcm, verbose=False):
"""Reads the physiological data from either a CMRR DICOM file or
from a series of CMRR .log files and stores it in a PhysioData
member.
Expand Down

0 comments on commit 92c016e

Please sign in to comment.