Skip to content

Commit

Permalink
TEST-modin-project#2670: modify asv tests for using with old modin ve…
Browse files Browse the repository at this point in the history
…rsion

Signed-off-by: Anatoly Myachev <[email protected]>
  • Loading branch information
anmyachev committed Feb 3, 2021
1 parent 1ae90c6 commit c46298b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
12 changes: 5 additions & 7 deletions asv_bench/asv.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// Customizable commands for building, installing, and
// uninstalling the project. See asv.conf.json documentation.
//
// "install_command": ["in-dir={env_dir} python -mpip install {wheel_file}"],
"install_command": ["in-dir={env_dir} python -mpip install {wheel_file}[ray]"],
// "uninstall_command": ["return-code=any python -mpip uninstall -y {project}"],
// "build_command": [
// "python setup.py build",
Expand Down Expand Up @@ -70,12 +70,10 @@
// the package name by 'pip+', and the package will be installed via
// pip (with all the conda available packages installed first,
// followed by the pip installed packages).
"matrix": {
"pandas": ["1.1.5"],
"packaging": [""],
"pip+ray": ["1.0.1"],
"pyarrow": ["1.0"]
},
// "matrix": {
// "pip+ray": ["1.0.1"],
// "pyarrow": ["1.0"]
// },
// Combinations of libraries/python versions can be excluded/included
// from the set to test. Each entry is a dictionary containing additional
// key-value pairs to include/exclude.
Expand Down
17 changes: 15 additions & 2 deletions asv_bench/benchmarks/benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,27 @@
random_booleans,
)

try:
from modin import config # noqa: F401

OLD_MODIN_VERSION = False
except ImportError:
OLD_MODIN_VERSION = True

try:
from modin.config import NPartitions

NPARTITIONS = NPartitions.get()
except ImportError:
from modin.config import CpuCount
if not OLD_MODIN_VERSION:
from modin.config import CpuCount

NPARTITIONS = CpuCount.get()
else:
import os
import multiprocessing

NPARTITIONS = CpuCount.get()
NPARTITIONS = int(os.environ.get("MODIN_CPUS", multiprocessing.cpu_count()))

try:
from modin.config import TestDatasetSize, AsvImplementation
Expand Down

0 comments on commit c46298b

Please sign in to comment.