Skip to content

Commit 0a3c4bd

Browse files
committed
CLN: Fix various small lint issues and docs
1 parent 53f86bb commit 0a3c4bd

File tree

13 files changed

+48
-80
lines changed

13 files changed

+48
-80
lines changed

doc/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
# You can specify multiple suffix as a list of string:
115115
#
116116
# source_suffix = [".rst", ".md"]
117-
source_suffix = ".rst"
117+
source_suffix = {".rst": "restructuredtext"}
118118

119119
# The master toctree document.
120120
master_doc = "index"

doc/source/types.rst

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,13 @@
11
Type Aliases
22
============
33

4-
.. module:: linearmodels.typing.data
5-
6-
.. automodule:: linearmodels.typing.data
7-
8-
.. autoclass::
9-
10-
ArrayLike
11-
Float64Array
12-
Int64Array
13-
Int32Array
14-
IntArray
15-
BoolArray
16-
AnyArray
17-
Uint32Array = np.ndarray[Any, np.dtype[np.uint32]] # pragma: no cover
18-
19-
20-
.. module:: linearmodels.typing
21-
22-
.. automodule:: linearmodels.typing
23-
24-
.. autoclass::
25-
26-
Numeric
27-
OptionalNumeric
4+
.. autoclass:: linearmodels.typing.Numeric
5+
.. autoclass:: linearmodels.typing.OptionalNumeric
6+
.. autoclass:: linearmodels.typing.data.ArrayLike
7+
.. autoclass:: linearmodels.typing.data.Float64Array
8+
.. autoclass:: linearmodels.typing.data.Int64Array
9+
.. autoclass:: linearmodels.typing.data.Int32Array
10+
.. autoclass:: linearmodels.typing.data.IntArray
11+
.. autoclass:: linearmodels.typing.data.BoolArray
12+
.. autoclass:: linearmodels.typing.data.AnyArray
13+
.. autoclass:: linearmodels.typing.data.Uint32Array

