Deltares / hydromt

HydroMT: Automated and reproducible model building and analysis
https://deltares.github.io/hydromt/
MIT License
65 stars 28 forks source link

restructure plugins #971

Closed DirkEilander closed 1 month ago

DirkEilander commented 1 month ago

Issue addressed

Fixes #958 Fixes #960

Explanation

The entrypoints should now expose a submodule/script with a __hydromt_eps__. Since this is more specific than the python all variable it poses less restrictions on the package structure. The __hydromt_eps__ should be a list of strings with names of classes that are exposed. The name of each class is first taken from the name attribute and otherwise the class name itself from __name__. Note that both Driver and Model have a name attribute, ModelComponent does not (yet) have this attribute. In addition I added a check to make sure the exposed classes are nonabstract subclasses of the base class that is associated with each entrypoint group. Each entrypoint group now has it's own class to avoid code duplication.

General Checklist

Data/Catalog checklist

Additional Notes (optional)

Add any additional notes or information that may be helpful.

DirkEilander commented 1 month ago

The migration guide has been updated in #950 to avoid merge conflicts