StatsReporting / stargazer

Python implementation of the R stargazer multiple regression model creation tool
Other
197 stars 48 forks source link

Renderer (sub)classes #46

Closed toobaz closed 4 years ago

toobaz commented 4 years ago

This PR introduces a new Renderer class to be subclassed by specific renderers (currently HTMLRenderer and LaTeXRenderer). This should (spare a few chars when calling methods, and) make it easier to reuse code (related to #41 ).

csemken commented 4 years ago

Great stuff. I like that it is class-based (unlike #41). I think you could move more chunks into the super-class, such as the part of generate_footer that adds the statistics and generate_observations, generate_r2, etc. themselves. You could do that by borrowing the _gen_row method from #41 (implemented by the sub-classes).

toobaz commented 4 years ago

Thanks for feedback.

I think you could move more chunks into the super-class, such as the part of generate_footer that adds the statistics and generate_observations, generate_r2, etc. themselves. You could do that by borrowing the _gen_row method from #41 (implemented by the sub-classes).

I didn't do it in this PR to not slow it down further, but I definitely agree it's worth doing.