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

Added Python BMI docs #427

Merged
merged 1 commit into from
Aug 2, 2022
Merged

Added Python BMI docs #427

merged 1 commit into from
Aug 2, 2022

Conversation

mattw-nws
Copy link
Contributor

And a few added language specifiers to code blocks elsewhere.

[Short description explaining the high-level reason for the pull request]

Additions

  • Python BMI model docs

Removals

Changes

  • Small tweaks to code block formatting elsewhere

Testing

Screenshots

Notes

Todos

Checklist

  • PR has an informative and human-readable title
  • Changes are limited to a single goal (no scope creep)
  • Code can be automatically merged (no conflicts)
  • Code follows project standards (link if applicable)
  • Passes all existing automated tests
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future todos are captured in comments
  • Project documentation has been updated (including the "Unreleased" section of the CHANGELOG)
  • Reviewers requested with the Reviewers tool ➡️

Testing checklist (automated report can be put here)

Target Environment support

  • Linux

And a few added language specifiers to code blocks elsewhere.
@mattw-nws mattw-nws requested a review from robertbartel July 28, 2022 19:14
Copy link
Contributor

@robertbartel robertbartel left a 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
Copy link
Contributor

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?

Copy link
Contributor Author

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).
Copy link
Contributor

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.

Copy link
Contributor Author

@mattw-nws mattw-nws Aug 2, 2022

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.jsonpyproject.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).
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@mattw-nws mattw-nws merged commit 4dc3c75 into master Aug 2, 2022
@mattw-nws mattw-nws deleted the mattw-nws-python-bmi-docs branch August 2, 2022 20:57
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

Successfully merging this pull request may close these issues.

2 participants