Skip to content

Commit 27f6488

Browse files
authored
Merge branch 'main' into main
2 parents a84070e + 7518f98 commit 27f6488

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

doc/changes/dev/13593.other.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
make :func:`mne.sys_info` work on Windows systems with Powershell version 7+, by `Marijn van Vliet`_

mne/io/egi/events.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def _read_mff_events(filename, sfreq):
6868
marker = {
6969
"name": event["code"],
7070
"start": start,
71-
"start_sample": int(np.fix(start * sfreq)),
71+
"start_sample": int(np.trunc(start * sfreq)),
7272
"end": start + float(event["duration"]) / 1e9,
7373
"chan": None,
7474
}

mne/preprocessing/infomax_.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ def infomax(
247247
oldsigns = signs
248248

249249
if signcount >= signcount_threshold:
250-
ext_blocks = np.fix(ext_blocks * signcount_step)
250+
ext_blocks = np.trunc(ext_blocks * signcount_step)
251251
signcount = 0
252252

253253
# here we continue after the for loop over the ICA training blocks

mne/utils/config.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -681,11 +681,9 @@ def _get_gpu_info():
681681
def _get_total_memory():
682682
"""Return the total memory of the system in bytes."""
683683
if platform.system() == "Windows":
684+
ps = shutil.which("pwsh") or shutil.which("powershell")
684685
o = subprocess.check_output(
685-
[
686-
"powershell.exe",
687-
"(Get-CimInstance Win32_ComputerSystem).TotalPhysicalMemory",
688-
]
686+
[ps, "-c", "(Get-CimInstance Win32_ComputerSystem).TotalPhysicalMemory"]
689687
).decode()
690688
# Can get for example a "running scripts is disabled on this system"
691689
# error where "o" will be a long string rather than an int
@@ -708,8 +706,9 @@ def _get_total_memory():
708706
def _get_cpu_brand():
709707
"""Return the CPU brand string."""
710708
if platform.system() == "Windows":
709+
ps = shutil.which("pwsh") or shutil.which("powershell")
711710
o = subprocess.check_output(
712-
["powershell.exe", "(Get-CimInstance Win32_Processor).Name"]
711+
[ps, "-c", "(Get-CimInstance Win32_Processor).Name"]
713712
).decode()
714713
cpu_brand = o.strip().splitlines()[-1]
715714
elif platform.system() == "Linux":

mne/viz/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1926,7 +1926,7 @@ def _setup_ax_spines(
19261926

19271927
def log_fix(tval):
19281928
exp = np.log10(np.abs(tval))
1929-
return np.sign(tval) * 10 ** (np.fix(exp) - (exp < 0))
1929+
return np.sign(tval) * 10 ** (np.trunc(exp) - (exp < 0))
19301930

19311931
xlims = np.array([xmin, xmax])
19321932
temp_ticks = log_fix(xlims)

0 commit comments

Comments
 (0)