Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions openmdao.main/src/openmdao/main/assembly.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
67 changes: 0 additions & 67 deletions openmdao.main/src/openmdao/main/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -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')
Expand All @@ -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):
Expand Down