diff --git a/openmdao.main/src/openmdao/main/assembly.py b/openmdao.main/src/openmdao/main/assembly.py index 58665070e6..50a454e27d 100644 --- a/openmdao.main/src/openmdao/main/assembly.py +++ b/openmdao.main/src/openmdao/main/assembly.py @@ -191,18 +191,12 @@ def _pre_execute(self): Overrides of this function must call this version. """ - - # if self._call_cpath_updated: - # self.cpath_updated() - - if self._new_config: - # self.check_config() - if self.parent is None and has_interface(self, IAssembly): - self._setup() # only call _setup from top level - #self._new_config = False - + new_config = self._new_config super(Assembly, self)._pre_execute() + if new_config and self.parent is None: + self._setup() # only call _setup from top level + self.configure_recording(self.recording_options) @property diff --git a/openmdao.main/src/openmdao/main/component.py b/openmdao.main/src/openmdao/main/component.py index 49dedf531b..42d3836dcb 100644 --- a/openmdao.main/src/openmdao/main/component.py +++ b/openmdao.main/src/openmdao/main/component.py @@ -422,7 +422,6 @@ def cpath_updated(self): self.configure() self._call_configure = False - def _pre_execute(self): """Prepares for execution by calling various initialization methods if necessary. @@ -435,28 +434,8 @@ def _pre_execute(self): if self._new_config: self.check_config() - # per Bret - # if self.parent is None and has_interface(self, IAssembly): - # self._setup() # only call _setup from top level self._new_config = False - - # def _pre_execute(self): - # """Prepares for execution by calling various initialization methods - # if necessary. - - # Overrides of this function must call this version. - # """ - - # if self._call_cpath_updated: - # self.cpath_updated() - - # if self._new_config: - # self.check_config() - # if self.parent is None and has_interface(self, IAssembly): - # self._setup() # only call _setup from top level - # self._new_config = False - def execute(self): """Perform calculations or other actions, assuming that inputs have already been set. This must be overridden in derived classes. @@ -529,8 +508,6 @@ def run(self, case_uuid=''): self._stop = False self._case_uuid = case_uuid - # if self.parent is None: # per Bret - # self._run_begins() try: self._pre_execute() self._set_exec_state('RUNNING') @@ -557,50 +534,6 @@ def run(self, case_uuid=''): self._run_terminated() if self.directory: self.pop_dir() - - # def run(self, case_uuid=''): - # """Run this object. This should include fetching input variables - # (if necessary), executing, and updating output variables. - # Do not override this function. - - # case_uuid: str - # Identifier for the Case that is associated with this run. - # """ - - # if self.directory: - # self.push_dir() - - # self._stop = False - # self._case_uuid = case_uuid - - # if self.parent is None: - # self._run_begins() - # try: - # self._pre_execute() - # self._set_exec_state('RUNNING') - - # #print ' execute: %s' % self.get_pathname() - # # Component executes as normal - # self.exec_count += 1 - # if tracing.TRACER is not None and \ - # not obj_has_interface(self, IDriver, IAssembly): - # tracing.TRACER.debug(self.get_itername()) - # #tracing.TRACER.debug(self.get_itername() + ' ' + self.name) - - # self.execute() - # self._post_execute() - # self._post_run() - - # except Exception: - # info = sys.exc_info() - # self._set_exec_state('INVALID') - # raise info[0], info[1], info[2] - # finally: - # # If this is the top-level component, perform run termination. - # if self.parent is None: - # self._run_terminated() - # if self.directory: - # self.pop_dir() @rbac(('owner', 'user')) def _run_begins(self):