Example #1
0
    def __init__(self, *args, **kwargs):
        TransformationBundle.__init__(self, *args, **kwargs)
        self.check_nidx_dim(0, 0)

        # check that order is sane
        if not self.cfg.order in [0, 1]:
            raise Exception("Unsupported ibe order {} (should be 0 or 1)".format(self.cfg.order))
Example #2
0
    def __init__(self, *args, **kwargs):
        TransformationBundle.__init__(self, *args, **kwargs)
        self.check_nidx_dim(1, 1, 'major')
        self.check_nidx_dim(0, 0, 'minor')

        self.shared = NestedDict()  # TODO: remove
        self.load_data()
    def __init__(self, *args, **kwargs):
        TransformationBundle.__init__(self, *args, **kwargs)
        self.check_nidx_dim(0, 1, 'major')

        paroptnames = 'parname', 'scale', 'ndiag'
        paropts = (s in self.cfg for s in paroptnames)
        if any(paropts) and not all(paropts):
            self.exception('Not all options are specified. Need: {!s}'.format(
                paroptnames))
Example #4
0
    def __init__(self, *args, **kwargs):
        TransformationBundle.__init__(self, *args, **kwargs)
        self.check_nidx_dim(3, 3, 'major')
        self.check_nidx_dim(0, 0, 'minor')

        try:
            source_name, detector_name, component_name = self.cfg.bundle.major
        except:
            raise Exception('Unable to obtain major indices: source, detector and OP component')
        self.idx_source = self.nidx_major.get_subset(source_name)
        self.idx_detector = self.nidx_major.get_subset(detector_name)
        self.idx_component = self.nidx_major.get_subset(component_name)
    def __init__(self, *args, **kwargs):
        TransformationBundle.__init__(self, *args, **kwargs)
        self.check_nidx_dim(2, 2, 'major')

        try:
            detector_name, component_name = self.cfg.bundle.major
        except:
            raise Exception(
                'Unable to obtain major indices: detector and component')
        self.detector_idx = self.nidx_major.get_subset(detector_name)
        self.component_idx = self.nidx_major.get_subset(component_name)

        self.storage = NestedDict()
Example #6
0
    def __init__(self, *args, **kwargs):
        '''Initialize reactor information such as daily ratios of actual
        thermal power to nominal, fission fractions per core.
        Cores are provided by caller through indices.
        Info is read from npz file.
        '''
        TransformationBundle.__init__(self, *args, **kwargs)
        self.check_nidx_dim(2, 2, 'major')
        self.check_nidx_dim(0, 0, 'minor')

        self.nidx_reactor = self.nidx.get_subset(self.bundlecfg.major[0])
        self.nidx_isotope = self.nidx.get_subset(self.bundlecfg.major[1])

        self.init_data()
    def __init__(self, *args, **kwargs):
        TransformationBundle.__init__(self, *args, **kwargs)
        self.check_nidx_dim(2, 2, 'major')
        self.check_nidx_dim(0, 0, 'minor')
        self.unc_ns = self.namespace(self.cfg.ns_name)

        self.uncorrelated_vars = defaultdict(dict)
        self.correlated_vars = defaultdict(dict)
        self.total_unc = defaultdict(dict)
        self.objects = defaultdict(dict)

        self._dtype = [('enu', 'd'), ('unc', 'd')]
        self.load_data()
        self._enu_to_bins()
Example #8
0
    def __init__(self, *args, **kwargs):
        TransformationBundle.__init__(self, *args, **kwargs)
        self.check_nidx_dim(2, 2, 'major')

        try:
            source_name, detector_name = self.cfg.bundle.major
        except:
            raise Exception(
                'Unable to obtain major indices: source, detector and OP component'
            )

        self.idx_source = self.nidx_major.get_subset(source_name)
        self.idx_detector = self.nidx_major.get_subset(detector_name)

        if not 'density' in self.cfg:
            raise Exception('Density is not provided')
    def __init__(self, *args, **kwargs):
        TransformationBundle.__init__(self, *args, **kwargs)
        self.check_nidx_dim(1, 1, 'major')

        if len(self.cfg.bundle.major) == 2:
            detector_name, component_name = self.cfg.bundle.major
            self.detector_idx = self.nidx_major.get_subset(detector_name)
            self.component_idx = self.nidx_major.get_subset(component_name)
        elif len(self.cfg.bundle.major) == 1:
            component_name = self.cfg.bundle.major
            self.detector_idx = self.nidx_major.get_subset([])
            self.component_idx = self.nidx_major.get_subset(component_name)
        else:
            raise self._exception(
                'Unable to obtain major indices: detector and component')

        self.storage = NestedDict()
Example #10
0
    def __init__(self, *args, **kwargs):
        TransformationBundle.__init__(self, *args, **kwargs)
        self.check_nidx_dim(3, 3, 'major')

        try:
            source_name, detector_name, component_name = self.cfg.bundle.major
        except:
            raise Exception(
                'Unable to obtain major indices: source, detector and OP component'
            )
        self.idx_source = self.nidx_major.get_subset(source_name)
        self.idx_detector = self.nidx_major.get_subset(detector_name)
        self.idx_component = self.nidx_major.get_subset(component_name)

        assert 'dm' in self.cfg, "Expect 'dm' option"
        assert self.cfg.dm in ('23',
                               'ee'), "Expect 'dm' option to be '23', or 'ee'"
Example #11
0
    def __init__(self, *args, **kwargs):
        TransformationBundle.__init__(self, *args, **kwargs)
        self.check_nidx_dim(0, 0, 'major')

        self.storage = NestedDict()
Example #12
0
 def __init__(self, *args, **kwargs):
     TransformationBundle.__init__(self, *args, **kwargs)
     self.check_nidx_dim(0, 0, 'major')
Example #13
0
    def __init__(self, *args, **kwargs):
        TransformationBundle.__init__(self, *args, **kwargs)
        self.check_nidx_dim(0, 0, 'major')

        self.varname = self.get_globalname('condition')
Example #14
0
 def __init__(self, *args, **kwargs):
     TransformationBundle.__init__(self, *args, **kwargs)
     self.check_cfg()
Example #15
0
 def __init__(self, *args, **kwargs):
     TransformationBundle.__init__(self, *args, **kwargs)
     self.objects = NestedDict()
Example #16
0
 def __init__(self, *args, **kwargs):
     TransformationBundle.__init__(self, *args, **kwargs)
     self.check_nidx_dim(1, 1, 'both')
Example #17
0
    def __init__(self, *args, **kwargs):
        TransformationBundle.__init__(self, *args, **kwargs)
        self.check_nidx_dim(0, 1, 'major')
        self.check_nidx_dim(0, 0, 'minor')

        self.groups = Categories(self.cfg.get('groups', {}), recursive=True)