source: sasview/Invariant/invariant_mapper.py @ 3e41f43

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalccostrafo411magnetic_scattrelease-4.1.1release-4.1.2release-4.2.2release_4.0.1ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change on this file since 3e41f43 was 5797edc, checked in by Gervaise Alina <gervyh@…>, 14 years ago

working on invariant mapper. pylint score 6/10 need require method instead of function

  • Property mode set to 100644
File size: 1.9 KB
Line 
1"""
2This module is a wrapper to a map function. It allows to loop through
3different invariant objects to call the same function
4"""
5
6class 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   
Note: See TracBrowser for help on using the repository browser.