Skip to content

Commit

Permalink
Merge pull request #595 from bashtage/rls-6
Browse files Browse the repository at this point in the history
DOC: Update for release 6.0
  • Loading branch information
bashtage committed Apr 16, 2024
2 parents 31e7033 + 45f8e2e commit a7deffa
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 15 deletions.
3 changes: 1 addition & 2 deletions ci/install-posix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@ eval "$CMD"

if [ "${PIP_PRE}" = true ]; then
python -m pip uninstall -y numpy pandas scipy matplotlib statsmodels xarray
python -m pip install -i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy pandas scipy matplotlib xarray --upgrade --use-deprecated=legacy-resolver
python -m pip install git+https://github.com/statsmodels/statsmodels.git --upgrade --no-build-isolation -v
python -m pip install -i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy pandas scipy matplotlib xarray statsmodels --upgrade --use-deprecated=legacy-resolver
fi
21 changes: 21 additions & 0 deletions doc/source/changes/6.0.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Version 6.0
------------

* Increased minimums:

- Python: 3.9
- formulaic: 1.0.0
- NumPy: 1.22.3
- SciPy: 1.8.0
- pandas: 1.4.0
- statsmodels: 0.13.0

* The key feature of this release is compatibility with NumPy 2. linearmodels
wheels are built using NumPy 2.0.0rc1 (or later) and can run on any version
of NumPy 1.22.3 or later, including NumPy 2.0.0.
* Improved compatibility with fuure changes in pandas 3.0.0.

.. note::

In order to use NumPy 2, the environment must consist of packages
that have been built against NumPy 2.0.0rc1 or later.
2 changes: 1 addition & 1 deletion linearmodels/iv/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ def _out_of_sample(
)
pred = self.model.predict(self.params, exog=exog, endog=endog, data=data)
if not missing:
pred = pred.loc[pred.notnull().all(1)]
pred = pred.loc[pred.notnull().all(axis=1)]
return pred

def predict(
Expand Down
2 changes: 1 addition & 1 deletion linearmodels/panel/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -3055,7 +3055,7 @@ def single(z: DataFrame) -> Series:
else:
avg_adj_r2 = np.nan
all_params = all_params.iloc[:, 1:-2]
params = np.asarray(all_params.mean(0).values[:, None], dtype=float)
params = np.asarray(all_params.mean(axis=0).values[:, None], dtype=float)

wy = np.asarray(wy_df)
wx = np.asarray(wx_df)
Expand Down
2 changes: 1 addition & 1 deletion linearmodels/panel/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ def _out_of_sample(
)
pred = self.model.predict(self.params, exog=exog, data=data, context=context)
if not missing:
pred = pred.loc[pred.notnull().all(1)]
pred = pred.loc[pred.notnull().all(axis=1)]
return pred

def predict(
Expand Down
6 changes: 3 additions & 3 deletions linearmodels/tests/panel/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,13 +400,13 @@ def test_dummies(mi_df):
data = PanelData(mi_df)
edummy = data.dummies()
assert edummy.shape == (77, 11)
assert np.all(edummy.sum(0) == 7)
assert np.all(edummy.sum(axis=0) == 7)
tdummy = data.dummies(group="time")
assert tdummy.shape == (77, 7)
assert np.all(tdummy.sum(0) == 11)
assert np.all(tdummy.sum(axis=0) == 11)
tdummy_drop = data.dummies(group="time", drop_first=True)
assert tdummy_drop.shape == (77, 6)
assert np.all(tdummy.sum(0) == 11)
assert np.all(tdummy.sum(axis=0) == 11)
with pytest.raises(ValueError):
data.dummies("unknown")

Expand Down
2 changes: 1 addition & 1 deletion linearmodels/tests/panel/test_formula.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,4 +352,4 @@ def test_escaped_variable_name():
)
mod = PanelOLS.from_formula("`var a` ~ 1", data=data)
res = mod.fit()
assert_allclose(res.params, data.mean(0))
assert_allclose(res.params, data.mean(axis=0))
4 changes: 2 additions & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
xarray>=0.16
mypy>=1.3
black[jupyter]==23.11.0
pytest>=7.3.0
black[jupyter]==24.4.0
pytest>=7.3.0,<8
isort>=5.12
ipython
matplotlib
Expand Down
4 changes: 2 additions & 2 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
black[jupyter]==23.11.0
black[jupyter]==24.4.0
coverage
flake8
isort
colorama
matplotlib
pytest>=7.3.0
pytest>=7.3.0,<8
pytest-xdist
pytest-cov
seaborn
Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
numpy>=1.22.3,<3
pandas>=1.4.0
scipy>=1.8.0
statsmodels>=0.12.0
statsmodels>=0.13.0
mypy_extensions>=0.4
Cython>=3.0.10
pyhdfe>=0.1
formulaic>=1.0.0
# versioning
setuptools_scm[toml]>=8.0.0,<9.0.0

0 comments on commit a7deffa

Please sign in to comment.