Skip to content

Commit 9ac8139

Browse files
committed
Merge branch 'release'
2 parents 09b41dd + 97639b0 commit 9ac8139

File tree

2 files changed

+30
-20
lines changed

2 files changed

+30
-20
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## [1.1.3] - 2025-11-25
4+
5+
### Hotfix
6+
7+
- fixed wrong channel data in IGB files (Robert Arnold)
8+
39
## [1.1.2] - 2025-05-20
410

511
### Added
@@ -222,6 +228,7 @@ _This release was yanked on PyPi due to a missing file._
222228

223229
_Initial release._
224230

231+
[1.1.3]: https://github.com/medunigraz/pyCEPS/releases/tag/1.1.3
225232
[1.1.2]: https://github.com/medunigraz/pyCEPS/releases/tag/1.1.2
226233
[1.1.1]: https://github.com/medunigraz/pyCEPS/releases/tag/1.1.1
227234
[1.1.0]: https://github.com/medunigraz/pyCEPS/releases/tag/1.1.0

pyceps/study.py

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
)
4242
from pyceps.datatypes.signals import Trace
4343
from pyceps.visualize import get_dash_app
44+
from pyceps.utils import console_progressbar
4445

4546

4647
TEPStudy = TypeVar('TEPStudy', bound='EPStudy') # workaround to type hint self
@@ -916,37 +917,39 @@ def export_point_ecg(
916917
output_folder = self.resolve_export_folder(output_folder)
917918
basename = os.path.join(output_folder, self.name)
918919

919-
# prepare data
920-
data = np.full((len(points), 2500, len(which)),
921-
np.nan,
922-
dtype=np.float32)
923-
924-
# append point ECG data
925-
for i, point in enumerate(points):
926-
point_data = np.array(
927-
[t.data for t in point.ecg for chn in which if t.name == chn]
928-
)
929-
data[i, :, :] = point_data.T
930-
931-
# save data channel-wise
932920
writer = FileWriter()
933-
for i, channel in enumerate(which):
934-
channel_data = data[:, :, i]
921+
for n, chn in enumerate(which):
922+
# prepare data
923+
data = np.full((len(points), 2500),
924+
np.nan,
925+
dtype=np.float32)
926+
927+
for i, point in enumerate(points):
928+
point_data = np.array(
929+
[t.data for t in point.ecg if (t.name == chn)]
930+
)
931+
data[i, :] = point_data
932+
935933
# save data to igb
936934
# Note: this file cannot be loaded with the CARTO mesh but rather
937935
# with the exported mapped nodes
938-
header = {'x': channel_data.shape[0],
939-
't': channel_data.shape[1],
936+
header = {'x': data.shape[0],
937+
't': data.shape[1],
940938
'unites_t': 'ms',
941939
'unites': 'mV',
942940
'dim_t': data.shape[1] - 1,
943941
'org_t': 0,
944942
'inc_t': 1
945943
}
946944

947-
filename = '{}.ecg.{}.pc.igb'.format(basename, channel)
948-
f = writer.dump(filename, header, channel_data)
949-
log.info('exported ecg trace {} to {}'.format(channel, f))
945+
filename = '{}.ecg.{}.pc.igb'.format(basename, chn)
946+
f = writer.dump(filename, header, data)
947+
948+
# update progress bar
949+
console_progressbar(
950+
n + 1, len(which),
951+
suffix='exported ecg trace {} to {}'.format(chn, f)
952+
)
950953

951954
return
952955

0 commit comments

Comments
 (0)