Skip to content

Commit 2ad19de

Browse files
authored
Merge pull request #104 from ejolly/dev
0.7.8 Release
2 parents b642734 + 9071308 commit 2ad19de

File tree

9 files changed

+23
-17
lines changed

9 files changed

+23
-17
lines changed

conda/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ requirements:
3030
- numpy >=1.16
3131
- pandas >=1.0,<1.2
3232
- patsy >=0.5.1
33-
- rpy2
33+
- rpy2 >=3.4.5,<3.5.0
3434
- scipy >=1.4.0
3535
- seaborn >=0.10.0
3636
- r-base

docs/conf.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@
8585
master_doc = "index"
8686

8787
# General information about the project.
88-
project = u"pymer4"
88+
project = "pymer4"
8989
import time
9090

91-
copyright = u"2017-{}, Eshin Jolly".format(time.strftime("%Y"))
92-
author = u"Eshin Jolly"
91+
copyright = "2017-{}, Eshin Jolly".format(time.strftime("%Y"))
92+
author = "Eshin Jolly"
9393

9494
# The version info for the project you're documenting, acts as replacement for
9595
# |version| and |release|, also used in various other places throughout the
@@ -247,15 +247,15 @@
247247
# (source start file, target name, title,
248248
# author, documentclass [howto, manual, or own class]).
249249
latex_documents = [
250-
(master_doc, "pymer4.tex", u"pymer4 Documentation", u"Eshin Jolly", "manual")
250+
(master_doc, "pymer4.tex", "pymer4 Documentation", "Eshin Jolly", "manual")
251251
]
252252

253253

254254
# -- Options for manual page output ---------------------------------------
255255

256256
# One entry per manual page. List of tuples
257257
# (source start file, name, description, authors, manual section).
258-
man_pages = [(master_doc, "pymer4", u"pymer4 Documentation", [author], 1)]
258+
man_pages = [(master_doc, "pymer4", "pymer4 Documentation", [author], 1)]
259259

260260

261261
# -- Options for Texinfo output -------------------------------------------
@@ -267,7 +267,7 @@
267267
(
268268
master_doc,
269269
"pymer4",
270-
u"pymer4 Documentation",
270+
"pymer4 Documentation",
271271
author,
272272
"pymer4",
273273
"One line description of project.",

docs/new.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ What's New
22
==========
33
Historically :code:`pymer4` versioning was a bit all over the place but has settled down since 0.5.0. This page includes the most notable updates between versions but github is the best place to checkout more details and `releases <https://github.com/ejolly/pymer4/releases/>`_.
44

5+
0.7.8
6+
-----
7+
- Maintenance release that pins :code:`rpy2 >= 3.4.5,< 3.5.1` due to R -> Python dataframe conversion issue on recent :code:`rpy2` versions that causes a `recursion error <https://github.com/rpy2/rpy2/issues/866>`_.
8+
- Pending code changes to support :code:`rpy2 >= 3.5.1` are tracked on `this development branch <https://github.com/ejolly/pymer4/tree/dev_rpy2_3.5.1>`_. **Upcoming releases will drop support for** :code:`rpy2 < 3.5.X`
9+
- Clearer error message when making circular predictions using :code:`Lmer` models
10+
511
0.7.7
612
-----
713
- This version is identical to 0.7.6 but supports :code:`R >= 4.1`

pymer4/models/Lmer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,7 @@ def predict(
951951
required_cols = self.design_matrix.columns[1:]
952952
if not all([col in data.columns for col in required_cols]):
953953
raise ValueError(
954-
"Column names do not match all fixed effects model terms!\nThis may be a false error if some predictors are categorical, in which case you can bypass this check by setting skip_checks=True."
954+
"Column names do not match all fixed effects model terms!\nThis may be a false error if some predictors are categorical, in which case you can bypass this check by setting skip_data_checks=True."
955955
)
956956

957957
if use_rfx:

pymer4/stats.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ def _calc_stats(x, y, val, equal_var):
429429
vn1 = v1 / n1
430430
vn2 = v2 / n2
431431
with np.errstate(divide="ignore", invalid="ignore"):
432-
df = (vn1 + vn2) ** 2 / (vn1 ** 2 / (n1 - 1) + vn2 ** 2 / (n2 - 1))
432+
df = (vn1 + vn2) ** 2 / (vn1**2 / (n1 - 1) + vn2**2 / (n2 - 1))
433433
denom = np.sqrt(vn1 + vn2)
434434
return numerator / denom, df
435435

@@ -616,11 +616,11 @@ def rsquared(y, res, has_constant=True):
616616
"""
617617

618618
y_mean = y.mean()
619-
rss = np.sum(res ** 2)
619+
rss = np.sum(res**2)
620620
if has_constant:
621621
tss = np.sum((y - y_mean) ** 2)
622622
else:
623-
tss = np.sum(y ** 2)
623+
tss = np.sum(y**2)
624624
return 1 - (rss / tss)
625625

626626

pymer4/tests/test_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def test_gaussian_lmm():
156156

157157
# If the user skips check, but tries to predict with rfx then R will complain so we
158158
# can check for an exception raised from R rather than pymer
159-
with pytest.raises(RRuntimeError):
159+
with pytest.raises((RRuntimeError, ValueError)):
160160
model.predict(X, skip_data_checks=True, use_rfx=True)
161161

162162
# Finally a user can turn off every kind of check in which case we expect circular predictions

pymer4/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def _robust_estimator(vals, X, robust_estimator="hc1", n_lags=1, cluster=None):
147147
weights = 1 - np.arange(n_lags + 1.0) / (n_lags + 1.0)
148148

149149
# First compute lag 0
150-
V = np.diag(vals ** 2)
150+
V = np.diag(vals**2)
151151
meat = weights[0] * np.dot(np.dot(X.T, V), X)
152152

153153
# Now loop over additional lags
@@ -161,7 +161,7 @@ def _robust_estimator(vals, X, robust_estimator="hc1", n_lags=1, cluster=None):
161161

162162
else:
163163
# Otherwise deal with estimators that modify the same essential operation
164-
V = np.diag(vals ** 2)
164+
V = np.diag(vals**2)
165165

166166
if robust_estimator == "hc0":
167167
# No modification of residuals
@@ -412,7 +412,7 @@ def _getAplus(mat):
412412
return Q * xdiag * Q.T
413413

414414
def _getPs(mat, W=None):
415-
W05 = np.matrix(W ** 0.5)
415+
W05 = np.matrix(W**0.5)
416416
return W05.I * _getAplus(W05 * mat * W05) * W05.I
417417

418418
def _getPu(mat, W=None):

pymer4/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
"""Specifies current version of pymer4 to be used by setup.py and __init__.py
22
"""
33

4-
__version__ = "0.7.8.dev0"
4+
__version__ = "0.7.8"

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
pandas >= 1.1.0
22
numpy>=1.16.0
3-
rpy2>=3.4.5
3+
rpy2>=3.4.5,<3.5.0
44
seaborn>=0.10.0
55
matplotlib>=3.0
66
patsy>=0.5.1

0 commit comments

Comments
 (0)