Skip to content

SUMM: Topic Week - Internal Consistency #4030

Open

Description

@jbrockmendel

Activity

  1. josef-pkt commented on Oct 12, 2017

    @josef-pkt
    Member

    Thanks for this overview list.

    It's more like a SUMMSUMM than what will be digestible in one topic week.
    Several or many of the issues will need considerable time, either because of setup cost to figure out what's going on and what's supposed to be going on, or because it takes time to check and write unit tests. Some might be pretty straight forward, and some are waiting for design decisions, and some might not be possible to change/fix.

  2. bashtage commented on Oct 13, 2017

    @bashtage
    Member

    Well considered list. These clean ups will really help IMO.

  3. josef-pkt commented on Oct 13, 2017

    @josef-pkt
    Member

    One clarification:

    large parts of statsmodels.tools and statsmodels.stats are never used in the "core", may belong in sandbox.

    Large parts of statsmodels.stats are standalone functions similar to scipy.stats and are part of the core functionality of statsmodels in their own right.
    All functions and classes in the api are supposed to have the basic verifying unit tests. Some functions are pretty settled, some parts are "construction zone".
    Other functions are in support of models that (at least theoretically) apply to several model types.
    e.g. #3954 throwing in more PRs that mainly stalled because of missing API and scope decisions. (Do we want classes that contain everything or a collection of standalone functions as in scipy.)

    Also stats is a very heterogeneous collection of tools and functionality, and a bit of a default location if we don't find a good place to put something.

  4. bashtage commented on Oct 13, 2017

    @bashtage
    Member

    One could examine test coverage when considering whether a function belongs in the main or should be demoted to sandbox.

  5. josef-pkt commented on Oct 13, 2017

    @josef-pkt
    Member

    Or write the missing unit tests.
    Given that github, in contrast to git, does not follow moving code across modules, I became reluctant to move code across files or move files. (svn/trac was still much better for digging through the history than github is.)
    https://codecov.io/gh/statsmodels/statsmodels/tree/master/statsmodels/stats

  6. jbrockmendel commented on Oct 13, 2017

    @jbrockmendel
    ContributorAuthor

    It's more like a SUMMSUMM than what will be digestible in one topic week. [...] Some might be pretty straight forward, and some are waiting for design decisions

    Yah, looking it over again its a pretty imposing list. My preference would be to get the low-hanging fruit (e.g. the flake8 section) by delegating review/merge responsibilities for "sufficiently obvious" fixes to Chad/Kevin/[?]. The limiting factor there is who you trust to judge "sufficiently obvious".

    Large parts of statsmodels.stats are standalone functions similar to scipy.stats and are part of the core functionality of statsmodels in their own right.

    As in #4027, poor word choice on my part. The thought was/is to identify the subset of tools+stats that is relied upon by base+tsa and the most commonly-used Model/Results classes. This subset should be a focus for QA efforts.

  7. ChadFulton commented on Oct 16, 2017

    @ChadFulton
    Member

    tsa.statespace has some special handling for model.data. Life would be better if special cases were mainlined.

    I don't doubt you're correct, but I can't immediately find anything that seems particularly special - can you point me to the pieces you're thinking about?

  8. jbrockmendel commented on Oct 16, 2017

    @jbrockmendel
    ContributorAuthor

    can you point me to the pieces you're thinking about?

    The main place is in sarimax.prepare_data:

                # Reset the ModelData datasets and cache
                self.data.endog, self.data.exog = (
                    self.data._convert_endog_exog(endog, exog))
    
                # Reset indexes, if provided
                new_length = self.data.endog.shape[0]
                if self.data.row_labels is not None:
                    self.data._cache['row_labels'] = (
                        self.data.row_labels[orig_length - new_length:])
    

    Distant runners-up are a) setting self.data = model.data in MLEResults.__init__ and b) setting self.data.param_names = self.param_names in a handful of places. All pretty benign really.

    Basically anything that shows up when grepping for ".data" is something that ideally would be hidden as an implementation detail. The fact that you have to access self.data.orig_endog or self.data.dates in a bunch of places is completely harmless, but the world would be a happier place if it were unnecessary.

    Update: Now I see that TimeSeriesModelResults.__init__ attaches self.data = model.data. So statespace is off the hook for that. Still counts as a special case.

  9. added this to the 0.11 milestone on Oct 20, 2018
  10. modified the milestones: 0.11, josef on Oct 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions