Skip to content
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

Add Devcontainer #77

Merged
merged 8 commits into from
Jul 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM mcr.microsoft.com/vscode/devcontainers/python:3.9

RUN /usr/local/bin/python -m pip install --upgrade pip
25 changes: 25 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// For format details, see https://aka.ms/devcontainer.json.
{
"name": "fseval",
"dockerFile": "Dockerfile",
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"eamodio.gitlens",
"GitHub.vscode-pull-request-github"
],
"settings": {
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"python.formatting.provider": "black",
"python.linting.enabled": true,
"python.linting.mypyEnabled": true,
"python.envFile": "${workspaceFolder}/.env"
}
}
},
"postCreateCommand": "pip install -r requirements.txt && pip install -r .devcontainer/requirements.txt && pip install --upgrade setuptools wheel",
"remoteUser": "vscode"
}
4 changes: 4 additions & 0 deletions .devcontainer/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
mypy
pytest
pytest-cov
black
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# fseval

[![build status](https://github.com/dunnkers/fseval/actions/workflows/python-app.yml/badge.svg)](https://github.com/dunnkers/fseval/actions/workflows/python-app.yml) [![pypi badge](https://img.shields.io/pypi/v/fseval.svg?maxAge=3600)](https://pypi.org/project/fseval/) [![Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![Downloads](https://pepy.tech/badge/fseval/month)](https://pepy.tech/project/fseval) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/fseval) [![codecov](https://codecov.io/gh/dunnkers/fseval/branch/master/graph/badge.svg?token=R5ZXH8UPCI)](https://codecov.io/gh/dunnkers/fseval) [![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/dunnkers/fseval.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/dunnkers/fseval/context:python) ![PyPI - License](https://img.shields.io/pypi/l/hydra-core) [![DOI](https://zenodo.org/badge/274001213.svg)](https://zenodo.org/badge/latestdoi/274001213)
[![build status](https://github.com/dunnkers/fseval/actions/workflows/python-app.yml/badge.svg)](https://github.com/dunnkers/fseval/actions/workflows/python-app.yml) [![pypi badge](https://img.shields.io/pypi/v/fseval.svg?maxAge=3600)](https://pypi.org/project/fseval/) [![Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![Downloads](https://pepy.tech/badge/fseval/month)](https://pepy.tech/project/fseval) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/fseval) [![codecov](https://codecov.io/gh/dunnkers/fseval/branch/master/graph/badge.svg?token=R5ZXH8UPCI)](https://codecov.io/gh/dunnkers/fseval) [![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/dunnkers/fseval.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/dunnkers/fseval/context:python) ![PyPI - License](https://img.shields.io/pypi/l/hydra-core) [![DOI](https://zenodo.org/badge/274001213.svg)](https://zenodo.org/badge/latestdoi/274001213) [![Open in Remote - Containers](https://img.shields.io/static/v1?label=Remote%20-%20Containers&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/dunnkers/fseval)


Benchmarking framework for Feature Selection and Feature Ranking algorithms 🚀

Expand Down
7 changes: 4 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
hydra-core==1.1.2
hydra-colorlog==1.1.0
numpy>=1.19
pandas>=1
pandas>=1.1
scikit-learn>=0.24
humanfriendly>=9
shortuuid>=1.0
Expand All @@ -10,7 +10,7 @@ types-dataclasses>=0.6
PyYAML>=6
types-PyYAML>=6
SQLAlchemy>=1
wandb>=0.12
wandb==0.12.11
-e git+https://github.com/dunnkers/FeatBoost.git@b81059ea4c5ac49fec075e823491104fae3d12b7#egg=featboost
-e git+https://github.com/dunnkers/infinite-selection.git@6c9db1d5fe1b12bc34eb2af5893a4f3ca385aaff#egg=infinite_selection
-e git+https://github.com/dunnkers/stability-selection.git@baf54e7526bbce57d80871fcd93cdfdd67972a43#egg=stability_selection
Expand All @@ -22,4 +22,5 @@ skfeature-chappers>=1.0
skrebate>=0.62
xgboost>=1
pytest-dependency
overrides>=6
overrides>=6
protobuf==3.20.0
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
},
include_package_data=True,
install_requires=[
"hydra-core>=1.1.0",
"hydra-colorlog>=1.1.0",
"hydra-core==1.1.2",
"hydra-colorlog==1.1.0",
"numpy>=1.19",
"pandas>=1.1",
"scikit-learn>=0.24",
Expand Down
1 change: 1 addition & 0 deletions src/stability-selection
Submodule stability-selection added at baf54e
17 changes: 8 additions & 9 deletions tests/integration/pipelines/test_rank_and_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
import numpy as np
import pandas as pd
import pytest
from hydra.core.config_store import ConfigStore
from hydra.utils import instantiate
from omegaconf import DictConfig, open_dict
from sklearn.base import BaseEstimator

from fseval.config import (
CrossValidatorConfig,
DatasetConfig,
Expand All @@ -16,8 +11,13 @@
ResampleConfig,
)
from fseval.pipeline.dataset import Dataset, DatasetLoader
from fseval.types import AbstractAdapter, IncompatibilityError, Task
from fseval.types import AbstractAdapter, Task
from fseval.utils.hydra_utils import get_config
from hydra.core.config_store import ConfigStore
from hydra.errors import InstantiationException
from hydra.utils import instantiate
from omegaconf import DictConfig, open_dict
from sklearn.base import BaseEstimator

cs = ConfigStore.instance()

Expand Down Expand Up @@ -67,7 +67,6 @@ def get_data(self) -> Tuple[List, List]:

ranker: EstimatorConfig = EstimatorConfig(
name="Random Ranker",
task=Task.classification,
estimator=random_estimator,
_estimator_type="classifier",
is_multioutput_dataset=False,
Expand Down Expand Up @@ -207,7 +206,7 @@ def test_with_ranker_gt_no_importances_substitution(cfg: PipelineConfig):


def test_validator_incompatibility_check(cfg: PipelineConfig):
with pytest.raises(IncompatibilityError):
with pytest.raises(InstantiationException):
cfg.dataset.n = 5
cfg.dataset.p = 5
cfg.dataset.multioutput = False
Expand All @@ -216,7 +215,7 @@ def test_validator_incompatibility_check(cfg: PipelineConfig):


def test_ranker_incompatibility_check(cfg: PipelineConfig):
with pytest.raises(IncompatibilityError):
with pytest.raises(InstantiationException):
cfg.dataset.n = 5
cfg.dataset.p = 5
cfg.dataset.multioutput = False
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from fseval.types import IncompatibilityError
from fseval.utils.hydra_utils import get_config
from hydra.conf import ConfigStore
from hydra.errors import InstantiationException


@pytest.fixture
Expand Down Expand Up @@ -66,7 +67,7 @@ def test_pipeline_incompatibility(incompatible_cfg: PipelineConfig):
"""Pipeline should throw IncompatibilityError when trying to run a classification
method on a regression dataset."""

with pytest.raises(IncompatibilityError):
with pytest.raises(InstantiationException):
run_pipeline(incompatible_cfg, raise_incompatibility_errors=True)


Expand Down
9 changes: 5 additions & 4 deletions tests/unit/pipeline/test_estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@

import pytest
from hydra.utils import instantiate
from hydra.errors import InstantiationException
from omegaconf import OmegaConf
from sklearn.base import BaseEstimator

from fseval.config import EstimatorConfig
from fseval.pipeline.estimator import Estimator
from fseval.storage.local import LocalStorage
from fseval.types import CacheUsage, IncompatibilityError, Task
from fseval.types import CacheUsage, Task


@pytest.fixture
Expand Down Expand Up @@ -79,23 +80,23 @@ def test_incompatibility(estimator_cfg: EstimatorConfig):
# classification estimator, but regression task
estimator_cfg._estimator_type = "classifier"
estimator_cfg.task = Task.regression
with pytest.raises(IncompatibilityError):
with pytest.raises(InstantiationException):
instantiate(estimator_cfg)

# multioutput, but estimator does not support it (`multioutput=False`)
estimator_cfg._estimator_type = "classifier"
estimator_cfg.task = Task.classification
estimator_cfg.multioutput = False
estimator_cfg.is_multioutput_dataset = True
with pytest.raises(IncompatibilityError):
with pytest.raises(InstantiationException):
instantiate(estimator_cfg)

# multioutput only, but
estimator_cfg._estimator_type = "classifier"
estimator_cfg.task = Task.classification
estimator_cfg.multioutput_only = True
estimator_cfg.is_multioutput_dataset = False
with pytest.raises(IncompatibilityError):
with pytest.raises(InstantiationException):
instantiate(estimator_cfg)


Expand Down