-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/divergence #9
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
Conversation
Adjust structure of the API to incorporate new code for regulating the divergence of detachment force.
Add steady state computation (optimal r). Add a small cutoff delta to regulate the singularity. Add new tests for steady-state solving and regulation. Add tests for the fallback simulator.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Pull request overview
This pull request addresses issue #8 by introducing a delta parameter to regulate singularities in force calculations when cells are very close together. The PR includes significant code reorganization, splitting the monolithic finite_voronoi.py into separate modules for better maintainability, and adds new functionality to compute optimal delta values based on target forces.
Key changes:
- Added
deltaparameter toPhysicalParamswith helper methods (with_delta,with_optimal_radius) and a newtarget_deltafunction to compute delta from target forces - Applied singularity fix in force calculations using
np.maximum(root[:, None], self.phys.delta)in both fast and fallback implementations - Restructured codebase into
backend.py,simulator.py, andphysical_params.pyfor cleaner separation of concerns
Reviewed changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
afv/__init__.py |
New file defining the public API with version 0.2.4, exports PhysicalParams, FiniteVoronoiSimulator, and target_delta |
afv/backend.py |
New file implementing backend selection logic (Cython vs Python fallback) |
afv/simulator.py |
New file providing the API-facing FiniteVoronoiSimulator wrapper with backend detection and fallback warnings |
afv/physical_params.py |
New file containing PhysicalParams dataclass with delta parameter, optimization methods, and target_delta function |
afv/finite_voronoi.py |
Removed (functionality split into new modules) |
afv/finite_voronoi_fast.py |
Updated to import PhysicalParams from new module and apply singularity fix with delta |
afv/finite_voronoi_fallback.py |
Updated to import PhysicalParams from new module, apply singularity fix, and remove trailing whitespace |
tests/conftest.py |
Updated to use new import pattern, added delta=0.45 to test fixture, parameterized simulator fixture for both backends |
tests/test_core.py |
Added delta handling in MATLAB test and new test_physical_params function to validate delta computations |
tests/test_geom.py |
Added test case for N=2 separated points and improved comment clarity for collinear case |
examples/relaxation.py |
Updated imports to use new import afv pattern |
examples/connections.py |
Updated imports to use new import afv pattern |
examples/active_FV.py |
Updated imports to use new import afv pattern |
examples/jupyter/custom_plot.ipynb |
Updated imports, improved line wrapping in comments, updated execution timestamps |
pyproject.toml |
Version bumped from 0.2.2 to 0.2.4 |
README.md |
Updated badge URLs to feature branch, updated import examples, clarified fallback behavior notes, updated issue status |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
7a10086 to
dd57d94
Compare
Close #8 now by setting a small cutoff$\delta$ to regulate the singularity.