def init(self, parent_widget=None): decl = rt_params.declarations(self.FILE_PREFIX) self.defaults = rt_params.defaults(self.FILE_PREFIX, decl) self.params = rt_params.init_params(self.defaults) self._view = genesis_pane.View(self, parent_widget) self.w = {} return self._view
def init(self, parent_widget=None): decl = rt_params.declarations(self.FILE_PREFIX) self.defaults = rt_params.defaults( self.FILE_PREFIX + '_' + self.SRW_MODE, decl['simulation_complexity'][self.SRW_MODE + '_particle']) self.params = rt_params.init_params(self.defaults) self._view = srw_pane.View(self, parent_widget) return self._view
def _params(base_name): decl = rt_params.declarations('srw') defaults = rt_params.defaults_from_dict( pkunit.data_yaml('sample'), 'srw_multi', decl['simulation_complexity']['multi_particle'], ) res = rt_params.init_params(defaults) res.wavefront = res.simulation_kind.e.wavefront res.simulation_kind = srw_enums.SimulationKind.E return res
def test_init_params(): """Verify a couple of values exist""" decl = rt_params.declarations('srw')['simulation_complexity']['multi_particle'] p = rt_params.init_params( rt_params.defaults('srw_multi', decl), ) assert 0.5 == p['beam']['avg_current'], \ 'Value must be converted to type correctly' assert 1000 == p['simulation_kind']['e']['wavefront']['num_points_energy'], \ 'Selectors must be parsed correctly' assert p