From 7640068cdef2dbf8e01487328154bd4699c885a4 Mon Sep 17 00:00:00 2001 From: Kevin Sheppard Date: Fri, 1 Dec 2023 10:46:55 +0000 Subject: [PATCH] Refresh files and fix packaging warnings --- examples/asset-pricing_examples.ipynb | 9 +--- examples/asset-pricing_formulas.ipynb | 2 +- examples/iv_absorbing-regression.ipynb | 2 +- examples/iv_advanced-examples.ipynb | 2 +- examples/iv_basic-examples.ipynb | 2 +- examples/iv_using-formulas.ipynb | 44 +++---------------- examples/panel_data-formats.ipynb | 2 +- examples/panel_examples.ipynb | 2 +- examples/panel_using-formulas.ipynb | 2 +- examples/system_examples.ipynb | 2 +- examples/system_formulas.ipynb | 16 ++----- examples/system_three-stage-ls.ipynb | 2 +- .../tests/asset_pricing/test_formulas.py | 2 +- requirements-dev.txt | 2 +- requirements-test.txt | 2 +- requirements.txt | 2 +- setup.py | 3 +- 17 files changed, 27 insertions(+), 71 deletions(-) diff --git a/examples/asset-pricing_examples.ipynb b/examples/asset-pricing_examples.ipynb index db03ae76c3..885d6d8f5b 100644 --- a/examples/asset-pricing_examples.ipynb +++ b/examples/asset-pricing_examples.ipynb @@ -51,12 +51,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true, - "jupyter": { - "outputs_hidden": true - } - }, + "metadata": {}, "outputs": [], "source": [ "data.iloc[:, 6:] = data.iloc[:, 6:].values - data[[\"RF\"]].values" @@ -417,7 +412,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.11" + "version": "3.12.0" }, "pycharm": { "stem_cell": { diff --git a/examples/asset-pricing_formulas.ipynb b/examples/asset-pricing_formulas.ipynb index 97ac7b8f5a..2f475e95b4 100644 --- a/examples/asset-pricing_formulas.ipynb +++ b/examples/asset-pricing_formulas.ipynb @@ -139,7 +139,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.11" + "version": "3.12.0" }, "pycharm": { "stem_cell": { diff --git a/examples/iv_absorbing-regression.ipynb b/examples/iv_absorbing-regression.ipynb index b7fd1d5e8d..40270197a0 100644 --- a/examples/iv_absorbing-regression.ipynb +++ b/examples/iv_absorbing-regression.ipynb @@ -151,7 +151,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.11" + "version": "3.12.0" }, "pycharm": { "stem_cell": { diff --git a/examples/iv_advanced-examples.ipynb b/examples/iv_advanced-examples.ipynb index b08b85e5db..93ce8b31ee 100644 --- a/examples/iv_advanced-examples.ipynb +++ b/examples/iv_advanced-examples.ipynb @@ -572,7 +572,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.11" + "version": "3.12.0" }, "nbsphinx": { "allow_errors": true diff --git a/examples/iv_basic-examples.ipynb b/examples/iv_basic-examples.ipynb index b55c89822d..9df62570e4 100644 --- a/examples/iv_basic-examples.ipynb +++ b/examples/iv_basic-examples.ipynb @@ -802,7 +802,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.11" + "version": "3.12.0" }, "pycharm": { "stem_cell": { diff --git a/examples/iv_using-formulas.ipynb b/examples/iv_using-formulas.ipynb index 54494cf2ab..32690eb0a4 100644 --- a/examples/iv_using-formulas.ipynb +++ b/examples/iv_using-formulas.ipynb @@ -69,12 +69,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true, - "jupyter": { - "outputs_hidden": true - } - }, + "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", @@ -98,12 +93,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true, - "jupyter": { - "outputs_hidden": true - } - }, + "metadata": {}, "outputs": [], "source": [ "formula = (\n", @@ -115,12 +105,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true, - "jupyter": { - "outputs_hidden": true - } - }, + "metadata": {}, "outputs": [], "source": [ "iv_res = mod.fit(cov_type=\"robust\")\n", @@ -139,12 +124,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true, - "jupyter": { - "outputs_hidden": true - } - }, + "metadata": {}, "outputs": [], "source": [ "formula = (\n", @@ -166,12 +146,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true, - "jupyter": { - "outputs_hidden": true - } - }, + "metadata": {}, "outputs": [], "source": [ "formula = \"ldrugexp ~ 1 + totchr + female + age + linc + blhisp + hi_empunion\"\n", @@ -192,12 +167,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true, - "jupyter": { - "outputs_hidden": true - } - }, + "metadata": {}, "outputs": [], "source": [ "from linearmodels.iv import compare\n", @@ -222,7 +192,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.11" + "version": "3.12.0" }, "pycharm": { "stem_cell": { diff --git a/examples/panel_data-formats.ipynb b/examples/panel_data-formats.ipynb index 28abd238b4..5311153efa 100644 --- a/examples/panel_data-formats.ipynb +++ b/examples/panel_data-formats.ipynb @@ -224,7 +224,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.11" + "version": "3.12.0" }, "pycharm": { "stem_cell": { diff --git a/examples/panel_examples.ipynb b/examples/panel_examples.ipynb index f6368232d2..c4ce580fdc 100644 --- a/examples/panel_examples.ipynb +++ b/examples/panel_examples.ipynb @@ -427,7 +427,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.11" + "version": "3.12.0" }, "pycharm": { "stem_cell": { diff --git a/examples/panel_using-formulas.ipynb b/examples/panel_using-formulas.ipynb index 64bbe8e06e..f46ca1b366 100644 --- a/examples/panel_using-formulas.ipynb +++ b/examples/panel_using-formulas.ipynb @@ -182,7 +182,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.11" + "version": "3.12.0" }, "pycharm": { "stem_cell": { diff --git a/examples/system_examples.ipynb b/examples/system_examples.ipynb index 9d4b11c22e..22b204fd21 100644 --- a/examples/system_examples.ipynb +++ b/examples/system_examples.ipynb @@ -780,7 +780,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.11" + "version": "3.12.0" }, "pycharm": { "stem_cell": { diff --git a/examples/system_formulas.ipynb b/examples/system_formulas.ipynb index d42358b5fe..701661579c 100644 --- a/examples/system_formulas.ipynb +++ b/examples/system_formulas.ipynb @@ -18,12 +18,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true, - "jupyter": { - "outputs_hidden": true - } - }, + "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", @@ -45,12 +40,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true, - "jupyter": { - "outputs_hidden": true - } - }, + "metadata": {}, "outputs": [], "source": [ "from collections import OrderedDict\n", @@ -189,7 +179,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.11" + "version": "3.12.0" }, "pycharm": { "stem_cell": { diff --git a/examples/system_three-stage-ls.ipynb b/examples/system_three-stage-ls.ipynb index 5e9d3ce037..41e3b8baea 100644 --- a/examples/system_three-stage-ls.ipynb +++ b/examples/system_three-stage-ls.ipynb @@ -353,7 +353,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.11" + "version": "3.12.0" }, "pycharm": { "stem_cell": { diff --git a/linearmodels/tests/asset_pricing/test_formulas.py b/linearmodels/tests/asset_pricing/test_formulas.py index aa801a99ff..d2819c5dc1 100644 --- a/linearmodels/tests/asset_pricing/test_formulas.py +++ b/linearmodels/tests/asset_pricing/test_formulas.py @@ -117,7 +117,7 @@ def test_starting_values_options(data): def test_escaped_formula(data, model): def transform(fmla): - names = [f"`{factor.strip().replace('_',' ')}`" for factor in fmla.split("+")] + names = [f"`{factor.strip().replace('_', ' ')}`" for factor in fmla.split("+")] return " + ".join(names) formula_factors = transform(FORMULA_FACTORS) diff --git a/requirements-dev.txt b/requirements-dev.txt index 7efc07fb10..a2ebd84c58 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,6 +1,6 @@ xarray>=0.16 mypy>=1.3 -black[jupyter]==23.7.0 +black[jupyter]==23.11.0 pytest>=7.3.0 isort>=5.12 ipython diff --git a/requirements-test.txt b/requirements-test.txt index 6783251d79..9011e87a5d 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,4 +1,4 @@ -black[jupyter]==23.7.0 +black[jupyter]==23.11.0 coverage flake8 isort diff --git a/requirements.txt b/requirements.txt index 519029f938..a23249631c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,5 +7,5 @@ Cython>=0.29.34 pyhdfe>=0.1 formulaic>=0.6.5 # versioning -setuptools_scm[toml]>=7.0.0,<8.0.0 +setuptools_scm[toml]>=8.0.0,<9.0.0 diff --git a/setup.py b/setup.py index 46fe136198..5056e001e8 100644 --- a/setup.py +++ b/setup.py @@ -81,7 +81,8 @@ def run_setup(binary: bool = True) -> None: license="NCSA", description="Linear Panel, Instrumental Variable, Asset Pricing, and System " "Regression models for Python", - packages=find_namespace_packages(), + packages=["linearmodels"] + + [f"linearmodels.{v}" for v in find_namespace_packages("linearmodels")], package_dir={"linearmodels": "./linearmodels"}, author="Kevin Sheppard", author_email="kevin.k.sheppard@gmail.com",