-
Notifications
You must be signed in to change notification settings - Fork 64
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
Added Python BMI docs #427
Conversation
And a few added language specifiers to code blocks elsewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this looks good. I did have a couple of minor questions and one small suggestion, but nothing that can't be circled back to later, even if it's decided they are worth addressing.
@@ -332,7 +386,7 @@ A few other items of note: | |||
* configuration of `variables_names_map` maps a given variable to a variable name of the directly | |||
* it is now possible to have an earlier nested module use as a provider (for one of its inputs) a later nested module, as long as a default value is configured | |||
* a collection of variable default values can be given in the formulation config at the top level by providing an entry in `default_output_values` with the variable's mapped configuration alias (or just variable name if it is unique) and the default value: | |||
```json | |||
```javascript |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any particular reason for changing from json
to javascript
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That allows
//...
vs.
//...
...somewhat subjective which is preferable. Neither really gives much useful code coloring.
... | ||
``` | ||
|
||
**TIP:** If you are actively developing a Python BMI model, you may want to [install your package with the `-e` flag](https://pip.pypa.io/en/stable/topics/local-project-installs/#editable-installs). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it worth going into making the class available by appending to PYTHONPATH
? Using pip -e
is probably a better solution in general, but, e.g., assumes a user can install packages in the environment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If they can't they are going to have bigger problems, probably... they can't get bmipy
for instance or likely a working version of NumPy. I would leave it out... there's only so much we can do here. Don't get me started on all the various setup.cfg
or manifest.json
pyproject.toml
or whatever you're supposed to do this week to make a Python package that we could go into but won't.
|
||
### BMI Python Example | ||
|
||
An example implementation for an appropriate BMI model as a **Python** class is [provided in the project](../extern/test_bmi_py), or you can examine the CSDMS-provided [example Python model](https://github.com/csdms/bmi-example-python). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not essential, but it might be worth a quick reference to the Python BMI unit tests and their usage of this example implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm inclined to leave it out... I'm tempted to leave out our test class too, which implements some non-existent (deprecated?) BMI methods.
And a few added language specifiers to code blocks elsewhere.
[Short description explaining the high-level reason for the pull request]
Additions
Removals
Changes
Testing
Screenshots
Notes
Todos
Checklist
Testing checklist (automated report can be put here)
Target Environment support