examples/asset-pricing_formulas.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"metadata": {},
6868
"outputs": [],
6969
"source": [
70-
"from linearmodels.asset_pricing import LinearFactorModel, TradedFactorModel\n",
70+
"from linearmodels.asset_pricing import LinearFactorModel\n",
7171
"\n",
7272
"formula = \"NoDur + Chems + S1V1 + S5V5 + S1M1 + S5M5 ~ MktRF + HML + Mom\"\n",
7373
"mod = LinearFactorModel.from_formula(formula, data)\n",

examples/iv_advanced-examples.ipynb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@
115115
"metadata": {},
116116
"outputs": [],
117117
"source": [
118-
"from statsmodels.api import OLS, add_constant\n",
119118
"\n",
120119
"data[\"const\"] = 1\n",
121120
"controls = [\"const\"] + controls"

examples/iv_basic-examples.ipynb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -573,9 +573,10 @@
573573
"metadata": {},
574574
"outputs": [],
575575
"source": [
576-
"v = IV2SLS(data[endog], data[exog + instr], None, None).fit().resids\n",
577576
"import pandas as pd\n",
578577
"\n",
578+
"v = IV2SLS(data[endog], data[exog + instr], None, None).fit().resids\n",
579+
"\n",
579580
"res_direct = IV2SLS(\n",
580581
" data[dep], pd.concat([v, data[exog]], axis=1), data[endog], data[instr]\n",
581582
").fit(cov_type=\"unadjusted\")\n",
@@ -802,7 +803,7 @@
802803
"name": "python",
803804
"nbconvert_exporter": "python",
804805
"pygments_lexer": "ipython3",
805-
"version": "3.10.12"
806+
"version": "3.12.7"
806807
},
807808
"pycharm": {
808809
"stem_cell": {

examples/iv_using-formulas.ipynb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@
7272
"metadata": {},
7373
"outputs": [],
7474
"source": [
75-
"import numpy as np\n",
7675
"from linearmodels.datasets import meps\n",
7776
"from linearmodels.iv import IV2SLS\n",
7877
"\n",

examples/system_examples.ipynb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@
161161
"metadata": {},
162162
"outputs": [],
163163
"source": [
164-
"import pandas as pd\n",
165164
"from linearmodels.system import SUR\n",
166165
"\n",
167166
"mod = SUR(mod_data)\n",
@@ -181,14 +180,14 @@
181180
"metadata": {},
182181
"outputs": [],
183182
"source": [
183+
"import matplotlib.pyplot as plt\n",
184+
"import seaborn as sns\n",
185+
"\n",
184186
"cov = res.sigma\n",
185187
"std = np.sqrt(np.diag(res.sigma)[:, None])\n",
186188
"regions = [k for k in mod_data.keys()]\n",
187189
"corr = pd.DataFrame(cov / (std @ std.T), columns=regions, index=regions)\n",
188190
"\n",
189-
"import matplotlib.pyplot as plt\n",
190-
"import seaborn as sns\n",
191-
"\n",
192191
"sns.heatmap(corr, vmax=0.8, square=True)\n",
193192
"plt.show()\n",
194193
"\n",
@@ -780,7 +779,7 @@
780779
"name": "python",
781780
"nbconvert_exporter": "python",
782781
"pygments_lexer": "ipython3",
783-
"version": "3.10.12"
782+
"version": "3.12.7"
784783
},
785784
"pycharm": {
786785
"stem_cell": {

examples/system_three-stage-ls.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
"metadata": {},
7676
"outputs": [],
7777
"source": [
78-
"from linearmodels import IV2SLS, IV3SLS, SUR, IVSystemGMM"
78+
"from linearmodels import IV2SLS, IV3SLS, IVSystemGMM"
7979
]
8080
},
8181
{

linearmodels/iv/model.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,7 @@ class _IVGMMBase(_IVModelBase):
963963
Observation weights used in estimation
964964
weight_type : str
965965
Name of moment condition weight function to use in the GMM estimation
966-
**weight_config
966+
weight_config
967967
Additional keyword arguments to pass to the moment condition weight
968968
function
969969
@@ -1066,7 +1066,7 @@ class IVGMM(_IVGMMBase):
10661066
Observation weights used in estimation
10671067
weight_type : str
10681068
Name of moment condition weight function to use in the GMM estimation
1069-
**weight_config
1069+
weight_config
10701070
Additional keyword arguments to pass to the moment condition weight
10711071
function
10721072
@@ -1139,7 +1139,7 @@ def from_formula(
11391139
Observation weights used in estimation
11401140
weight_type : str
11411141
Name of moment condition weight function to use in the GMM estimation
1142-
**weight_config
1142+
weight_config
11431143
Additional keyword arguments to pass to the moment condition weight
11441144
function
11451145
@@ -1342,7 +1342,7 @@ class IVGMMCUE(_IVGMMBase):
13421342
Observation weights used in estimation
13431343
weight_type : str
13441344
Name of moment condition weight function to use in the GMM estimation
1345-
**weight_config
1345+
weight_config
13461346
Additional keyword arguments to pass to the moment condition weight
13471347
function
13481348
@@ -1418,7 +1418,7 @@ def from_formula(
14181418
Observation weights used in estimation
14191419
weight_type : str
14201420
Name of moment condition weight function to use in the GMM estimation
1421-
**weight_config
1421+
weight_config
14221422
Additional keyword arguments to pass to the moment condition weight
14231423
function
14241424
@@ -1706,7 +1706,7 @@ def _gmm_model_from_formula(
17061706
Observation weights used in estimation
17071707
weight_type : str
17081708
Name of moment condition weight function to use in the GMM estimation
1709-
**weight_config
1709+
weight_config
17101710
Additional keyword arguments to pass to the moment condition weight
17111711
function
17121712

linearmodels/panel/data.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,6 @@ class PanelData:
140140
copy : bool
141141
Flag indicating whether to copy the input. Only has an effect when
142142
x is a DataFrame
143-
cast : bool
144-
Flag indicating to case the data to double precision.
145143
146144
Notes
147145
-----

0 commit comments

Comments
 (0)