Skip to content

Test waves comp#8

Open
PMRenaud wants to merge 28 commits intomainfrom
test-waves-comp
Open

Test waves comp#8
PMRenaud wants to merge 28 commits intomainfrom
test-waves-comp

Conversation

@PMRenaud
Copy link
Collaborator

A more up to date version of the code including conversions, and the time related functions

Patrick Renaud and others added 11 commits June 3, 2025 09:45
as started on the Two way coupling.
added the required version numbers for python and numpy as well as a small description for the issue where the metadata files may be missing
function, as well as most of the get value/ get
var functions
@PMRenaud PMRenaud requested a review from dorchard August 15, 2025 09:38
Copy link
Member

@dorchard dorchard left a comment

Choose a reason for hiding this comment

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

test_compose.py needs renaming to bmi_compose.py I think.

Copy link
Member

@dorchard dorchard left a comment

Choose a reason for hiding this comment

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

Almost there - just a minor comment about unitsDict. Do we still need it? I think this is subsumed by conversions now?

if coupling_type == CouplingType.TWO_WAY:
bwdInterfaceVars = intersection(bmi1.get_input_var_names(), bmi2.get_output_var_names())

getcontext().prec = 28
Copy link
Member

Choose a reason for hiding this comment

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

is a comment needed her to explain this choice?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For the precision I just used the value given by the example I found. Should I do a bit of searching just to see if this is the exact number we need or should I find the example and add a link to it in the comment?

Copy link
Member

Choose a reason for hiding this comment

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

It just feels like this should not be part of the composition but a choice that people can make outside (setting the global precision). I don't see why the composition should make this, or any choice.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The reason for having the precision defined here was because when I was running the composed model there was a rounding issue caused by the fact that one BMI had a time step of 1 and the other 0.2, so when the compose function tries to calculate how many cycles each bmi needs to do in order to stay in synch it was having issues.

Copy link
Member

@dorchard dorchard left a comment

Choose a reason for hiding this comment

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

Almost there! Thanks!
Could we put all the notebooks and associated data files in an examples directory rather than tests?
Also it looks like some of the data files for these examples are duplicated in the top-level directory.

@dorchard dorchard self-requested a review December 3, 2025 10:53
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