Skip to content
New issue

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

BmiJulia easier to subclass. #145

Open
sverhoeven opened this issue Oct 30, 2023 · 0 comments
Open

BmiJulia easier to subclass. #145

sverhoeven opened this issue Oct 30, 2023 · 0 comments

Comments

@sverhoeven
Copy link
Member

To subclass the BmiJulia class you now have to something like

class WflowBmi(BmiJulia):
    def __init__(self):
        m = self.from_name("Wflow.Model", implementation_name="Wflow.BMI")
        super().__init__(m.model, m.implementation)

See https://github.com/eWaterCycle/grpc4bmi/pull/144/files#r1374200483

It would be nicer if you could do

class WflowBmi(BmiJulia):
    def __init__(self):
        super().__init__("Wflow.Model", "Wflow.BMI")

Con: this makes init fat as it needs to call julia code +

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant