Skip to content

Commit

Permalink
Migrate to macos-latest
Browse files Browse the repository at this point in the history
Signed-off-by: Keith Battocchi <kebatt@microsoft.com>
  • Loading branch information
kbattocchi committed Nov 13, 2024
1 parent 56e48c5 commit 5ab0bf1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,16 @@ jobs:
if: ${{ needs.eval.outputs.testCode == 'True' }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-12]
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
kind: [serial, other, dml, main, treatment, ray]
exclude:
# Serial tests fail randomly on mac sometimes, so we don't run them there
- os: macos-12
- os: macos-latest
kind: serial
# Mac ARM doesn't support tensorflow versions compatible with python 3.8
- os: macos-latest
python-version: '3.8'
# Ray tests run out of memory on Windows
- os: windows-latest
kind: ray
Expand Down Expand Up @@ -249,6 +252,10 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install libomp
# lightgbm needs libomp on mac
run: brew install libomp
if: matrix.os == 'macos-latest'
- name: Install uv
# check if we're running on windows
run: ${{ runner.os == 'Windows' && 'irm https://astral.sh/uv/install.ps1 | iex' || 'curl -LsSf https://astral.sh/uv/install.sh | sh' }}
Expand Down Expand Up @@ -299,7 +306,7 @@ jobs:
strategy:
matrix:
kind: [tests]
os: [ubuntu-latest, windows-latest, macos-12]
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
extras: ["[tf,plt,dowhy,ray]"]
include:
Expand Down
10 changes: 5 additions & 5 deletions econml/tests/test_grf_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,10 +494,10 @@ def test_projection(self,):
forest = RegressionForest(**config).fit(X, y)
projector = np.ones((X.shape[0], 2)) / 2.0
mean_proj, var_proj = forest.predict_projection_and_var(X, projector)
np.testing.assert_array_equal(mean_proj, mean)
np.testing.assert_array_equal(var_proj, var)
np.testing.assert_array_equal(var_proj, forest.predict_projection_var(X, projector))
np.testing.assert_array_equal(mean_proj, forest.predict_projection(X, projector))
np.testing.assert_allclose(mean_proj, mean)
np.testing.assert_allclose(var_proj, var)
np.testing.assert_allclose(var_proj, forest.predict_projection_var(X, projector))
np.testing.assert_allclose(mean_proj, forest.predict_projection(X, projector))
return

def test_feature_importances(self,):
Expand Down Expand Up @@ -547,7 +547,7 @@ def test_feature_importances(self,):
feature_importances /= tw[0]
totest = tree.tree_.compute_feature_importances(normalize=False,
max_depth=max_depth, depth_decay=2.0)
np.testing.assert_array_equal(feature_importances, totest)
np.testing.assert_allclose(feature_importances, totest)

het_importances = np.zeros(n_features)
for it, (feat, depth, left, right, w) in\
Expand Down

0 comments on commit 5ab0bf1

Please sign in to comment.