Refactor ND scan subsystem with adaptive sparse 2D sampling, surface validation, and coupling classification#855
Conversation
alongd
commented
Apr 1, 2026
- New module arc/species/nd_scan.py: Extracts ND scan logic from scheduler.py into a dedicated subsystem with clean interfaces for grid generation, continuous scan state, adaptive sparse 2D sampling, surface validation, coupling metrics, and rotor classification
- Adaptive sparse 2D scans: For eligible brute_force_sp/brute_force_opt 2D rotors, ARC can now run batched adaptive sampling instead of the full Cartesian grid, controlled by a sampling_policy field on the rotor — no new directed_scan_type values are introduced
- Surface validation: Neighbor-edge continuity checks, periodic boundary consistency, and branch-jump detection diagnose PES discontinuities without blocking finalization
- Coupling analysis and classification: Separable-fit residual analysis classifies each adaptive 2D rotor as separable, coupled, or unreliable with an explicit recommended action
- Sparse-aware 2D plotting: plot_2d_rotor_scan dispatches to an interpolation-based sparse contour path for adaptive scans, with sampled/failed/invalid point overlays
- xTB directed_scan fix: The xTB adapter now correctly runs --opt for brute_force_opt directed scan jobs (was silently running SP)
- Bug fix: Corrected parse_e_elect(path=...) → parse_e_elect(log_file_path=...) kwarg in check_directed_scan_job
There was a problem hiding this comment.
Pull request overview
Refactors ARC’s N-dimensional (ND) directed-rotor scan logic into a dedicated arc/species/nd_scan.py subsystem, adds an adaptive sparse 2D sampling path with surface validation + coupling classification, and updates the scheduler/plotter/xTB adapter to support the new flow.
Changes:
- Extracted ND scan utilities from
scheduler.pyintoarc/species/nd_scan.pyand updated scheduler call sites accordingly. - Added adaptive sparse 2D scan execution (batch selection, bookkeeping, surface validation, coupling metrics, and rotor classification) with new unit/functional tests.
- Updated 2D plotting to support sparse/adaptive scans via interpolation-based contours with overlays; fixed xTB directed-scan opt behavior.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
arc/species/nd_scan.py |
New ND scan subsystem incl. adaptive sparse 2D sampling, validation, coupling metrics, and classification. |
arc/species/nd_scan_test.py |
Unit tests covering dense/continuous helpers and the new adaptive/validation/classification logic. |
arc/scheduler.py |
Integrates nd_scan helpers; adds adaptive batch spawning and refactors directed-scan finalization/recording. |
arc/scheduler_test.py |
Functional xTB-backed tests for dense + adaptive 2D directed scans. |
arc/plotter.py |
Adds sparse/adaptive 2D plotting path (interpolation + overlays) and dispatch logic. |
arc/plotter_test.py |
Tests for sparse plotting helpers and interpolation behavior. |
arc/job/adapters/xtb_adapter.py |
Ensures --opt is used for directed_scan jobs whose directed-scan type implies optimization. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #855 +/- ##
==========================================
+ Coverage 59.24% 60.30% +1.06%
==========================================
Files 98 99 +1
Lines 30023 30856 +833
Branches 7929 8082 +153
==========================================
+ Hits 17786 18609 +823
+ Misses 9985 9926 -59
- Partials 2252 2321 +69
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
7caa3b4 to
7848a8e
Compare
Contains pure scan-surface helpers