-
Notifications
You must be signed in to change notification settings - Fork 19
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
Use glob function to allow wild character in template #2746
Conversation
Would it be possible to make unit test(s) for this? Only because I'd want to make sure that Intel and GNU both work with this. (Since Fortran + Strings = 🤷🏼 sometimes as @tclune and @darianboggs can attest to!) |
97% tests passed, 2 tests failed out of 66 Label Time Summary: Total Test time (real) = 125.43 sec The following tests FAILED: |
Ah. You'd want to run:
which just runs the essential cases. This is what happens if you run The reason Case 12 fails is that Case 12 requires 216 cores so...big! (I wonder if there's a way to have ctest avoid that if there aren't enough cores available...) |
@mathomp4 , that is really helpful! I have checked the box in the CheckList Run the unit test (make tests) |
Did you add a unit test for your code? Or is that sort of...out of reach? Maybe the model is the unit test! |
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.
See inline comments. Mostly small code improvements, but one substantial question that needs to be answered.
Ideally unit tests won't access the filesystem, so a bit tricky here. Let's not let this get in the way of approval. But the follow up will be to work with @darianboggs to add some sort of basic sanity check. I guess create a directory with some empty files with various names and then see what glob returns? |
@mathomp4, thanks for the suggestion. The full sampler code running with all observation locations is one of the tests (I have executed a part of it). |
Types of change(s)
Checklist
make tests
)Description
In the current sampler code (interpolation for each time interval along model run), reading a filename with template sometimes requires us to rename the observation file name to concord with the template. For example,
This is simplified, if wild character is allowed
@amdasilva suggested using glob function to enable * character in template.
This PR is a code implementation.
Example input:
Sampler code output:
Related Issue