Skip to content

Commit

Permalink
Add basic cli skaffold
Browse files Browse the repository at this point in the history
  • Loading branch information
indyfree committed Aug 1, 2021
1 parent 7a46567 commit 5785ce1
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 4 deletions.
4 changes: 4 additions & 0 deletions carla/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

from ._logger import INFOFORMATTER

import warnings

warnings.filterwarnings("ignore", message=r"Passing", category=FutureWarning)

log = logging.getLogger(__name__)
log.setLevel(logging.DEBUG)

Expand Down
35 changes: 35 additions & 0 deletions carla/carla.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env python3

import click


@click.group()
def cli():
click.echo("Hello World")


@cli.command()
@click.option(
"--data",
default="ann",
help="The dataset to generate counterfactuals on",
type=click.Choice(["ann", "compas"], case_sensitive=False),
)
@click.option(
"--method",
required=True,
default="gs",
help="The counterfactual method to run",
type=click.Choice(["gs", "face"], case_sensitive=False),
)
def run(method):
click.echo("Run a single counterfactual method")


@cli.command()
def benchmark():
click.echo("Benchmark")


if __name__ == "__main__":
cli()
14 changes: 10 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
],
package_dir={"carla": "carla"},
install_requires=[
"Click==8.0.1",
"dice-ml==0.5",
"h5py==2.10.0",
"ipython",
"keras==2.3.0",
"lime==0.2.0.1",
"mip==1.12.0",
"numpy==1.19.4",
Expand All @@ -44,9 +49,10 @@
"tensorflow==1.14.0",
"torch==1.7.0",
"torchvision==0.8.1",
"h5py==2.10.0",
"dice-ml==0.5",
"ipython",
"keras==2.3.0",
],
entry_points={
"console_scripts": [
"carla = carla.carla:cli",
],
},
)

0 comments on commit 5785ce1

Please sign in to comment.