File: test_python.pro

package info (click to toggle)
gnudatalanguage 0.9.9-13
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 17,892 kB
  • sloc: cpp: 167,389; ansic: 9,358; sh: 566; python: 472; makefile: 252; 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