Skip to content

Commit

Permalink
Bump versions (Trusted-AI#458)
Browse files Browse the repository at this point in the history
fix for github actions CI
  • Loading branch information
hoffmansc authored and andrewklayk committed Sep 8, 2023
1 parent 075adb5 commit e0b3b6a
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 25 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ on:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build-py:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9, '3.10']
python-version: [3.8, 3.9, '3.10', 3.11]

env:
UCI_DB: "https://archive.ics.uci.edu/ml/machine-learning-databases"
Expand Down Expand Up @@ -70,12 +70,12 @@ jobs:
run: pytest tests --cov=aif360 --cov-report=term-missing

build-r:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9, '3.10']
python-version: [3.8, 3.9, '3.10', 3.11]

steps:
- name: Check out repo
Expand Down
13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ Supported Python Configurations:

| OS | Python version |
| ------- | -------------- |
| macOS | 3.7 – 3.10 |
| Ubuntu | 3.7 – 3.10 |
| Windows | 3.7 – 3.10 |
| macOS | 3.8 – 3.11 |
| Ubuntu | 3.8 – 3.11 |
| Windows | 3.8 – 3.11 |

### (Optional) Create a virtual environment

Expand All @@ -95,10 +95,10 @@ is sufficient (see [the difference between Anaconda and
Miniconda](https://conda.io/docs/user-guide/install/download.html#anaconda-or-miniconda)
if you are curious) if you do not already have conda installed.

Then, to create a new Python 3.7 environment, run:
Then, to create a new Python 3.11 environment, run:

```bash
conda create --name aif360 python=3.7
conda create --name aif360 python=3.11
conda activate aif360
```

Expand All @@ -110,9 +110,6 @@ The shell should now look like `(aif360) $`. To deactivate the environment, run:

The prompt will return to `$ `.

Note: Older versions of conda may use `source activate aif360` and `source
deactivate` (`activate aif360` and `deactivate` on Windows).

### Install with `pip`

To install the latest stable version from PyPI, run:
Expand Down
6 changes: 3 additions & 3 deletions aif360/aif360-r/R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#' only occur within RStudio).
#'
#' @param conda_python_version the python version installed in the created conda
#' environment. Python 3.6 is installed by default.
#' environment. Python 3.11 is installed by default.
#'
#' @param ... other arguments passed to [reticulate::conda_install()] or
#' [reticulate::virtualenv_install()].
Expand All @@ -33,13 +33,13 @@ install_aif360 <- function(method = c("auto", "virtualenv", "conda"),
envname = NULL,
extra_packages = NULL,
restart_session = TRUE,
conda_python_version = "3.7",
conda_python_version = "3.11",
...) {

method <- match.arg(method)

reticulate::py_install(
packages = c("aif360", "numba", "BlackBoxAuditing", "tensorflow>=1.13.1,<2", "pandas",
packages = c("aif360", "numba", "BlackBoxAuditing", "tensorflow>=1.13.1,<2", "pandas",
"fairlearn==0.4.6", "protobuf==3.20.1"),
envname = envname,
method = method,
Expand Down
16 changes: 8 additions & 8 deletions aif360/algorithms/postprocessing/eq_odds_postprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,29 +143,29 @@ def fit(self, dataset_true, dataset_pred):

sm_tn = np.logical_and(sflip,
y_true[cond_vec_priv] == dataset_true.unfavorable_label,
dtype=np.float64)
).astype(np.float64)
sm_fn = np.logical_and(sflip,
y_true[cond_vec_priv] == dataset_true.favorable_label,
dtype=np.float64)
).astype(np.float64)
sm_fp = np.logical_and(sconst,
y_true[cond_vec_priv] == dataset_true.unfavorable_label,
dtype=np.float64)
).astype(np.float64)
sm_tp = np.logical_and(sconst,
y_true[cond_vec_priv] == dataset_true.favorable_label,
dtype=np.float64)
).astype(np.float64)

om_tn = np.logical_and(oflip,
y_true[cond_vec_unpriv] == dataset_true.unfavorable_label,
dtype=np.float64)
).astype(np.float64)
om_fn = np.logical_and(oflip,
y_true[cond_vec_unpriv] == dataset_true.favorable_label,
dtype=np.float64)
).astype(np.float64)
om_fp = np.logical_and(oconst,
y_true[cond_vec_unpriv] == dataset_true.unfavorable_label,
dtype=np.float64)
).astype(np.float64)
om_tp = np.logical_and(oconst,
y_true[cond_vec_unpriv] == dataset_true.favorable_label,
dtype=np.float64)
).astype(np.float64)

# A_eq - 2-D array which, when matrix-multiplied by x,
# gives the values of the equality constraints at x
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
long_description_content_type='text/markdown',
license='Apache License 2.0',
packages=[pkg for pkg in find_packages() if pkg.startswith('aif360')],
python_requires='>=3.7',
python_requires='>=3.8',
install_requires=[
'numpy>=1.16',
'scipy>=1.2.0',
Expand Down
2 changes: 1 addition & 1 deletion tests/sklearn/test_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def test_cache_meps(panel):
meps_raw = fetch_meps(panel, cache=False, accept_terms=True)[0]
fetch_meps(panel, cache=True, accept_terms=True)
meps_cached = fetch_meps(panel, cache=True)[0]
assert_frame_equal(meps_raw, meps_cached, check_dtype=False)
assert_frame_equal(meps_raw, meps_cached, check_dtype=False, check_categorical=False)
assert_array_equal(meps_raw.to_numpy(), meps_cached.to_numpy())

@pytest.mark.parametrize(
Expand Down

0 comments on commit e0b3b6a

Please sign in to comment.