ImperialCollegeLondon / wsi

WSIMOD is a software for simulating water quality and quantity
https://imperialcollegelondon.github.io/wsi/
BSD 3-Clause "New" or "Revised" License
13 stars 2 forks source link

Extensions release #107

Open barneydobson opened 3 days ago

barneydobson commented 3 days ago

Issue to discuss finalisation of the new extensions ability.

Below copied from #99

Within #97 - @dalonsoa

Within this PR - @dalonsoa

Close #54 , make a new PR - @liuly12

Enable custom subclasses

Documentation (new issue)

barneydobson commented 3 days ago

@dalonsoa did we have a plan to add custom classes - I know it can be done by updating the registry but there's no way to enter those in the normal config use. You could add them to be loaded by load_extension_files - but this would need to take place before add_nodes since the subclasses will need to have been registered before that point

dalonsoa commented 3 days ago

I don't remember if we ditched the idea, or just forgot to include it in the plan above. In any case, it should be as simple as moving this line:

https://github.com/ImperialCollegeLondon/wsi/blob/61573a9d2e1997f9d2189a93f3cfbdf9c915638e/wsimod/orchestration/model.py#L223

To before adding the nodes. The extensions files can have decorated stuff but also extra classes, so they all should be "registered" together. I don't think there's any reason for loading the extension files at the end rather than at the beginning.

barneydobson commented 3 days ago

I will add that to the list of tasks above