Skip to content

Refactor ND scan subsystem with adaptive sparse 2D sampling, surface validation, and coupling classification#855

Open
alongd wants to merge 4 commits intomainfrom
nd_scans
Open

Refactor ND scan subsystem with adaptive sparse 2D sampling, surface validation, and coupling classification#855
alongd wants to merge 4 commits intomainfrom
nd_scans

Conversation

@alongd
Copy link
Copy Markdown
Member

@alongd 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

Comment thread arc/species/nd_scan.py Fixed
Comment thread arc/species/nd_scan.py Fixed
Comment thread arc/species/nd_scan.py Fixed
Comment thread arc/scheduler_test.py Fixed
Comment thread arc/scheduler_test.py Fixed
Comment thread arc/scheduler_test.py Fixed
Comment thread arc/species/nd_scan.py Fixed
Comment thread arc/species/nd_scan_test.py Fixed
Comment thread arc/species/nd_scan_test.py Fixed
Comment thread arc/species/nd_scan_test.py Fixed
Copy link
Copy Markdown

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

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.py into arc/species/nd_scan.py and 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.

Comment thread arc/species/nd_scan.py
Comment thread arc/plotter.py Outdated
Comment thread arc/scheduler_test.py Fixed
Copy link
Copy Markdown

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

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.

Comment thread arc/species/nd_scan.py
Comment thread arc/scheduler.py Outdated
Comment thread arc/plotter.py Outdated
Comment thread arc/species/nd_scan.py Outdated
Comment thread arc/scheduler_test.py
Copy link
Copy Markdown

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

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.

Comment thread arc/species/nd_scan.py Outdated
Comment thread arc/species/nd_scan.py Outdated
Comment thread arc/species/nd_scan.py
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.30%. Comparing base (1e374ec) to head (e8f8a8f).
⚠️ Report is 1 commits behind head on main.

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     
Flag Coverage Δ
functionaltests 60.30% <ø> (+1.06%) ⬆️
unittests 60.30% <ø> (+1.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

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

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.

Comment thread arc/scheduler.py Outdated
Comment thread arc/scheduler_test.py Outdated
Comment thread arc/species/nd_scan.py Outdated
Copy link
Copy Markdown

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

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.

Comment thread arc/scheduler.py Outdated
Comment thread arc/scheduler.py Outdated
Comment thread arc/species/nd_scan.py
@alongd alongd force-pushed the nd_scans branch 2 times, most recently from 7caa3b4 to 7848a8e Compare April 3, 2026 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants