Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add py311, remove py37 #320

Merged
merged 11 commits into from
Jan 29, 2024
2 changes: 1 addition & 1 deletion .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']
python-version: ['3.8', '3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v2
Expand Down
4 changes: 3 additions & 1 deletion examples/experiments/survival_exp.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
def Y_join(T, E):
col_event = "Event"
col_time = "Time"
y = np.empty(dtype=[(col_event, np.bool), (col_time, np.float64)], shape=T.shape[0])
y = np.empty(
dtype=[(col_event, np.bool_), (col_time, np.float64)], shape=T.shape[0]
)
y[col_event] = E.values
y[col_time] = T.values
return y
Expand Down
2 changes: 1 addition & 1 deletion ngboost/distns/categorical.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""The NGBoost categorial distribution and scores"""
# pylint: disable=invalid-unary-operand-type, unused-argument, no-self-use
# pylint: disable=invalid-unary-operand-type, unused-argument
import numpy as np
import scipy as sp

Expand Down
4 changes: 2 additions & 2 deletions ngboost/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def Y_from_censored(T, E=None):
else:
E = check_array(E, ensure_2d=False)
E = E.reshape(E.shape[0])
Y = np.empty(dtype=[("Event", np.bool), ("Time", np.float64)], shape=T.shape[0])
Y["Event"] = E.astype(np.bool)
Y = np.empty(dtype=[("Event", np.bool_), ("Time", np.float64)], shape=T.shape[0])
Y["Event"] = E.astype(np.bool_)
Y["Time"] = T.astype(np.float64)
return Y
4 changes: 2 additions & 2 deletions ngboost/ngboost.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# pylint: disable=line-too-long,too-many-instance-attributes,too-many-arguments
# pylint: disable=unused-argument,too-many-locals,too-many-branches,too-many-statements
# pylint: disable=unused-variable,invalid-unary-operand-type,attribute-defined-outside-init
# pylint: disable=redundant-keyword-arg,protected-access
# pylint: disable=redundant-keyword-arg,protected-access,unnecessary-lambda-assignment
jack-mcivor marked this conversation as resolved.
Show resolved Hide resolved
import numpy as np
from sklearn.base import clone
from sklearn.model_selection import train_test_split
Expand Down Expand Up @@ -290,7 +290,7 @@ def fit(
best_val_loss = np.inf

if not train_loss_monitor:
train_loss_monitor = lambda D, Y, W: D.total_score( # NOQA
train_loss_monitor = lambda D, Y, W: D.total_score( # noqa
Y, sample_weight=W
)

Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ classifiers = [
license = "Apache License 2.0"

[tool.poetry.dependencies]
python = ">=3.7.1, <3.11"
python = ">=3.8, <3.12"
scikit-learn = ">=1.0.2"
numpy = ">=1.21.2"
scipy = ">=1.7.2"
tqdm = ">=4.3"
lifelines = ">=0.25"
pandas = ">=1.3.5"

[tool.poetry.dev-dependencies]
pytest = "^6.1.2"
Expand Down
1 change: 1 addition & 0 deletions tests/test_score.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pylint: disable=unnecessary-lambda-assignment
from typing import List, Tuple

import numpy as np
Expand Down