-
Notifications
You must be signed in to change notification settings - Fork 43
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
deps: remove scikit-learn as a required dependency #1296
base: main
Are you sure you want to change the base?
Conversation
if len(x_pandas) < 2: | ||
raise ValueError( | ||
f"At least 2 points are needed to compute area under curve, but x.shape = {len(x_pandas)}" | ||
) | ||
|
||
if x_pandas.is_monotonic_decreasing: | ||
d = -1 | ||
elif x_pandas.is_monotonic_increasing: | ||
d = 1 | ||
else: | ||
raise ValueError(f"x is neither increasing nor decreasing : {x_pandas}.") | ||
|
||
if hasattr(np, "trapezoid"): | ||
# new in numpy 2.0 | ||
return d * np.trapezoid(y_pandas, x_pandas) | ||
# np.trapz has been deprecated in 2.0 | ||
return d * np.trapz(y_pandas, x_pandas) # type: ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this code is copied from sklearn, we should put it in the third_party/bigframes_vendored
directory.
session.install( | ||
"scikit-learn>=1.2.2", | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not install optional dependencies in unit_noextras
. The intention of such test sessions is to make sure that dependencies that are marked as optional are truly optional. This risks making a forced dependency on this package.
Also, prefer removing the package from other sessions as well.
session.install( | ||
"scikit-learn>=1.2.2", | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there is optional functionality that needs scikit-learn
, please use the "extras" section in setup.py
. Don't install packages this way.
This is not a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do not merge as is. We are opening our customers up to a big risk of having a broken installation by installing scikit-learn
in so many of our test sessions.
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #<issue_number_goes_here> 🦕