-
Notifications
You must be signed in to change notification settings - Fork 95
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
Improve Test Coverage and Refactor Test for mslib.utils.coordinate #2596
base: develop
Are you sure you want to change the base?
Conversation
Add comprehensive test suite for `mslib.utils.coordinate` module - Refactored and added new test cases for functions in `coordinate` module. - Used `pytest.mark.parametrize` for parameterized testing. - Improved edge case coverage for distance, projection, and angle calculations. - Enhanced test readability and maintainability with detailed docstrings. - Validated linear and great circle path generation for lat/lon points.
|
||
@pytest.mark.parametrize("ref_lats, ref_lons, numpoints", [ | ||
([0, 10], [0, 0], 2), | ||
([0, 10], [0, 0], 3), |
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.
the second one had before ([0, 0], [0, 10] ,3)
assert all(np.asarray(lons) == [0, 5, 10]) | ||
numpoints=numpoints, connection="greatcircle") | ||
assert len(lats) == numpoints | ||
assert len(lons) == numpoints |
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.
We should also check for the expected value, like in assert all(np.asarray(lons) == [0, 5, 10])
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.
Hi @saiabhinav001
that makes it much better readable, thanks!
while the module we test here has no class definition we use a class level organization as namespace grouping. When test_linear maybe get named test_latlon_points_linear and the other test_latlon_points_greatcircle we maybe can remove all the grouping class names, what do you think?
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.
Hi @ReimarBauer
That's a great suggestion! Renaming the test functions makes them more descriptive, and removing the class-level grouping could simplify the structure.
I’ve updated the code by renaming test_linear
to test_latlon_points_linear
and test_greatcircle
to test_latlon_points_greatcircle
. I also removed the class-level groupings for simplicity and better readability. Let me know if there’s anything else to adjust!
Hi @saiabhinav001 Maybe a push to the repo is missing? I do see the class names here and also there is a lint failure. |
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.
Hi @ReimarBauer, I ensured there were no lint failures and pushed the repo.
@saiabhinav001 why do you have closed it? |
This PR enhances the test suite for the
mslib.utils.coordinate
module.Key Updates:
Purpose of PR?:
Fixes #
Does this PR introduce a breaking change?
This PR does not introduce any breaking changes.
If the changes in this PR are manually verified, list down the scenarios covered::
If manually verified, the following scenarios were tested:
Additional information for reviewer? :
This PR is an independent contribution and does not depend on or continue from previous PRs.
Does this PR results in some Documentation changes?
No documentation changes are required.
Checklist:
<type>: <subject>