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

Bugfix/np bool deprecation #337

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ repos:
files: ^ngboost
entry: flake8
- id: pylint-ngboost
name: pylint on nboost*
name: pylint on ngboost*
types: [file, python]
language: system
files: ^ngboost
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
6 changes: 3 additions & 3 deletions tests/test_distns.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
# check metric lines up with defaults for lognormal where applicable


Tuple4Array = Tuple[np.array, np.array, np.array, np.array]
Tuple5Array = Tuple[np.array, np.array, np.array, np.array, np.array]
Tuple4Array = Tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray]
Tuple5Array = Tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray]


@pytest.mark.slow
Expand Down Expand Up @@ -151,7 +151,7 @@ def test_categorical(k: int, learner, breast_cancer_data: Tuple4Array):
)
# Ignore the k=1 warning
@pytest.mark.filterwarnings("ignore::UserWarning")
def test_multivariatenormal(k: 2, learner):
def test_multivariatenormal(k: int, learner):
dist = MultivariateNormal(k)

# Generate some sample data
Expand Down
Loading