Model.update_module#
- Model.update_module(old_module, new_module=None)#
Update an user-defined module assigned to References
Update an user-defined Python module created by
new_module(). Thenew_moduleparameter is a path to the source file of a new user-defined module. Ifnew_moduleis not given, the old module is reloaded from the same source file of the old module and a new module module is created.The values of References referring to the old module object are replaced with the new module object.
If
old_moduleis assigned to multiple References in a model, the value of all the References are updated, even the References are defined in different locations within the model.This method associates to the new module the
ModuleDataobject previously associated to the old module.This method is available for
ModelandUserSpace. The method performs identically regardless of the types of calling objects.- Parameters:
old_module – A user-defined Python module object.
new_module – The path to the source file as a
stror a path-like object.
Added in version 0.18.0.
See also
new_module(): Create a reference to a moduleModuleData: IOSpec for module objects