Skip to content

add api.py to all subdirectories #251

Open

Description

@josef-pkt

see https://groups.google.com/group/pystatsmodels/browse_thread/thread/9cdfd56fd659659a?hl=en

I think it will be possible to do it in 0.4.1 without breaking backwards compatibility if we don't remove imports from the __init__.py

Remove all imports from __init__.py for release 0.5.0

I haven't looked at subdirectories at lower levels, eg. genmod.families which doesn't have code that isn't needed by GLM. An api.py is really not necessary in this case, unless we add generic functions in there (e.g. pre-specified transformation that I want also for other models and methods)

One other exception, directories for only internal use have an empty __init__.py already, e.g.

statsmodels\base has only the test runner in the __init__.py
statsmodels\tsa\base completely empty
statsmodels\compatnp completely empty

Activity

  1. josef-pkt commented on Aug 14, 2013

    @josef-pkt
    MemberAuthor

    still open, without api.py: genmod and robust, and ...

  2. modified the milestones: 0.7, 0.6 on Sep 26, 2014
  3. jbrockmendel commented on Oct 12, 2017

    @jbrockmendel
    Contributor

    closable?

  4. jbrockmendel commented on Sep 2, 2018

    @jbrockmendel
    Contributor

    Accept PR to finish this off?

  5. modified the milestones: 0.7, Someday on Mar 23, 2021
  6. josef-pkt commented on Sep 21, 2021

    @josef-pkt
    MemberAuthor

    statsmodels.api loads some subdirectories, i.e. actual path not an api-path

    from . import datasets, distributions, iolib, regression, robust, tools

    regression.__init__ only has yule_walker, why? -> we can add api with minimal changes
    robust.__init__ has all (?) relevant imports that should instead be in an api.py
    distributions.__init__ also has relevant imports, but I haven't added copula to it. copula has distributions.copula.api
    iolib.__init__ has some functions but not the summary module/functions
    tools.__init__ has add_constant, categorical. Most modules are internal, maybe eval_measures and some other could be in an api.py

    discrete: __init__ is empty (except test), no api.py. statsmodels.api imports models but no directory/api
    We should start an api.py. We have now more that one module with models in discrete.
    The same for imputation.

    miscmodels __init__.py is empty has api.py with old models. not imported into sm. OrderedModel missing in api

  7. josef-pkt commented on Jan 7, 2022

    @josef-pkt
    MemberAuthor

    distributions.__init__ we have more count distributions, e.g. truncated in pr #7973
    also the new in 0.13 DiscretizedCount distribution seem to be missing from apis, but it's in rst docs with statsmodels.distributions.discrete as path

    We need to start with api.py in distributions.

  8. josef-pkt commented on Apr 14, 2023

    @josef-pkt
    MemberAuthor

    discrete also does not have api.py
    There is not simple import to get e.g. all count models, those are spread over discrete_model, count_model and truncated_model

    I think we don't want OrderedModel in the discrete.api, in case we want a refactored backwards incompatible version of the model in discrete, e.g. superclass of OrderedModel will change, and the model/results will loose some GenericLikelihood methods.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions