Skip to content

Commit 14021af

Browse files
author
Alin G. Chitu
committed
code reformat with automatic function
1 parent b046cff commit 14021af

1 file changed

Lines changed: 41 additions & 41 deletions

File tree

src/pyxdf/pyxdf.py

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -73,21 +73,21 @@ def __init__(self, xml):
7373

7474

7575
def load_xdf(
76-
filename,
77-
select_streams=None,
78-
*,
79-
on_chunk=None,
80-
synchronize_clocks=True,
81-
handle_clock_resets=True,
82-
dejitter_timestamps=True,
83-
jitter_break_threshold_seconds=1,
84-
jitter_break_threshold_samples=500,
85-
clock_reset_threshold_seconds=5,
86-
clock_reset_threshold_stds=5,
87-
clock_reset_threshold_offset_seconds=1,
88-
clock_reset_threshold_offset_stds=10,
89-
winsor_threshold=0.0001,
90-
verbose=None,
76+
filename,
77+
select_streams=None,
78+
*,
79+
on_chunk=None,
80+
synchronize_clocks=True,
81+
handle_clock_resets=True,
82+
dejitter_timestamps=True,
83+
jitter_break_threshold_seconds=1,
84+
jitter_break_threshold_samples=500,
85+
clock_reset_threshold_seconds=5,
86+
clock_reset_threshold_stds=5,
87+
clock_reset_threshold_offset_seconds=1,
88+
clock_reset_threshold_offset_stds=10,
89+
winsor_threshold=0.0001,
90+
verbose=None,
9191
):
9292
"""Import an XDF file.
9393
@@ -513,7 +513,7 @@ def _xml2dict(t):
513513

514514
def _scan_forward(f):
515515
"""Scan forward through file object until after the next boundary chunk."""
516-
blocklen = 2**20
516+
blocklen = 2 ** 20
517517
signature = bytes(
518518
[
519519
0x43,
@@ -587,10 +587,10 @@ def _segment_clock_diff(diff, thresh_stds, thresh_secs):
587587

588588

589589
def _detect_corrupted_clock_offset(
590-
clock_times,
591-
clock_values,
592-
time_thresh=10.0,
593-
value_thresh=10.0,
590+
clock_times,
591+
clock_values,
592+
time_thresh=10.0,
593+
value_thresh=10.0,
594594
):
595595
"""Detect if the last clock offset entry is statistically anomalous.
596596
@@ -736,11 +736,11 @@ def _truncate_corrupted_offsets(temp, streams):
736736

737737

738738
def _detect_clock_resets(
739-
stream,
740-
time_thresh_stds,
741-
time_thresh_secs,
742-
value_thresh_stds,
743-
value_thresh_secs,
739+
stream,
740+
time_thresh_stds,
741+
time_thresh_secs,
742+
value_thresh_stds,
743+
value_thresh_secs,
744744
):
745745
# First detect potential breaks in the synchronization data; this is
746746
# only necessary when the importer should be able to deal with
@@ -778,13 +778,13 @@ def _detect_clock_resets(
778778

779779

780780
def _clock_sync(
781-
streams,
782-
handle_clock_resets=True,
783-
reset_threshold_stds=5,
784-
reset_threshold_seconds=5,
785-
reset_threshold_offset_stds=10,
786-
reset_threshold_offset_seconds=1,
787-
winsor_threshold=0.0001,
781+
streams,
782+
handle_clock_resets=True,
783+
reset_threshold_stds=5,
784+
reset_threshold_seconds=5,
785+
reset_threshold_offset_stds=10,
786+
reset_threshold_offset_seconds=1,
787+
winsor_threshold=0.0001,
788788
):
789789
for stream_id, stream in streams.items():
790790
if len(stream.time_stamps) > 0:
@@ -882,7 +882,7 @@ def _clock_sync(
882882
ts_slice = slice(ts_start, ts_stop)
883883
ts_start = ts_stop
884884
stream.time_stamps[ts_slice] += (
885-
coef_i[0] + coef_i[1] * stream.time_stamps[ts_slice]
885+
coef_i[0] + coef_i[1] * stream.time_stamps[ts_slice]
886886
)
887887
return streams
888888

@@ -913,9 +913,9 @@ def _stream_can_drop_samples(stream_meta):
913913

914914
synchronization = desc[0].get("synchronization")
915915
if (
916-
not isinstance(synchronization, list)
917-
or len(synchronization) == 0
918-
or not isinstance(synchronization[0], dict)
916+
not isinstance(synchronization, list)
917+
or len(synchronization) == 0
918+
or not isinstance(synchronization[0], dict)
919919
):
920920
return False
921921

@@ -927,10 +927,10 @@ def _stream_can_drop_samples(stream_meta):
927927

928928

929929
def _jitter_removal(
930-
streams,
931-
threshold_seconds=1,
932-
threshold_samples=500,
933-
stream_headers=None,
930+
streams,
931+
threshold_seconds=1,
932+
threshold_samples=500,
933+
stream_headers=None,
934934
):
935935
for stream_id, stream in streams.items():
936936
stream.effective_srate = 0 # will be recalculated if possible
@@ -945,7 +945,7 @@ def _jitter_removal(
945945
# dejittering because it compresses dropped-frame intervals and can shift
946946
# the segment start substantially earlier.
947947
if _stream_can_drop_samples(
948-
None if stream_headers is None else stream_headers.get(stream_id)
948+
None if stream_headers is None else stream_headers.get(stream_id)
949949
):
950950
stream.segments.append((0, nsamples - 1)) # inclusive
951951
if nsamples > 1:

0 commit comments

Comments
 (0)