-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add statement on explicitly returning nothing in control functions #4
base: master
Are you sure you want to change the base?
Conversation
Working on the implementation in csdms/bmi-example-julia, I realize that |
Ha interesting that you chose I think I'd prefer the repetition in this case though, since I don't think we can necessarily expect everyone to read the |
I think consistency would be best here, i.e. always return the model. In what case would you already have the model instantiated, and would want to re-use the struct to initialize it again? I'm having a hard time picturing that. |
Yes that's also fine by me.
Yeah I was thinking of some constructor that has empty arrays, which are then filled with initialize or something like that. But I don't really think it is needed, and I see bmi-example-julia, Wflow and Ribasim all only have the method on the type and not the instance. So perhaps a better way to resolve #1 would be to document that this is the only way: |
To add these types, I'd have to define a MyModel struct. Shall I do that and also add types elsewhere? |
Ah I meant to only document this. The MyModel struct example is not for BMI.jl but for users of BMI.jl. |
@visr I've added an example implementation to initialize that should hopefully clear up any confusion. |
I do see that in Wflow.jl and Ribasim you don't actually use the model's type, and that it's only passed so that julia uses the correct function. Maybe it's good to actually clarify that. |
Ref csdms/bmi-example-julia#8
I added a general statement in the initialize docstring to avoid too much repetition.