Repository navigation
Conversation
IVJIVE could only be imported from linearmodels.iv, while every other estimator can be imported from linearmodels. Import it in linearmodels/__init__.py and add it to __all__. The list of estimators in the docstring of the package omitted IVJIVE and AbsorbingLS, so add both. The first-stage rank tests cragg_donald, cragg_donald_f, kleibergen_paap and kleibergen_paap_f could only be imported from linearmodels.iv.common. Import them in linearmodels/iv/__init__.py and add them to its __all__, so that `from linearmodels.iv import cragg_donald` works. iv/common.py and iv/results.py had no __all__, so everything they import counted as public: `from linearmodels.iv.common import *` returned 35 names, including the NumPy functions, the GMM weight matrix classes and annihilate, and the same import from iv.results returned 49, including cragg_donald and cragg_donald_f. Add __all__ to list only the public names: - iv.common: the four rank tests. find_constant and f_statistic are used by the models and stay importable, but are not listed. - iv.results: AbsorbingLSResults, FirstStageResults, IVGMMResults, IVModelComparison, IVResults, OLSResults and compare. stub_concat and table_concat are used by panel.results and stay importable, but are not listed. Nothing that could be imported before has been removed, so only the star import and tools that read __all__ see a difference. The reference pages in doc/source/iv/reference.rst document the same objects as before. A Sphinx build of them and of the IV introduction gives the same warnings and the same pages as main, apart from the source listings of the two modules. linearmodels/tests/test_exports.py checks that: - every estimator in the __all__ of linearmodels.iv, panel, system and asset_pricing (the classes that have a fit method) is exported by linearmodels and is the same object. The 18 estimators are also listed in the test, so that none can be dropped from the public API unnoticed; - IVJIVE is exported from linearmodels; - the four rank tests in linearmodels.iv are the objects in linearmodels.iv.common; - the __all__ of iv.common and iv.results contain exactly the names above, and every __all__ of the modules above has no duplicates or missing names. 10 of the 33 tests fail on main.
The summary in the docstring of linearmodels/__init__.py ran over two lines and ended with a colon, which numpydoc validation reports as SS06 (the summary should fit in a single line) and SS03 (the summary does not end with a period). Make the first sentence the summary and move the rest into the extended summary. The words are unchanged.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #765 +/- ##
=======================================
Coverage 99.58% 99.58%
=======================================
Files 110 111 +1
Lines 20328 20392 +64
Branches 1600 1607 +7
=======================================
+ Hits 20244 20308 +64
Misses 31 31
Partials 53 53
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
IVJIVE could only be imported from linearmodels.iv, while every other
estimator can be imported from linearmodels. Import it in
linearmodels/init.py and add it to all. The list of estimators in
the docstring of the package omitted IVJIVE and AbsorbingLS, so add both.
The first-stage rank tests cragg_donald, cragg_donald_f, kleibergen_paap
and kleibergen_paap_f could only be imported from linearmodels.iv.common.
Import them in linearmodels/iv/init.py and add them to its all, so
that
from linearmodels.iv import cragg_donaldworks.iv/common.py and iv/results.py had no all, so everything they import
counted as public:
from linearmodels.iv.common import *returned 35 names,including the NumPy functions, the GMM weight matrix classes and annihilate,
and the same import from iv.results returned 49, including cragg_donald and
cragg_donald_f. Add all to list only the public names:
the models and stay importable, but are not listed.
IVModelComparison, IVResults, OLSResults and compare. stub_concat and
table_concat are used by panel.results and stay importable, but are not
listed.
Nothing that could be imported before has been removed, so only the star
import and tools that read all see a difference. The reference pages in
doc/source/iv/reference.rst document the same objects as before. A Sphinx
build of them and of the IV introduction gives the same warnings and the
same pages as main, apart from the source listings of the two modules.
linearmodels/tests/test_exports.py checks that:
asset_pricing (the classes that have a fit method) is exported by
linearmodels and is the same object. The 18 estimators are also listed in
the test, so that none can be dropped from the public API unnoticed;
linearmodels.iv.common;
and every all of the modules above has no duplicates or missing names.
10 of the 33 tests fail on main.