Skip to content

Commit

Permalink
BUILD: use mamba for faster conda builds (#254)
Browse files Browse the repository at this point in the history
* BUILD: use mamba for faster conda builds

* TEST: relax criteria for feature selection test

* BUILD: run nightly builds on branch 2.2.x
  • Loading branch information
j-ittner authored May 24, 2023
1 parent 0ed4c21 commit eaa49f4
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 12 deletions.
24 changes: 20 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ schedules:
displayName: Nightly full build
branches:
include:
- 2.1.x
- 2.2.x

resources:
repositories:
Expand Down Expand Up @@ -243,7 +243,15 @@ stages:
- script: dir $(Build.SourcesDirectory)

- script: |
conda install -y -c anaconda conda-build~=3.21 conda-verify~=3.4 toml~=0.10 flit~=3.6 packaging~=20.9
# install micromamba
curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest | tar -xvj bin/micromamba
export MAMBA_ROOT_PREFIX=~/micromamba
eval "$(./bin/micromamba shell hook -s posix)"
# create and activate a build environment, then install the tools we need
micromamba create -n build
micromamba activate build
micromamba install -y -c conda-forge boa~=0.14 toml~=0.10 flit~=3.6 packaging~=20.9
displayName: 'Install conda-build, flit, toml'
condition: eq(variables['BUILD_SYSTEM'], 'conda')
Expand All @@ -261,7 +269,11 @@ stages:
targetType: 'inline'
script: |
set -eux
if [ "$BUILD_SYSTEM" = "conda" ] ; then eval "$(conda shell.bash hook)" ; fi
if [ "$BUILD_SYSTEM" = "conda" ] ; then
export MAMBA_ROOT_PREFIX=~/micromamba
eval "$(./bin/micromamba shell hook -s posix)"
micromamba activate build
fi
export RUN_PACKAGE_VERSION_TEST=$(project_name)
cd $(Build.SourcesDirectory)/$(project_root)
Expand Down Expand Up @@ -348,7 +360,11 @@ stages:
targetType: 'inline'
script: |
set -eux
if [ "$BUILD_SYSTEM" = "conda" ] ; then eval "$(conda shell.bash hook)" ; fi
if [ "$BUILD_SYSTEM" = "conda" ] ; then
export MAMBA_ROOT_PREFIX=~/micromamba
eval "$(./bin/micromamba shell hook -s posix)"
micromamba activate build
fi
export RUN_PACKAGE_VERSION_TEST=$(project_name)
cd $(Build.SourcesDirectory)/$(project_root)
Expand Down
20 changes: 12 additions & 8 deletions test/test/sklearndf/transformation/test_extra.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,18 @@ def test_feature_selection_pipeline_df(

feature_selection_pipeline.fit(x, y)

selected_features = set(feature_selection_pipeline.feature_names_out_)
try:
assert set(feature_selection_pipeline.feature_names_out_) == set(
feature_selector.selected_features_
)
assert selected_features == set(feature_selector.selected_features_)
except AttributeError:
pass
assert set(feature_selection_pipeline.feature_names_out_) in [
{"bmi", "bp", "s3", "s5"},
*({"bmi", "bp", "s3", "s5", extra} for extra in ["sex", "s1", "s2", "s6"]),
{"bmi", "bp", "s2", "s5", "s6"},
]

assert {"bmi", "bp", "s5"}.issubset(
selected_features
), "key features have been selected"

assert len(selected_features) <= 5, "no more than 5 features were selected"

assert (selected_features - {"bmi", "bp", "s5"}).issubset(
{"sex", "s1", "s2", "s3", "s6"}
), "additional selected features were not completely irrelevant"

0 comments on commit eaa49f4

Please # to comment.