Skip to content

Commit 0398568

Browse files
authored
Merge pull request charmlab#20 from zkhotanlou/zahra/workflow/setup-pre-commit-hooks
Add github workflow to run pre-commit hooks on PRs
2 parents 29a4e9b + f705068 commit 0398568

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+30224
-184
lines changed

.github/workflows/pre-commit.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Run pre-commit hooks
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
pre-commit:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Check out the code
11+
uses: actions/checkout@v3
12+
13+
- name: Set up Python
14+
uses: actions/setup-python@v4
15+
with:
16+
python-version: '3.7'
17+
18+
- name: Install dependencies
19+
run: |
20+
pip install pre-commit
21+
pre-commit install-hooks
22+
23+
- name: Run pre-commit hooks
24+
run: pre-commit run --all-files

_deprecated/data/catalog.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from abc import ABC
2-
from typing import Callable, List, Tuple
32

43
import pandas as pd
54
from sklearn.base import BaseEstimator

_deprecated/model/catalog/train_model.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,15 @@
33
import pandas as pd
44
import torch
55
import xgboost
6-
from sklearn.ensemble import RandomForestClassifier
7-
from torch import nn
8-
from torch.utils.data import DataLoader, Dataset
9-
106
from carla.models.catalog.ANN_TF import AnnModel
117
from carla.models.catalog.ANN_TF import AnnModel as ann_tf
128
from carla.models.catalog.ANN_TORCH import AnnModel as ann_torch
139
from carla.models.catalog.Linear_TF import LinearModel
1410
from carla.models.catalog.Linear_TF import LinearModel as linear_tf
1511
from carla.models.catalog.Linear_TORCH import LinearModel as linear_torch
12+
from sklearn.ensemble import RandomForestClassifier
13+
from torch import nn
14+
from torch.utils.data import DataLoader, Dataset
1615

1716

1817
def train_model(

_deprecated/test/test_api.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from abc import ABC
22

33
import pytest
4-
54
from carla.data.api import Data
65
from carla.data.catalog import DataCatalog, OnlineCatalog
76
from carla.models.api import MLModel

_deprecated/test/test_autoencoder.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import numpy as np
22
import tensorflow as tf
33
import torch
4-
from keras import backend as K
5-
64
from carla.data.catalog import OnlineCatalog
75
from carla.models.catalog import MLModelCatalog
86
from carla.recourse_methods.autoencoder import (
@@ -11,6 +9,7 @@
119
VariationalAutoencoder,
1210
train_autoencoder,
1311
)
12+
from keras import backend as K
1413

1514

1615
def test_cs_vae():

_deprecated/test/test_cfmodel.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import numpy as np
22
import pandas as pd
33
import pytest
4-
from tensorflow import Graph, Session
5-
64
from carla.data.catalog import OnlineCatalog
75
from carla.models.catalog import MLModelCatalog
86
from carla.models.negative_instances import predict_negative_instances
@@ -19,6 +17,7 @@
1917
from carla.recourse_methods.catalog.revise import Revise
2018
from carla.recourse_methods.catalog.roar import Roar
2119
from carla.recourse_methods.catalog.wachter import Wachter
20+
from tensorflow import Graph, Session
2221

2322
testmodel = ["ann", "linear"]
2423

_deprecated/test/test_data.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import pytest
2+
from carla.data.catalog import OnlineCatalog
23
from pandas._testing import assert_frame_equal
34
from sklearn import preprocessing
45

5-
from carla.data.catalog import OnlineCatalog
6-
76
testdata = ["adult", "give_me_some_credit", "compas", "heloc"]
87

98

_deprecated/test/test_distributions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import numpy as np
2-
32
from carla.data.load_scm.distributions import (
43
Bernoulli,
54
Gamma,

_deprecated/test/test_evaluations.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import numpy as np
22
import pandas as pd
3-
43
from carla.data.catalog import OnlineCatalog
54
from carla.evaluation import remove_nans
65
from carla.evaluation.catalog import distance

_deprecated/test/test_mlmodel.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import numpy as np
22
import pytest
33
import torch
4-
54
from carla.data.catalog import OnlineCatalog
65
from carla.models.catalog import MLModelCatalog
76

0 commit comments

Comments
 (0)