def get_state_data(self, file_information): if file_information: data_builder = get_data_builder(SANSFacility.ISIS, file_information) return data_builder.build() else: return StateData()
def _get_data_state(**data_entries): state = StateData() data_settings = {"sample_scatter": "test", "sample_transmission": "test", "sample_direct": "test", "can_scatter": "test", "can_transmission": "test", "can_direct": "test"} for key, value in list(data_settings.items()): if key in data_entries: value = data_entries[key] if value is not None: # If the value is None, then don't set it setattr(state, key, value) return state
def __init__(self): super(AllStates, self).__init__() self.data : StateData = StateData() self.move: StateMove = StateMove() self.reduction: StateReductionMode = StateReductionMode() self.slice: StateSliceEvent = StateSliceEvent() self.mask: StateMask = StateMask() self.wavelength: StateWavelength = StateWavelength() self.save: StateSave = StateSave() self.scale: StateScale = StateScale() self.adjustment: StateAdjustment = StateAdjustment() self.convert_to_q: StateConvertToQ = StateConvertToQ() self.compatibility: StateCompatibility = StateCompatibility()
def __init__(self, input_dict, data_info: StateData): self._input = input_dict # Always take the instrument from the TOML file rather than guessing in the new parser data_info.instrument = self.instrument self._create_state_objs(data_info=data_info)
def __init__(self, input_dict, data_info: StateData): super(_TomlV1ParserImpl, self).__init__(toml_dict=input_dict) # Always take the instrument from the TOML file rather than guessing in the new parser data_info.instrument = self.instrument self._create_state_objs(data_info=data_info)