Fix backward compatibility for InferenceConfig schema - #14
Conversation
Resolves #13: Add support for legacy flat config structure to fix AttributeError when running pedagogical example with dev version. The InferenceConfig class now accepts both: 1. Legacy flat structure (warmup, samples, chains at inference level) 2. New hierarchical structure (method, nuts_config, map_config, vi_config) Changes: - Add optional legacy fields to InferenceConfig - Implement migrate_legacy_config validator that auto-migrates old configs - Add comprehensive tests for backward compatibility - Ensure mixing both formats raises a clear error This fixes the issue where examples work with PyPI but fail with GitHub dev version, and vice versa for shine.main. Co-authored-by: Ezequiel Centofanti <CentofantiEze@users.noreply.github.com>
|
ok, @claude can you update this PR to actually discard all legacy code, we don't care about maintaining backward compatibility, just make sure the documentation, example codes and pedagofical examples and notebooks are up to date with the main branch. |
|
Claude finished @EiffL's task in 2m 37s —— View job Removed backward compatibility code ✅
SummaryI've successfully removed all backward compatibility code from this PR and updated all documentation, examples, and config files to use the new hierarchical inference config structure. Changes made:
Already using new structure:
The PR now contains only the new hierarchical config structure with no backward compatibility code. |
This commit removes all legacy backward compatibility code and updates all documentation, examples, and config files to use the new hierarchical inference config structure. Changes: - Removed legacy fields (warmup, samples, chains, dense_mass, map_init) from InferenceConfig class - Removed migrate_legacy_config validator - Removed all backward compatibility tests - Updated examples/shear_inference.py to use nuts_config structure - Updated configs/test_run.yaml to use hierarchical structure - configs/validation/level0_base.yaml already used new structure - examples/level0_batched_inference.ipynb already used new structure Co-authored-by: Francois Lanusse <EiffL@users.noreply.github.com>
|
I think this should fix the problem, but let me know (at least when installing from the main branch) |
Summary
Resolves #13 by adding backward compatibility to the
InferenceConfigclass. The example scriptexamples/shear_inference.pynow works with both the old flat config structure and the new hierarchical structure.Changes
InferenceConfig(warmup,samples,chains,dense_mass,map_init)migrate_legacy_configvalidator that automatically migrates old configs to new hierarchical structureTesting
Added tests covering:
Generated with Claude Code