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

ci: run_examples warnings to errors #2208

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
10 changes: 8 additions & 2 deletions examples/daal4py/readcsv.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,25 @@
# limitations under the License.
# ==============================================================================

from importlib.machinery import SourceFileLoader
from importlib.util import module_from_spec, spec_from_file_location
from pathlib import Path

utils_path = Path(__file__).parent.parent / "utils"
module_name = "readcsv"
module_path = str(utils_path / "readcsv.py")

readcsv = SourceFileLoader("readcsv", str(utils_path / "readcsv.py")).load_module()
spec = spec_from_file_location(module_name, module_path)
readcsv = module_from_spec(spec)
spec.loader.exec_module(readcsv)

np_read_csv = readcsv.np_read_csv
pd_read_csv = readcsv.pd_read_csv
csr_read_csv = readcsv.csr_read_csv
read_next = readcsv.read_next

__all__ = [
"np_read_csv",
"pd_read_csv",
"csr_read_csv",
"read_next",
]
8 changes: 6 additions & 2 deletions examples/mb/readcsv.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@
# limitations under the License.
# ==============================================================================

from importlib.machinery import SourceFileLoader
from importlib.util import module_from_spec, spec_from_file_location
from pathlib import Path

utils_path = Path(__file__).parent.parent / "utils"
module_name = "readcsv"
module_path = str(utils_path / "readcsv.py")

readcsv = SourceFileLoader("readcsv", str(utils_path / "readcsv.py")).load_module()
spec = spec_from_file_location(module_name, module_path)
readcsv = module_from_spec(spec)
spec.loader.exec_module(readcsv)

np_read_csv = readcsv.np_read_csv
pd_read_csv = readcsv.pd_read_csv
Expand Down
4 changes: 2 additions & 2 deletions examples/sklearnex/knn_bf_regression_spmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import numpy as np
from mpi4py import MPI
from numpy.testing import assert_allclose
from sklearn.metrics import mean_squared_error
from sklearn.metrics import root_mean_squared_error

from sklearnex.spmd.neighbors import KNeighborsRegressor

Expand Down Expand Up @@ -80,6 +80,6 @@ def generate_X_y(par, coef_seed, data_seed):
)
print(
"RMSE for entire rank {}: {}\n".format(
rank, mean_squared_error(y_test, dpt.to_numpy(y_predict), squared=False)
rank, root_mean_squared_error(y_test, dpt.to_numpy(y_predict))
)
)
8 changes: 5 additions & 3 deletions tests/run_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,12 @@ def get_exe_cmd(ex, args):
return None
if not args.nodist and ex.endswith("spmd.py"):
if IS_WIN:
return 'mpiexec -localonly -n 4 "' + sys.executable + '" "' + ex + '"'
return 'mpirun -n 4 "' + sys.executable + '" "' + ex + '"'
return (
'mpiexec -localonly -n 4 "' + sys.executable + '" -W error "' + ex + '"'
)
return 'mpirun -n 4 "' + sys.executable + '" -W error "' + ex + '"'
else:
return '"' + sys.executable + '" "' + ex + '"'
return '"' + sys.executable + '" -W error "' + ex + '"'


def run(exdir, logdir, args):
Expand Down
Loading