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

Parse a windIO yaml input file and instantiate the turbine structs #197

Merged
merged 33 commits into from
Aug 13, 2024

Conversation

faisal-bhuiyan
Copy link
Collaborator

@faisal-bhuiyan faisal-bhuiyan commented Jul 2, 2024

Completes #175.

This follows up on the work performed in #199 by adding the following

  • Add yaml-cpp library to support the yaml-parsing capabilities
  • Enhance the python script to add parse() methods to each of the mapped Structs
  • Use the IEA 15 MW turbine as a test case for the above

@faisal-bhuiyan faisal-bhuiyan linked an issue Jul 2, 2024 that may be closed by this pull request
@faisal-bhuiyan faisal-bhuiyan self-assigned this Jul 2, 2024
@faisal-bhuiyan faisal-bhuiyan added the enhancement New feature or request label Aug 8, 2024
@faisal-bhuiyan faisal-bhuiyan changed the title Parse windIO yaml Parse a windIO yaml input file and instantiate the turbine structs Aug 8, 2024
@faisal-bhuiyan faisal-bhuiyan marked this pull request as ready for review August 8, 2024 23:04
@deslaughter
Copy link
Collaborator

I think it looks good, just need to clean up all the Correctness and CppCheck comments

@faisal-bhuiyan faisal-bhuiyan requested a review from ddement August 13, 2024 18:12
Copy link
Collaborator

@ddement ddement left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. My only real comment was the one on the tests to try to avoid us reading an actual file from disk when running unit tests.

Comment on lines +28 to +38
- name: Cache install yaml-cpp
id: cache-yaml-cpp
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/spack
key: linux-yaml-cpp
- name: Install yaml-cpp
if: steps.cache-yaml-cpp.outputs.cache-hit != 'true'
run: |
source spack/share/spack/setup-env.sh
spack install yaml-cpp
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once you push this in, I'm thinking of unifying it with the action above so that we only have one "Build Dependencies" step/cache. Any thoughts/objections?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No objections from me, feel free to take care of it when you work on the CI pipeline as discussed.


#include "src/utilities/scripts/windio_mapped_structs.hpp"

namespace openturbine::restruct_poc::tests {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to avoid the need for filesystem logic, you can store the contents of the yaml file in a string (make a test_yaml_parser.hpp with a variable std::string IEA15File = "..."). Then YAML_::Load(IEA15File) should parse it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I gave it a shot -- looks like the string literal is too long for the liking of the compiler. I'll defer to you on the best course of action here.

image

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem. I might play with it if I feel froggy, but it's good to go for now.

src/utilities/controllers/discon_rotor_test_controller.cpp Outdated Show resolved Hide resolved
@faisal-bhuiyan
Copy link
Collaborator Author

faisal-bhuiyan commented Aug 13, 2024

@ddement Could you take a look at the errors from clang-tidy here? They are looking a little arbitrary to me since I did not see these errors the last time and I don't see them on my macOS dev environment.

https://github.com/Exawind/openturbine/actions/runs/10375210534/job/28724356604?pr=197

PS: I am proposing we change the platform for clang-tidy and cppcheck to macOS. Any thoughts, @deslaughter?

@ddement
Copy link
Collaborator

ddement commented Aug 13, 2024

@faisal-bhuiyan
If you look at your CI run, it actually isn't running clang-tidy on MacOS - it is emitting a warning this no ClangTidy executable was found, so it is passing because no checks are actually being done. Please don't push that change into main. I would actually prefer that we do our CppCheck and ClangTidy runs on all CI platforms, but didn't before when ClangTidy was taking an hour to run and we had made no attempts to make it pass.

It is failing now because the latest main branch has now enabled enforcing clang-tidy in header files, so you can see that your new errors are from the windio-mapped-struct header.

If you need me to, I can take a look at getting that file passing clang-tidy on Linux and push up the necessary changes.

@faisal-bhuiyan
Copy link
Collaborator Author

@ddement Is this good to get merged now?

@ddement
Copy link
Collaborator

ddement commented Aug 13, 2024

@ddement Is this good to get merged now?

@faisal-bhuiyan Looks good to me. Feel free to merge and I'll get to work on the CI stuff we discussed

@faisal-bhuiyan faisal-bhuiyan merged commit 7f2bcb7 into main Aug 13, 2024
8 of 9 checks passed
@faisal-bhuiyan faisal-bhuiyan deleted the read-windio-yaml branch August 13, 2024 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Read in YAML-based WindIO file to define a turbine
3 participants