-
Notifications
You must be signed in to change notification settings - Fork 2
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
Enable CI on windows-latest
#48
Conversation
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more Additional details and impacted files@@ Coverage Diff @@
## main #48 +/- ##
==========================================
+ Coverage 96.79% 96.86% +0.06%
==========================================
Files 31 31
Lines 1499 1499
==========================================
+ Hits 1451 1452 +1
+ Misses 48 47 -1
|
27064b9
to
b222365
Compare
Tests failing on Windows: https://github.com/bancaditalia/black-it/actions/runs/4451921576/jobs/7819104632?pr=48#step:6:3367
|
83c7a50
to
41754d9
Compare
cc206fd
to
19af72c
Compare
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.
LGTM, thanks. After this and #47 we should probably advertise that we now support Windows and MacOS on the GitHub page and on the website, but we can do this in another PR
.github/workflows/test.yml
Outdated
@@ -13,7 +13,7 @@ jobs: | |||
|
|||
strategy: | |||
matrix: | |||
os: [ubuntu-latest] | |||
os: [ubuntu-latest, windows-latest] |
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.
👍🏼
@@ -135,6 +135,7 @@ def fit(self, X: NDArray[np.float64], y: NDArray[np.float64]) -> None: | |||
max_depth=self.max_depth, # original: 5 | |||
alpha=self.alpha, | |||
n_estimators=self.n_estimators, | |||
random_state=self._get_random_seed(), |
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.
sorry, probably my fault, thanks for spotting it!
c1add84
to
b5e8818
Compare
In XGBoostSampler.fit, XGBRegressor constructor did not have the random_state argument set; this ended up in non-reproducible results even if random_state of the BaseSampler was set correctly.
This commit fixes a subtle bug in XGBoostSampler._clip_losses. The check on large/small floats makes use of np.where, which returns a tuple where the conditions provided in input hold. In case of one condition, it returns a tuple of one element. However, right below, the result was used as if it were the actual list of items that satisfied the condition, rather than as it is wrapped with a tuple. This makes the check always to fail, and to clip even when not needed. The proposed change correctly unpacks the tuple returned by np.where.
This change is motivated by the fact that, for some reason, the representation of Numpy arrays in Windows also include their dtype. For example, running the following code snippet on Linux: GslDivLoss.discretize( [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], nb_values = 3, start_index = 1, stop_index = 10 ) Gives: array([1, 1, 1, 2, 2, 2, 2, 3, 3, 3]) While on Windows, the same code produces the following representation: array([1, 1, 1, 2, 2, 2, 2, 3, 3, 3], dtype=int64) This of course led to the failure of the doctest, since it is based on the representation of the object being tested for equality. Using .tolist() was a relatively straighforward (although less elegant) solution.
We had to workaround issue #49 by providing different expected results for Windows.
b5e8818
to
a0d857d
Compare
6a3b098
to
f4655d5
Compare
Proposed changes
This PR makes the test CI workflow to run over windows-latest.
Fixes
n/a
Types of changes
What types of changes does your code introduce?
Put an
x
in the boxes that applyChecklist
n/a