refactor: comprehensive SIAC codebase revision#38
Merged
MarcYin merged 4 commits intofeat/refactorfrom Apr 2, 2026
Merged
Conversation
Owner
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
- 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.