We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement this separately
Original implementation: wsimod/orchestration/model.py
@dalonsoa suggests:
extensions
config
for extension_file in config.get('extensions',[]): # use the import module (see swmmanywhere)`
register
model.nodes_type
ExtensionHandler
extensions_register
register_node_method
model.load
extensions_register = { 'node_name' : { 'method' : method, } } def apply_decorators(model): for node_name, decorator in extensions_register.items(): if 'sub_object' in decorator: setattr(getattr(model.nodes[node_name], decorator['sub_object']), method_name, method) continue setattr(model.nodes[node_name], method_name, method)
Within #97 - @dalonsoa
sub_object
apply_decorators
Within this PR - @dalonsoa
Close #54 , make a new PR - @liuly12
Documentation (new issue)
register_node_handler
The text was updated successfully, but these errors were encountered:
dalonsoa
Successfully merging a pull request may close this issue.
Implement this separately
Original implementation: wsimod/orchestration/model.py
@dalonsoa suggests:
extensions
entry in theconfig
file.Nodes
register
function updates themodel.nodes_type
information.Decorators
ExtensionHandler
from Extensions: decorators #97 , decorators now stored inextensions_register
, which makes extensions available to the model.register_node_method
, on import, which will add it to theextensions_register
.extensions_register
will need to be iterated over after the nodes have been instantiated insidemodel.load
, as demonstrated below.Sequence
model.load
extensions_register
To do list
Within #97 - @dalonsoa
extensions_register
register_node_method
(optional arg forsub_object
).apply_decorators
Within this PR - @dalonsoa
Close #54 , make a new PR - @liuly12
Documentation (new issue)
register_node_handler
) - us to revisitThe text was updated successfully, but these errors were encountered: