Skip to content

Fix test suite failures: NumPy 2.0 compatibility, API regressions, and FIRE algorithm initialization#26

Draft
Copilot wants to merge 4 commits into5-fix-issue-with-geometry-breaking-from-time-to-timefrom
copilot/sub-pr-6
Draft

Fix test suite failures: NumPy 2.0 compatibility, API regressions, and FIRE algorithm initialization#26
Copilot wants to merge 4 commits into5-fix-issue-with-geometry-breaking-from-time-to-timefrom
copilot/sub-pr-6

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 18, 2026

Tests were failing due to a mix of NumPy 2.0 breaking changes, API mismatches between test expectations and implementation, and a FIRE algorithm initialization bug introduced in the previous PR.

NumPy 2.0 compatibility

  • np.in1dnp.isin in utils.py
  • np.Infnp.inf in test file

Set / VertexModel API fixes

  • VertexModel.__init__ now accepts a Set instance as the first positional argument (tests call VertexModelBubbles(set_test))
  • Set.__init__ gains set_option keyword to call a named preset method after construction
  • Set.read_mat_file converts numpy integer scalars to Python native types, preventing silent uint8 overflow in arithmetic
  • Set.__getattr__ fallback added for attributes absent from old .pkl files (integrator, all fire_* params, noise_random, etc.) — avoids AttributeError on deserialized state

FIRE algorithm

  • fire_minimization_loop was unconditionally setting geo._fire_velocity before checking hasattr, so initialize_fire() (which sets _fire_dt, _fire_alpha, etc.) was never called. Fixed to always call initialize_fire() at loop entry.

VertexModelBubbles fixes

  • generate_Xs creates a Geo() instance when self.geo is None (standalone call without prior initialize())
  • initialize_cells handles filename=None (skips save) and initializes geo when absent
  • range(len(nCells))range(nCells) typo

face.py

  • Area0 = Area * Set.ref_A0 guarded for ref_A0 is None (old mat files omit this field)

Test infrastructure

  • tests.py: load_data uses absolute paths via TEST_DIRECTORY; calls update_lmin0() + update_barrier_tri0() after loading geometry from .mat so downstream computations (kgTriAREnergyBarrier, kgTriEnergyBarrier) have non-None inputs
  • test_vertexModel.py: all CWD-relative paths replaced with os.path.join(TEST_DIRECTORY, 'Tests_data', ...)

CI

  • Added pull_request trigger to tests.yaml so the workflow actually runs on PRs

📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

Co-authored-by: Pablo1990 <1974224+Pablo1990@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issue with geometry breaking from time to time Enable CI tests on pull requests Mar 18, 2026
Copilot AI requested a review from Pablo1990 March 18, 2026 08:49
Copilot AI and others added 2 commits March 18, 2026 08:59
Co-authored-by: Pablo1990 <1974224+Pablo1990@users.noreply.github.com>
…h handling

Co-authored-by: Pablo1990 <1974224+Pablo1990@users.noreply.github.com>
Copilot AI changed the title Enable CI tests on pull requests Fix test suite failures: NumPy 2.0 compatibility, API regressions, and FIRE algorithm initialization Mar 18, 2026
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.

2 participants