Skip to content

BUG: summary2 use float_format - #1965

Closed
josef-pkt wants to merge 1 commit into
statsmodels:masterfrom
josef-pkt:summary2_format_1964
Closed

josef-pkt wants to merge 1 commit into
statsmodels:masterfrom
josef-pkt:summary2_format_1964

Conversation

@josef-pkt

Copy link
Copy Markdown
Member

when creating _simple_tables setting float_format is ignored
see #1964

However, this is incomplete as fix, since there are three dictionaries in settings, that have been appended in different methods or functions.

Should there only be one, or is this on purpose?

@josef-pkt

Copy link
Copy Markdown
Member Author

@vincentarelbundock
Vincent, do you remember why there are 3 dictionaries in settings?

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage remained the same when pulling 179beba on josef-pkt:summary2_format_1964 into 2a21c83 on statsmodels:master.

@josef-pkt josef-pkt added this to the 0.7 milestone Sep 18, 2014
@josef-pkt josef-pkt modified the milestones: 0.8, 0.7 Feb 4, 2015
@jbrockmendel

Copy link
Copy Markdown
Contributor

This looks mostly benign, and bike-shedding seems like a bigger danger than imperfect formatting. A few thoughts/questions:

The discussion in #1964 has more recent activity than this; does that render this moot?

Is there a reason to use settings[1] for all tables in the loop rather than settings[i]?

Is there a plausible way this code gets reached when settings has fewer than 2 elements? Or where settings[1] is not a dict or does not have a float_format key?

@josef-pkt

Copy link
Copy Markdown
Member Author

@jbrockmendel Vincent is busy with "real" life, and I don't know.

I never figured out or tried to figure out why there are 3 in settings.
One problem is that we have almost no test coverage on the content of summary/summary2, so the unit tests will not complain if the output looks "weird". That means that summary output depends on visual inspection.
(We lost temporarily a column of the confidence interval after some refactoring, and found it only "by chance", i.e. during later usage.)

@josef-pkt

Copy link
Copy Markdown
Member Author

Sorry, I made the comment without checking #1964

I assume using settings[1] should work, if it is an invalid index, then the smoke tests would raise.
Given the diagnosis in 1964 about the 3 tables: All model summary have at least 2 tables.
However, there could be use cases where we only have the params_table. But I don't think that's the case for summary2, and also not for summary. There is a case for just using the params_table in t_test summary, but that uses from statsmodels.iolib.summary import summary_params (statsmodels.stats.contrast.ContrastResults.summary).

So assuming at least two tables in summary2 looks like a usable assumption.

@jbrockmendel

Copy link
Copy Markdown
Contributor

Is there a test to go with this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants