1 | """ |
---|
2 | This module is a wrapper to a map function. It allows to loop through |
---|
3 | different invariant objects to call the same function |
---|
4 | """ |
---|
5 | |
---|
6 | class InvariantMapper: |
---|
7 | """ |
---|
8 | Wrapper for invariant module for map interface |
---|
9 | """ |
---|
10 | def __init__(self): |
---|
11 | """ |
---|
12 | Initialize the wrapper |
---|
13 | """ |
---|
14 | def get_qstar(self, inv, extrapolation=None): |
---|
15 | """ |
---|
16 | Get invariant value (Q*) |
---|
17 | """ |
---|
18 | return inv.get_qstar(extrapolation) |
---|
19 | |
---|
20 | def get_qstar_with_error(self, inv, extrapolation=None): |
---|
21 | """ |
---|
22 | Get invariant value with uncertainty |
---|
23 | """ |
---|
24 | return inv.get_qstar_with_error(extrapolation) |
---|
25 | |
---|
26 | def get_volume_fraction(self, inv, contrast, extrapolation=None): |
---|
27 | """ |
---|
28 | Get volume fraction |
---|
29 | """ |
---|
30 | return inv.get_volume_fraction(contrast, extrapolation) |
---|
31 | |
---|
32 | def get_volume_fraction_with_error(self, inv, contrast, extrapolation=None): |
---|
33 | """ |
---|
34 | Get volume fraction with uncertainty |
---|
35 | """ |
---|
36 | return inv.get_volume_fraction_with_error(contrast, |
---|
37 | extrapolation) |
---|
38 | |
---|
39 | def get_surface(self, inv, contrast, porod_const, extrapolation=None): |
---|
40 | """ |
---|
41 | Get surface with uncertainty |
---|
42 | """ |
---|
43 | return inv.get_surface(contrast=contrast, |
---|
44 | porod_const=porod_const, |
---|
45 | extrapolation=extrapolation) |
---|
46 | |
---|
47 | def get_surface_with_error(self, inv, contrast, |
---|
48 | porod_const, extrapolation=None): |
---|
49 | """ |
---|
50 | Get surface with uncertainty |
---|
51 | """ |
---|
52 | return inv.get_surface_with_error(contrast=contrast, |
---|
53 | porod_const=porod_const, |
---|
54 | extrapolation=extrapolation) |
---|
55 | |
---|
56 | |
---|