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

Add a C++ example to the documentation #105

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

mdpiper
Copy link
Member

@mdpiper mdpiper commented Apr 12, 2024

This PR adds a long-form C++ example to the documentation, similar to the existing C and Fortran examples.

This fixes #101.

@mdpiper
Copy link
Member Author

mdpiper commented Apr 12, 2024

View the example in the docs at: https://babelizer.readthedocs.io/en/mdpiper-add-cxx-example/example-cxx.html.

@mdpiper mdpiper requested a review from mcflugen April 12, 2024 21:17
@mdpiper mdpiper marked this pull request as ready for review April 12, 2024 21:18
@mcflugen
Copy link
Member

In reading over all of the examples, there is a lot of duplication between the languages. Each example is divided into three parts:

  1. Build an example library
  2. Run the babelizer on that library
  3. Add metadata so that it can be used in pymt

I wonder if we can simplify this.

Building a BMI library seems like it is outside the scope of the babelizer. Instead of describing how to do this, could we either point to the instructions for each example or use an example library that can be installed via conda?

Since the pymt stuff is the same for each language can we have just one page that shows how to do this and then point to that page from each of the examples? This step is also optional and a little beyond the scope of the babelizer. Maybe that could be made more clear?

@mdpiper
Copy link
Member Author

mdpiper commented Apr 12, 2024

In reading over all of the examples, there is a lot of duplication between the languages.

I agree, and you're correct--it would be good to simplify. However, I'm OK with duplication here because most people will care only about one language, and I want a complete, end-to-end, example for each. Full disclosure: the first few times I tried this workflow (model -> BMI -> babelizer -> pymt), I was confused until I made an end-to-end example. I'm hoping my experience can help inform others.

aufdenkampe added a commit to LimnoTech/babelizer-examples that referenced this pull request Apr 15, 2024
aufdenkampe added a commit to LimnoTech/babelizer-examples that referenced this pull request Apr 23, 2024
Using the global environment file, I was able to run most of the example and successfully test the BMI down to the end of https://babelizer.readthedocs.io/en/mdpiper-add-cxx-example/example-cxx.html#test-the-bmi.
csdms/babelizer#105
@aufdenkampe
Copy link

@mdpiper, I got this example to work on a Mac, using the global environment file at https://github.com/LimnoTech/babelizer-examples/blob/main/environment.yml.

I'll now circle back to try to get it to run on Windows, which didn't work the first time I tried. I'll share updates.

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.

Add C++ example
3 participants