def __init__(self, originalname, targetname): ActionVisitor.__init__(self, explicitly_require_action_overrides=False) self.originalname = originalname self.targetname = targetname self.namemap = {originalname: targetname}
def __init__(self, component, old_symbol_name, new_symbol_name): ActionVisitor.__init__(self, explicitly_require_action_overrides=True) self.old_symbol_name = old_symbol_name self.new_symbol_name = new_symbol_name self.namemap = {old_symbol_name: new_symbol_name} if not component.is_flat(): raise NineMLRuntimeError('Rename Symbol called on non-flat model') self.lhs_changes = [] self.rhs_changes = [] self.port_changes = [] self.visit(component) component._validate_self()