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

Add CLI entrypoints for module and program invocation #152

Merged
merged 2 commits into from
Oct 24, 2024
Merged

Conversation

nicholasjng
Copy link
Collaborator

Supports nnbench <benchmark> <options> as well as python -m nnbench <benchmark> <options>.

Like pytest, we give the option to omit the target location, in which case it becomes a directory named "benchmarks".

Supports a very rudimentary context building from switches method, and tag filtering via switch.

Supports `nnbench <benchmark> <options>` as well as
`python -m nnbench <benchmark> <options>`.

Like pytest, we give the option to omit the target location, in which
case it becomes a directory named "benchmarks".

Supports a very rudimentary context building from switches method, and
tag filtering via switch.
@nicholasjng nicholasjng requested a review from maxmynter October 24, 2024 12:44
@nicholasjng
Copy link
Collaborator Author

Test setup:

# example.py

import nnbench

# no idea yet how to hand off args on the command line, so we need them hardcoded.
@nnbench.benchmark
def add(a: int = 1, b: int = 2) -> float:
    return a + b

Then, nnbench example.py or python -m nnbench example.py does the trick. Bonus: If you put the file into a directory named "benchmarks", even nnbench without any args works.

@nicholasjng nicholasjng merged commit 7532f99 into main Oct 24, 2024
11 checks passed
@nicholasjng nicholasjng deleted the cli-workflow branch October 24, 2024 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant