File: test_python.pro

package info (click to toggle)
gnudatalanguage 1.1.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 80,368 kB
  • sloc: cpp: 189,797; ansic: 46,721; sh: 677; python: 474; makefile: 146; xml: 69; f90: 28
file content (18 lines) | stat: -rw-r--r-- 481 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
pro test_python

  has_python = ~ (execute("python, 'numpy'") eq 0)  
  if ~ has_python then exit, status=77

  ; testing numpy/scalar return
  if abs(python("numpy", "arccos", .5) - acos(.5)) gt 1e-6 then begin
    message, /conti, 'numpy.arccos(.5) != acos(.5)'
    exit, status=1
  endif

  ; testing numpy/array return
  if ~array_equal(python("numpy", "arange", 5.), findgen(5)) then begin
    message, /conti, 'numpy.arange(5.) != findgen(5)'
    exit, status=1
  endif

end