class Container(State): def __defaults__(self): """ This sets the default values. Assumptions: Puts the segments in the right order Source: N/A Inputs: None Outputs: None Properties Used: None """ self.segments = DataOrdered() def merged(self): """ Combines the states of multiple segments Assumptions: None Source: N/A Inputs: None Outputs: state_out [State()] Properties Used: None """ state_out = State() for i, (tag, sub_state) in enumerate(self.segments.items()): for key in ['unknowns', 'conditions', 'residuals']: if i == 0: state_out[key].update(sub_state[key]) else: state_out[key] = state_out[key].do_recursive( append_array, sub_state[key]) return state_out
class Container(State): def __defaults__(self): """ This sets the default values. Assumptions: Puts the segments in the right order Source: N/A Inputs: None Outputs: None Properties Used: None """ self.segments = DataOrdered() def merged(self): """ Combines the states of multiple segments Assumptions: None Source: N/A Inputs: None Outputs: state_out [State()] Properties Used: None """ state_out = State() for i,(tag,sub_state) in enumerate(self.segments.items()): for key in ['unknowns','conditions','residuals']: if i == 0: state_out[key].update(sub_state[key]) else: state_out[key] = state_out[key].do_recursive(append_array,sub_state[key]) return state_out
class Container(State): def __defaults__(self): self.segments = DataOrdered() def merged(self): state_out = State() for i, (tag, sub_state) in enumerate(self.segments.items()): for key in ['unknowns', 'conditions', 'residuals']: if i == 0: state_out[key].update(sub_state[key]) else: state_out[key] = state_out[key].do_recursive( append_array, sub_state[key]) return state_out