Add ADR-0001: Calculator Factory Pattern from PR #181 #182
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.
Documents the architecture decision to introduce
CalculatorBaseandCalculatorFactoryBaseclasses, separating calculator creation from state management as proposed in draft PR #181.Structure
docs/adr/README.md- ADR index and format explanationdocs/adr/0001-calculator-factory-pattern.md- Complete decision record following MADR formatADR Content
Context: Legacy
InterfaceFactoryTemplatecouples calculator creation with state management, inconsistent with other EasyScience factories (e.g., minimizers)Decision: Introduce stateless factory pattern with three components:
CalculatorBase- Abstract calculator interface withcalculate(), model/instrumental parameter managementCalculatorFactoryBase- Abstract factory with dynamic calculator discovery via_try_register_calculator()SimpleCalculatorFactory- Concrete dictionary-based registry implementationDeprecation:
InterfaceFactoryTemplatemarked deprecated with migration path documentedAdditional:
Map._store→Map.__storefor proper encapsulationMigration Example
References
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.