History

[py] add helper to check if we are on a 32bit system

Paul Brossier committed 7 years ago

Commit f912e901 parent 50392441 file · +4 −0Browse files

Showing the changes to python (1 of 1 file). Show all

Unified · Split

python/tests/utils.py+4−0
@@ -3,11 +3,15 @@ · 2 unmodified lines
3import os3import os
4import re4import re
5import glob5import glob
6import struct
6import numpy as np7import numpy as np
7from tempfile import mkstemp8from tempfile import mkstemp
8 9
9DEFAULT_SOUND = '22050Hz_5s_brownnoise.wav'10DEFAULT_SOUND = '22050Hz_5s_brownnoise.wav'
10 11
12def is32bit():
13 return struct.calcsize("P") * 8 == 32
14
11def array_from_text_file(filename, dtype = 'float'):15def array_from_text_file(filename, dtype = 'float'):
12 realpathname = os.path.join(os.path.dirname(__file__), filename)16 realpathname = os.path.join(os.path.dirname(__file__), filename)
13 return np.loadtxt(realpathname, dtype = dtype)17 return np.loadtxt(realpathname, dtype = dtype)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t