File: testFastCDF.py

package info (click to toggle)
stopt 5.5%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 8,772 kB
  • sloc: cpp: 70,373; python: 5,942; makefile: 67; sh: 57
file content (29 lines) | stat: -rw-r--r-- 689 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/python3

# Copyright (C) 2020 EDF
# All Rights Reserved
# This code is published under the GNU Lesser General Public License (GNU LGPL)
import numpy as np
import unittest

# unit test for fast CDF on grid
################################

class testFastCDF(unittest.TestCase):
    def test2D(self):
        
        import StOptCDF
        nbSimul = 100000
        x = np.random.normal(size=(2,nbSimul));
        # y =1 for simple CDF
        y =  np.ones([nbSimul])

        # define the grid (same in both dimension)
        z1= -2 + 4*np.arange(20)/20
        z = [z1,z1]
        z = StOptCDF.fastCDF(x,z,y)
        
        

if __name__ == '__main__': 
    unittest.main()