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

Benchmark CI fixes #534

Merged
merged 6 commits into from
Apr 27, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
push:
branches:
- main
pull_request:
paths:
- ".github/workflows/benchmark.yml"
- "tests/benchmark.py"

jobs:
build:
Expand Down
11 changes: 6 additions & 5 deletions tests/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,30 +447,31 @@ def main():
"--disable",
nargs="+",
choices=known_libraries,
help=("Remove specified libraries from the benchmarks"),
help="Remove specified libraries from the benchmarks",
default=[],
)

parser.add_argument(
"--factor",
type=float,
default=1.0,
help=("Specify as a fraction speed up benchmarks for development / testing"),
help="Specify as a fraction speed up benchmarks for development / testing",
)

args = parser.parse_args()

disabled_libraires = set(args.disable)
disabled_libraries = set(args.disable)
enabled_libraries = {}
for libname in known_libraries:
if libname not in disabled_libraires:
if libname not in disabled_libraries:
try:
module = importlib.import_module(libname)
except ImportError:
raise ImportError(f"{libname} is not available")
else:
enabled_libraries[libname] = module

# Ensure the modules are avilable in a the global scope
# Ensure the modules are available in the global scope
for libname, module in enabled_libraries.items():
print(f"Enabled {libname} benchmarks")
globals()[libname] = module
Expand Down