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

Optimizing test exectution for test geometry #1305

Merged
merged 7 commits into from
Jan 20, 2025
Merged

Conversation

isakhammer
Copy link
Contributor

Proposed changes

Based on issue #1303, we optimized the test to go from 13s to 6s, using @fixture for geometry. In this way we only constructed the object once instead of for every test.

Types of changes

What types of changes does this PR introduce to PorePy?
Put an x in the boxes that apply.

  • Minor change (e.g., dependency bumps, broken links).
  • Bugfix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).
  • Testing (contribution related to testing of existing or new functionality).
  • Documentation (contribution related to adding, improving, or fixing documentation).
  • Maintenance (e.g., improve logic and performance, remove obsolete code).
  • Other:

Checklist

Put an x in the boxes that apply or explain briefly why the box is not relevant.

  • The documentation is up-to-date.
  • Static typing is included in the update.
  • This PR does not duplicate existing functionality.
  • The update is covered by the test suite (including tests added in the PR).
  • If new skipped tests have been introduced in this PR, pytest was run with the --run-skipped flag.

@isakhammer isakhammer changed the title Optimizing test geoemtry Optimizing test exectution for test geometry Jan 16, 2025
@keileg keileg self-assigned this Jan 16, 2025
Use class parametrization and a classmethod to get more intuitive signature of the indidivual tests
@keileg
Copy link
Contributor

keileg commented Jan 17, 2025

@isakhammer @jwboth I suggest a further refactoring that lead to much easier method signatures, see the latest push. If you agree with this, after possible changes first, I suggest @IvarStefansson has a final look at the PR.

FYI: The tests fail, likely due to some installation issue external to this PR. I'll have a look.

@jwboth
Copy link
Contributor

jwboth commented Jan 17, 2025

@keileg I like the approach. Indeed the signatures are much cleaner.

@keileg
Copy link
Contributor

keileg commented Jan 17, 2025

@IvarStefansson Could you to have a look, please?

Copy link
Contributor

@IvarStefansson IvarStefansson left a comment

Choose a reason for hiding this comment

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

I like the solution. Note that I have not reviewed the details, assuming that the tests themselves have not changed even if the diff covers most of the file.

@keileg
Copy link
Contributor

keileg commented Jan 20, 2025

Note that I have not reviewed the details, assuming that the tests themselves have not changed even if the diff covers most of the file.

Correct, beyond simplified method signatures and some referrals to self.geometries, the only change is that pretty much the entire file has had its indentation increased.

@IvarStefansson
Copy link
Contributor

Note that I have not reviewed the details, assuming that the tests themselves have not changed even if the diff covers most of the file.

Correct, beyond simplified method signatures and some referrals to self.geometries, the only change is that pretty much the entire file has had its indentation increased.

Good. Approving.

@keileg keileg merged commit 983c0ec into develop Jan 20, 2025
5 checks passed
@keileg keileg deleted the issue_test_geometry branch January 20, 2025 12:02
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.

4 participants