Skip to content

refactor: comprehensive SIAC codebase revision#38

Merged
MarcYin merged 4 commits intofeat/refactorfrom
claude/zealous-gauss
Apr 2, 2026
Merged

refactor: comprehensive SIAC codebase revision#38
MarcYin merged 4 commits intofeat/refactorfrom
claude/zealous-gauss

Conversation

@MarcYin
Copy link
Copy Markdown
Owner

@MarcYin MarcYin commented Apr 2, 2026

  • Extract shared resampling utilities into siac.geo.resample, eliminating 3-way duplication across pipeline.py, atmospheric.py, and _assembly_runtime.py (~460 net lines removed)
  • Fix silent alpha/band_weight_power bug: user-configured SolverAlgorithmConfig.alpha was ignored because CostFunctionConfig defaulted to -2.0 independently; now threaded through MultiGridConfig
  • Replace fragile inspect.signature() grid assembler dispatch with simple keyword-arg call and TypeError fallback
  • Simplify init.py lazy loading with dict-based lookup table
  • Deduplicate config schema with _ConfigShortcutsMixin, remove empty Resolved* subclasses and redundant provider setters
  • Add RTModelBackend protocol typing to solver and corrector boundaries
  • Wrap RAA to [0, 2*pi) and add stability guard in apply_correction()
  • Vectorize sparse Laplacian boundary loop with boolean indexing
  • Pre-allocate solver DataArrays to reduce xarray overhead per iteration

MarcYin and others added 4 commits April 2, 2026 21:29
- Extract shared resampling utilities into siac.geo.resample, eliminating
  3-way duplication across pipeline.py, atmospheric.py, and
  _assembly_runtime.py (~460 net lines removed)
- Fix silent alpha/band_weight_power bug: user-configured
  SolverAlgorithmConfig.alpha was ignored because CostFunctionConfig
  defaulted to -2.0 independently; now threaded through MultiGridConfig
- Replace fragile inspect.signature() grid assembler dispatch with simple
  keyword-arg call and TypeError fallback
- Simplify __init__.py lazy loading with dict-based lookup table
- Deduplicate config schema with _ConfigShortcutsMixin, remove empty
  Resolved* subclasses and redundant provider setters
- Add RTModelBackend protocol typing to solver and corrector boundaries
- Wrap RAA to [0, 2*pi) and add stability guard in apply_correction()
- Vectorize sparse Laplacian boundary loop with boolean indexing
- Pre-allocate solver DataArrays to reduce xarray overhead per iteration

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix _ConfigShortcutsMixin type: ignore for ResolvedAlgorithmsConfig override
- Fix no-any-return in resample.py fill_nonfinite_like_template and
  resample_coefficients_to_template
- Simplify GridAssemblerFn to Callable[..., SolverInputBundle] since
  the call site uses keyword args dynamically
- Add type: ignore[no-any-return] for build_rt_model wrapper

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The CI scoped typecheck uses --follow-imports=skip, so the mixin's
type annotations are not checked against subclass overrides, making
the ignore comments unused errors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The grid assembler is now called with keyword arguments
(aerosol_resolution_m, sharp_transition_filter) instead of positional
args. Update mock assembler functions in integration tests to accept
**kwargs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@MarcYin MarcYin merged commit 847071e into feat/refactor Apr 2, 2026
3 checks passed
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.

1 participant