Skip to content

Commit a340e3d

Browse files
committed
minor fixes
1 parent e8b111c commit a340e3d

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

eeg_positions/compute.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ def get_elec_coords(
341341
elec_names_replaced[alias] = name
342342
else:
343343
# however, some cases are specified using an "alias+(x, y, z)" format
344-
# we compute these electrode as the last positions (special treatment)
344+
# we compute these electrodes as the last positions (special treatment)
345345
assert "+(" in alias
346346
elec_names_special.append(alias)
347347
alias_name, _ = alias.split("+")

examples/use_elec_names.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
""" # noqa: D400 D205
88

99
# %%
10-
# We need to import some functions
10+
# We need to import some functions:
1111

1212
from pprint import pprint
1313

@@ -27,11 +27,10 @@
2727

2828
# %%
2929
# A keen eye may have identified some "odd" electrodes, that are not really part
30-
# of the 10-20, 10-10, or 10-05 systems: ``'A1', 'A2', 'M1', 'M2'``
30+
# of the 10-20, 10-10, or 10-05 systems. For example: ``'A1', 'M1'``
3131
#
32-
# These are supplied with ``eeg_positions`` for convenience as so-called "alias"
33-
# positions. See below:
34-
32+
# These and others are supplied with ``eeg_positions`` for convenience as so-called
33+
# "alias" positions. See below:
3534

3635
alias_mapping = get_alias_mapping()
3736
for key, val in alias_mapping.items():
@@ -49,13 +48,14 @@
4948
# electrodes!**
5049

5150
# Just use `elec_names`
51+
elec_names = ["A1", "A2", "FC3", "CP4", "M1", "LPA", "RPA", "T10"]
5252
coords = get_elec_coords(
53-
elec_names=["A1", "A2", "FC3", "CP4", "M1", "LPA", "RPA", "T10"],
53+
elec_names=elec_names,
5454
drop_landmarks=False,
5555
dim="3d",
5656
)
5757

58-
coords.head()
58+
coords.head(n=len(elec_names))
5959

6060
# %%
6161
# Plot it, and see how close LPA and A1 (and RPA and A2) are in space.

examples/use_mne.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
For more information, check out these MNE resources:
77
88
- https://mne.tools/dev/auto_tutorials/intro/plot_40_sensor_locations.html
9-
- https://mne.tools/dev/auto_examples/visualization/plot_eeglab_head_sphere.html
109
1110
.. currentmodule:: eeg_positions
1211
""" # noqa: D400 D205
@@ -31,8 +30,8 @@
3130

3231
# %%
3332
# Now let's have a look at plotting this in 3D.
33+
# But let's pick a system that has fewer electrodes.
3434

35-
# but let's pick a system that has fewer electrodes
3635
coords = get_elec_coords(system="1010", as_mne_montage=True)
3736

3837
fig = coords.plot(kind="3d")

tests/test_compute.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def test_get_elec_coords(
4141
)
4242

4343
if not as_mne_montage:
44+
# out is pd.DataFrame, assert there are no NaNs in any cell
4445
assert (out.isnull().sum() == 0).all()
4546

4647

0 commit comments

Comments
 (0)