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

Contact Unit tests authenticated #274

Conversation

Rahul-JOON
Copy link
Contributor

@Rahul-JOON Rahul-JOON commented Jun 23, 2023

This PR aims to solve issue #271.

The following changes were made:

  1. Overall changes:
  • all pytests were reworked and input and expected values were handcrafted.
  • added calculations and verification methods as comments
  1. File-specific changes
  • tests_contact_common_functions:
    - corrected names of variables
    - for the '_find_min_dist' test, arbitrary close lines and away lines were combined into a single test and test case for
    parallel lines were added
    - point to be noted: find min dist function returns -1 for contact point of system 1 if the lines intersect
  • test_contact_specific_functions:
    - Common rod and cylinder were initialized for tests.
    - test only assess the working of function with contact forces and many initial conditions were added (ex: stationary
    systems and zero initial forces) for easier calculations.
  • test_wrapper_classes:
    - correct initialization of rod and rigidbody.
    - test values were copied from specific function pytests.

If the tests are acceptable, we can make more tests that are not 'nu' independent.

Also, can we remove the elif block at https://github.com/GazzolaLab/PyElastica/blob/master/elastica/joint.py/#L574, I think this code is redundant as 'i' never equals 'n_points'.

@codecov-commenter
Copy link

codecov-commenter commented Jun 23, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.55 ⚠️

Comparison is base (baea843) 94.72% compared to head (0f3a92e) 94.17%.

❗ Current head 0f3a92e differs from pull request most recent head 5226332. Consider uploading reports for the commit 5226332 to get more accurate results

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@               Coverage Diff                @@
##           update-0.3.2     #274      +/-   ##
================================================
- Coverage         94.72%   94.17%   -0.55%     
================================================
  Files                43       43              
  Lines              2938     2938              
  Branches            341      341              
================================================
- Hits               2783     2767      -16     
- Misses              122      134      +12     
- Partials             33       37       +4     
Impacted Files Coverage Δ
elastica/joint.py 85.76% <0.00%> (-5.18%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@Rahul-JOON Rahul-JOON marked this pull request as ready for review June 23, 2023 19:44
Copy link
Collaborator

@bhosale2 bhosale2 left a comment

Choose a reason for hiding this comment

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

Minor doubt.

tests/test_contact_specific_functions.py Outdated Show resolved Hide resolved
tests/test_contact_specific_functions.py Outdated Show resolved Hide resolved
tests/test_contact_specific_functions.py Outdated Show resolved Hide resolved
tests/test_contact_specific_functions.py Outdated Show resolved Hide resolved
tests/test_contact_specific_functions.py Outdated Show resolved Hide resolved
tests/test_contact_specific_functions.py Outdated Show resolved Hide resolved
tests/test_contact_wrapper_classes.py Outdated Show resolved Hide resolved
tests/test_contact_wrapper_classes.py Outdated Show resolved Hide resolved
tests/test_contact_wrapper_classes.py Outdated Show resolved Hide resolved
tests/test_contact_wrapper_classes.py Outdated Show resolved Hide resolved
tests/test_contact_wrapper_classes.py Outdated Show resolved Hide resolved
tests/test_contact_specific_functions.py Outdated Show resolved Hide resolved
tests/test_contact_wrapper_classes.py Outdated Show resolved Hide resolved
@Rahul-JOON Rahul-JOON requested a review from skim0119 as a code owner July 8, 2023 17:27
@armantekinalp armantekinalp removed the request for review from skim0119 July 8, 2023 18:51
@bhosale2
Copy link
Collaborator

bhosale2 commented Jul 9, 2023

@Rahul-JOON I will review once again, once @armantekinalp and @Ali-7800 s comments have been addressed.

Copy link
Contributor

@armantekinalp armantekinalp left a comment

Choose a reason for hiding this comment

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

Some typos

tests/test_contact_specific_functions.py Outdated Show resolved Hide resolved
tests/test_contact_specific_functions.py Outdated Show resolved Hide resolved
tests/test_contact_specific_functions.py Outdated Show resolved Hide resolved
Copy link
Contributor

@armantekinalp armantekinalp left a comment

Choose a reason for hiding this comment

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

LGTM

@Rahul-JOON Rahul-JOON requested a review from Ali-7800 July 10, 2023 14:53
Copy link
Collaborator

@Ali-7800 Ali-7800 left a comment

Choose a reason for hiding this comment

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

LGTM

@Rahul-JOON Rahul-JOON requested a review from bhosale2 July 10, 2023 22:25
Copy link
Collaborator

@bhosale2 bhosale2 left a comment

Choose a reason for hiding this comment

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

LGTM

@armantekinalp armantekinalp merged commit c2eff6a into GazzolaLab:update-0.3.2 Jul 11, 2023
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.

5 participants