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

test codecov report #12

Merged
merged 6 commits into from
Apr 17, 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
2 changes: 1 addition & 1 deletion .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ jobs:
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
flags: unittests, uitests
flags: uitests
fail_ci_if_error: false
verbose: true
428 changes: 234 additions & 194 deletions My_AutoML/_hpo/_base.py

Large diffs are not rendered by default.

51 changes: 50 additions & 1 deletion My_AutoML/_utils/_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Author: Panyi Dong (panyid2@illinois.edu)

-----
Last Modified: Friday, 8th April 2022 10:27:24 pm
Last Modified: Sunday, 17th April 2022 1:02:29 am
Modified By: Panyi Dong (panyid2@illinois.edu)

-----
Expand All @@ -38,6 +38,9 @@
SOFTWARE.
"""

import os
import pickle

# save model
def save_model(
encoder,
Expand Down Expand Up @@ -67,3 +70,49 @@ def save_model(
print(feature_selection_hyperparameters, file=f, end="\n")
f.write("{}\n".format(model))
print(model_hyperparameters, file=f, end="\n")


# save list of methods
def save_methods(file_name, methods):

"""
Parameters
----------
file_name: path of the file to save

methods: list of methods objects to save
"""

with open(file_name, "wb") as out_f:
for method in methods:
pickle.dump(method, out_f)


# load methods
def load_methods(file_name):

"""
Parameters
----------
file_name: path of the file to load
"""

with open(file_name, "rb") as in_f:
results = []

# load all methods
while True:
try:
results.append(pickle.load(in_f))
except EOFError:
break

return results

# find exact folder path
def find_exact_path(path, spec_str) :

for folder in os.listdir(path):

if spec_str in os.path.join(path, folder):
return os.path.join(path, folder)
10 changes: 6 additions & 4 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
codecov:
bot: "codecov-io"
notify:
require_ci_to_pass: yes

Expand All @@ -10,18 +11,19 @@ coverage:
# https://codecov.readme.io/v1.0/docs/commit-status
project:
default:
against: auto
base: auto
target: 70% # specify the target coverage for each commit status
threshold: 40% # allow this little decrease on project
# https://github.com/codecov/support/wiki/Filtering-Branches
# branches: master
if_ci_failed: success
if_ci_failed: error
# https://github.com/codecov/support/wiki/Patch-Status
patch:
default:
against: auto
target: 30% # specify the target "X%" coverage to hit
base: auto
target: 80% # specify the target "X%" coverage to hit
threshold: 50% # allow this much decrease on patch
if_ci_failed: error
changes: false

parsers:
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ matplotlib
ray
ray[tune]
ray[rllib]
# tqdm==4.62.3
# mlflow==1.21.0
tqdm==4.62.3
mlflow==1.21.0
tensorboardX
hyperopt==0.2.5
auto-sklearn==0.14.6
Expand Down
4 changes: 2 additions & 2 deletions requirements_nn.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ matplotlib
ray
ray[tune]
ray[rllib]
# tqdm==4.62.3
# mlflow==1.21.0
tqdm==4.62.3
mlflow==1.21.0
tensorboardX
hyperopt==0.2.5
auto-sklearn==0.14.6
Expand Down
73 changes: 0 additions & 73 deletions tests/test_basic.py

This file was deleted.

98 changes: 0 additions & 98 deletions tests/test_encoding/test_encoding.py

This file was deleted.

38 changes: 19 additions & 19 deletions tests/test_imputer/test_imputer.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Author: Panyi Dong (panyid2@illinois.edu)

-----
Last Modified: Saturday, 16th April 2022 8:42:36 pm
Last Modified: Saturday, 16th April 2022 11:46:30 pm
Modified By: Panyi Dong (panyid2@illinois.edu)

-----
Expand Down Expand Up @@ -80,31 +80,31 @@
# )


# def test_imputer():
def test_imputer():

# from My_AutoML._imputation import imputers
# from My_AutoML._utils import formatting
from My_AutoML._imputation import imputers
from My_AutoML._utils import formatting

# for method_name, method_object in zip(imputers.keys(), imputers.values()):
for method_name, method_object in zip(imputers.keys(), imputers.values()):

# imputer = method_object()
# if method_name != "KNNImputer":
imputer = method_object()
if method_name != "KNNImputer":

# data = pd.read_csv("Appendix/healthcare-dataset-stroke-data.csv")
data = pd.read_csv("Appendix/healthcare-dataset-stroke-data.csv")

# encoder = formatting()
# encoder.fit(data)
encoder = formatting()
encoder.fit(data)

# data = imputer.fill(data)
data = imputer.fill(data)

# assert (
# imputer._fitted == True
# ), "The method {} is not correctly fitted.".format(method_name)
# assert (
# data.isnull().any().any() == False
# ), "The imputation method {} fail to impute all missings.".format(
# method_name
# )
assert (
imputer._fitted == True
), "The method {} is not correctly fitted.".format(method_name)
assert (
data.isnull().any().any() == False
), "The imputation method {} fail to impute all missings.".format(
method_name
)


def test_DummyImputer():
Expand Down
Loading