CDCgov / CDCgov/PyRenew

Pretty print for the model class

Open
#97 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

pyrenew
Dominant language
Python
Stars
29
Forks
9
Avg merge
9d 9h
Merged PRs (30d)
8

Description

Goal

We need to have a nice printout of the model class. Users should be able to quickly inspect what the model is without having to list all members of the model class.

Context

During the development of the tutorials, it became apparent the need for this feature.

Required features

  • It should have the __str__() method (see this).
  • It should print something like the following:
pyrenew.[Model instance]
Number of parameters: [a number goes here]
State of the MCMC: [run/not run]
Model components:
- [Latent process 1]
- [Latent process 2]
- [...]
First (k) parameters: param1, param2, ..., (omitting [N - k]).

Model components can be sort of an instance-dependent print implemented in a hidden function, e.g., _print_details().

Specifications

  • __str__() method for the Model metaclass.
  • _print_details() method for the Model instances.
  • Update the tutorials to include the model prints.
  • Add a test that check for the required cases (TBD).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named, so start by locating the Model metaclass and its model instance classes, then inspect the tutorials that demonstrated the need for this output. Define the required string sections, instance details, parameter truncation, and MCMC state, update tutorial usage, and add tests covering the listed cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.