Skip to content

Conversation

Copy link

Copilot AI commented Jan 5, 2026

Documents the architectural decision to introduce ModelCollection, a new base class combining MutableSequence with EasyScience features for managing collections of model objects.

Structure

  • docs/adr/ - Markdown ADRs for GitHub viewing
  • docs/src/adr/ - RST versions integrated with Sphinx documentation
  • docs/src/index.rst - Added "Architecture" section to main docs

ADR-0001 Content

Context: No dedicated collection class existed that provided list operations while maintaining interface propagation, graph tracking, and serialization.

Decision: ModelCollection(ModelBase, MutableSequence[T]) with:

  • Automatic interface propagation to contained items
  • Graph edge management for dependency tracking
  • Type-safe access by index, slice, or name
  • 278 LOC implementation, 102 tests

Key Design Choices:

  • Dual inheritance over composition for standard list semantics
  • _add_item/_remove_item helpers for graph consistency
  • TypeVar generics and @overload for IDE support

Trade-offs: Unified API and type safety vs. additional complexity and memory overhead for graph tracking.

Status: Proposed (PR #180 is draft/open)

# Enables patterns like:
collection = ModelCollection(model1, model2, model3, interface=calc_interface)
collection[0]  # by index
collection['model_name']  # by name
collection.append(model4)  # interface auto-propagates

Future Maintenance

Status should be updated to "Accepted" when PR #180 merges.

Original prompt

Create an ADR proposal based on this draft pull request (#180 - New collection base)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits January 5, 2026 08:35
Co-authored-by: rozyczko <8266281+rozyczko@users.noreply.github.com>
Co-authored-by: rozyczko <8266281+rozyczko@users.noreply.github.com>
Copilot AI changed the title [WIP] Add ADR proposal for new collection base Add ADR for ModelCollection design (PR #180) Jan 5, 2026
Copilot AI requested a review from rozyczko January 5, 2026 08:40
@rozyczko rozyczko closed this Jan 5, 2026
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.

2 participants