econ-ark / HARK

Heterogenous Agents Resources & toolKit
Apache License 2.0
315 stars 195 forks source link

Change repr to describe() #1390

Closed mnwhite closed 2 months ago

mnwhite commented 2 months ago

When the "parameters code" was added, it specified new behavior for __repr__(), listing all of the parameters whenever the object was returned to stdout. This is ok sometimes, but generates a massive amount of printed output in lifecycle models. Often the user just wants to do a quick check that an object is the class they think it is, or that there are the right number and kind of things in a list, and this behavior makes that impossible.

This commit only changes the function name __repr__ to describe. I.e. the "list everything" behavior is still there, it just needs to be explicitly requested rather than assumed as the default.

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 71.69%. Comparing base (6a73c4f) to head (366578f).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1390 +/- ## ======================================= Coverage 71.69% 71.69% ======================================= Files 84 84 Lines 13939 13939 ======================================= Hits 9993 9993 Misses 3946 3946 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

mnwhite commented 2 months ago

@alanlujan91 This is a small change to the "parameters code" you put in, as a simple aesthetic adjustment.