forked from Auto-Mech/mechanalyzer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxarray_wrappers_test.py
51 lines (40 loc) · 1.14 KB
/
xarray_wrappers_test.py
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import xarray_wrappers
import xarray
import numpy
temps = [1000, 1500, 2000, 2500]
press = [1, 10, numpy.inf]
ktp_vals = [[1e1, 1e2, 1e3, 1e4], [1e5, 1e6, 1e7, 1e8], [1e9, 1e10, 1e11, 1e12]]
ktp = xarray_wrappers.from_data(temps, press, ktp_vals)
print(ktp)
def test_get_temperatures():
temp = xarray_wrappers.get_temperatures(ktp)
print(temp)
def test_get_pressures():
pres = xarray_wrappers.get_pressures(ktp)
print(pres)
def test_get_values():
vals = xarray_wrappers.get_values(ktp)
print(vals)
def test_get_pslice():
pslice = xarray_wrappers.get_pslice(ktp)
print(pslice)
def test_get_tslice():
tslice = xarray_wrappers.get_tslice(ktp)
print(tslice)
def test_get_spec_vals():
vals = xarray_wrappers.get_spec_vals(ktp, temp = 1500, pres = 1)
print(vals)
def test_get_ipslice():
ipslice = xarray_wrappers.get_ipslice(ktp, i = 0)
print(ipslice)
def test_get_itslice():
itslice = xarray_wrappers.get_itslice(ktp, i = 0)
print(itslice)
test_get_temperatures()
test_get_pressures()
test_get_values()
test_get_pslice()
test_get_tslice()
test_get_spec_vals()
test_get_ipslice()
test_getitslice()