Skip to content

Conversation

@wwang721
Copy link
Owner

@wwang721 wwang721 commented Jan 2, 2026

Close #8 now by setting a small cutoff $\delta$ to regulate the singularity.

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.
@wwang721 wwang721 self-assigned this Jan 2, 2026
@wwang721 wwang721 added enhancement New feature or request question Further information is requested labels Jan 2, 2026
@wwang721 wwang721 linked an issue Jan 2, 2026 that may be closed by this pull request
@codecov
Copy link

codecov bot commented Jan 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link

Copilot AI left a 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 delta parameter to PhysicalParams with helper methods (with_delta, with_optimal_radius) and a new target_delta function 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, and physical_params.py for 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.

@wwang721 wwang721 force-pushed the feature/divergence branch from 7a10086 to dd57d94 Compare January 2, 2026 00:45
@wwang721 wwang721 merged commit 4951d7f into main Jan 2, 2026
2 checks passed
@wwang721 wwang721 deleted the feature/divergence branch January 2, 2026 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request question Further information is requested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Time step dependence of intercellular adhesion in simulations

2 participants