File tree Expand file tree Collapse file tree 5 files changed +8
-8
lines changed
Expand file tree Collapse file tree 5 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 1+ make :func: `mne.sys_info ` work on Windows systems with Powershell version 7+, by `Marijn van Vliet `_
Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change @@ -681,11 +681,9 @@ def _get_gpu_info():
681681def _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():
708706def _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" :
Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments