Skip to content

base._parameter_inference should not copy code from _diagnostic_other #4905

Open

Description

@jbrockmendel

That's what "import" is for.

Activity

  1. josef-pkt commented on Aug 15, 2018

    @josef-pkt
    Member

    It's to avoid circular imports.
    I'm not sure yet what the final version/location will be.

  2. jbrockmendel commented on Aug 15, 2018

    @jbrockmendel
    ContributorAuthor

    Would a runtime import work? Temporary copy/pastes have a nasty way of become permanent (fit_constrained, tons of tests) and from there for small differences to creep in (get_robustcov_results, sandbox.tsa.garch) and then it's a giant pain to sort out (plus one version is likely buggy)

  3. jbrockmendel commented on May 16, 2019

    @jbrockmendel
    ContributorAuthor

    These two implementations have apparently drifted apart. Any idea if one is right and one is wrong?

  4. jbrockmendel commented on May 16, 2019

    @jbrockmendel
    ContributorAuthor

    Looks like the copied version was then extended to return some more stuff. And the module where it was copied from is imported at the top of this module, so circular imports are clearly not an issue.

  5. josef-pkt commented on May 22, 2019

    @josef-pkt
    Member

    see PR #5772 (closed as too early to fix code duplication)

  6. jbrockmendel commented on May 22, 2019

    @jbrockmendel
    ContributorAuthor

    Also too early to discuss the bug identified there?

  7. josef-pkt commented on May 22, 2019

    @josef-pkt
    Member

    which bug?

    5772 is defined as MAINT to remove code duplication, it doesn't mention a bug. (I only skimmed the PR to see that I don't want this at the current time.)

    a bugfix PR looks more like this #5762 (one word changed and 35 lines of unit tests added)

  8. josef-pkt commented on May 22, 2019

    @josef-pkt
    Member

    My first reply is still accurate and up-to-date

    statsmodels.base should avoid importing from other parts as much as possible.

    score_test will be attached to models e.g. PR for GLM and robust
    Then the score_test can be used for diagnostic tests, e.g. I have an uncommitted version of a generic RESET test based on score.

    module location of the various diagnostic functions and their helper functions is still unclear, e.g. I started a new private module to collect reset test tools.

  9. jbrockmendel commented on May 22, 2019

    @jbrockmendel
    ContributorAuthor

    which bug?

    The potential bug described in the thread in #5772.

    Please stop treating me like The Enemy.

    module location of the various diagnostic functions and their helper functions is still unclear, e.g. I started a new private module to collect reset test tools.

    Sounds like it belongs in the sandbox.

  10. josef-pkt commented on May 22, 2019

    @josef-pkt
    Member

    with the bug you mean the code in the elif cov_type.upper() == 'V' path?

    both docstring and comments indicate that that path is not working yet.
    The wrong number of arguments will be easy to fix. The singular matrix treatment in V is a serious problem that will require more thinking.

    If you don't want me to get impatient and upset, then avoid PRs like this. It's wasting my time, and my first comment clearly says that there is a reason for the code duplication.

    Sounds like it belongs in the sandbox.

    Haven't you realized yet, that I am now using private modules like _parameter_inference instead of the sandbox?
    And I usually indicate which parts are unit tested and which parts are experimental or not finished.

    score_test, conditional moment tests and the associated diagnostic and specification tests will take maybe 5 or more additional PRs.
    (but I think we will be the only package that supports generic HC, ..., robust score tests.)

  11. jbrockmendel commented on May 22, 2019

    @jbrockmendel
    ContributorAuthor

    Haven't you realized yet, that I am now using private modules like _parameter_inference instead of the sandbox?

    I have. And to the casual observer it would appear that you are simultaneously
    a) invalidating the idea behind the sandbox existing in the first place
    b) applying a double-standard in preventing actually-tested code from leaving the sandbox
    c) making it more difficult to identify what code is and is not "in good shape"
    d) neglecting the fact that many readers are neither i) you nor ii) psychic
    e) making things more difficult for those readers in the future when they have to maintain the half-finished code that will inevitably be left behind here

    But its your project and you get to do what you want, so I've kept my head down and tried to help.

    Seems like time for me to take my customary couple-months away. All the best.

  12. josef-pkt commented on May 22, 2019

    @josef-pkt
    Member

    Given all the complaints about sandbox, we have given up on its usage a long time ago. But the old code is still waiting for (substantive) review.

    I don't see anyone working on score_tests and similar. So it will be at my pace. If there is someone like a GSOC student, then I would work with her/him.
    And I also want to point out that very few people know about generic robust score tests and I have not seen anyone in the Python neighborhood. If you read the relevant articles, then the code is not difficult to understand. But without that background the code the meaning and intention of the code will be difficult to understand.

    c) making it more difficult to identify what code is and is not "in good shape"

    I started to add a Status comment to the docstrings, as we discussed last year. Also all our code is by default experimental after it has been newly added.

    I think when my code goes for public consumption it is usually in good shape and needs relatively few backwards incompatible changes. As I mentioned in the PRs most of the current score_test, conditional moment tests and similar is foundation code and not user facing, unless the user is interested in code for some old econometric theory articles)

    How about working on documentation notebooks and similar instead of taking time off.
    I'm only getting impatient with pep-8, code reshuffling and similar.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions