Skip to content

Make _make_model_distribution an abstract method in HSSMBase #895

@cpaniaguam

Description

@cpaniaguam

Currently, _make_model_distribution is implemented as a concrete method in HSSMBase, but this method's logic is specific to standard HSSM models. As we work towards making HSSMBase a proper abstract base class that can be extended for different model types (e.g., RLSSM, custom models), this method should be abstract to enforce that each subclass provides its own implementation.

Proposed Solution
Refactor _make_model_distribution to be an abstract method in HSSMBase, with the current implementation moved to the HSSM class.

Tasks

  • Make HSSMBase inherit from ABC
  • Convert _make_model_distribution in HSSMBase to an abstract method with appropriate docstring
  • Move the current implementation of _make_model_distribution to the HSSM class
  • Ensure the HSSM implementation includes all necessary validation (e.g., for self.loglik and self.list_params)
  • Run full test suite to ensure no regressions
  • Verify all tests in test_hssm.py pass
  • Update any relevant documentation if needed

Expected Benefits

  • Clear interface contract for subclasses
  • Better code organization and separation of concerns
  • Easier to extend for future model types
  • Python's ABC will automatically raise TypeError if subclasses don't implement required methods

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions