Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
62195e3
feat(typing): add typing extensions and stubs
simbuerg Jan 14, 2022
0a125f4
feat(typing): add/fix mypy type annotations
simbuerg Jan 14, 2022
00c71ec
feat(typing): add type annotations for likwid module
simbuerg Jan 14, 2022
8a28919
feat(typing): add type annotations for a few more modules
simbuerg Jan 14, 2022
5ef75a5
fix(environments): fix misuse of typed API.
simbuerg Jan 16, 2022
5f2d915
refactor(experiment): use format string.
simbuerg Jan 16, 2022
33fa394
fix(cli/log): fix unreachable type annotations.
simbuerg Jan 16, 2022
596d4de
fix(experiment): make ClassVar -> InstanceVar conversion explicit to …
simbuerg Jan 16, 2022
9c402fb
fix(apollo): make ClassVar -> InstanceVar conversion explicit to the …
simbuerg Jan 16, 2022
1595743
fix(versions): remove unreachable code
simbuerg Jan 16, 2022
a3d4d51
fix(cli/project): fix type annotations
simbuerg Jan 16, 2022
6aed200
fix(experiment): use future annotations support for type annotations
simbuerg Jan 16, 2022
6fcabc9
refactor(utils/actions): use format strings where applicable
simbuerg Jan 16, 2022
85c3cff
refactor: convert .format() to format strings
simbuerg Jan 17, 2022
9d6b9dd
fix(environments): use enumerate_projects instead of projects attribute
simbuerg Jan 17, 2022
1c6b405
fix(container): add some easy type annotations
simbuerg Jan 17, 2022
48bbb71
fix(utils): add some more easy type annotations
simbuerg Jan 17, 2022
55ec321
refactor(typing): add a bunch of additional type annotations.
simbuerg Jan 24, 2022
8c43bbc
refactor(utils/download): add more type annotations/clean code.
simbuerg Jan 24, 2022
8b40d79
refactor(typing): more annotations
simbuerg Jan 24, 2022
f18c3c8
fix(declarative): unbreak CI
simbuerg Jan 24, 2022
5e95b76
refactor(utils/dict): type annotations
simbuerg Jan 25, 2022
9a08544
refactor(utils/wrapping): type annotations
simbuerg Jan 25, 2022
1a9b582
refactor(extensions/base): type annotations
simbuerg Jan 25, 2022
c1c850f
refactor(database): type annotations (incomplete)
simbuerg Jan 25, 2022
a64c14d
fix(python): remove runtime_checkable (python 3.8+)
simbuerg Jan 25, 2022
d3d479d
fix(python): use typing_extensions (python 3.7)
simbuerg Jan 25, 2022
5b74e10
refactor(extensions): type annotations
simbuerg Jan 26, 2022
8347866
fix(utils/db): add forgotten sys import
simbuerg Jan 26, 2022
5d2a077
refactor(extensions): type annotations
simbuerg Jan 26, 2022
043a975
refactor(schema): add type annotations
simbuerg Jan 26, 2022
9703bbd
fix(utils/run): tp.Protocol -> Protocol (3.7)
simbuerg Jan 26, 2022
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
5 changes: 5 additions & 0 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ jobs:
pip install .
pip install mypy
pip install pylint
pip install sqlalchemy[mypy]
pip install types-Jinja2
pip install types-PyYAML
pip install types-six
pip install types-setuptools

- name: Setup reviewdog
run: |
Expand Down
3 changes: 2 additions & 1 deletion benchbuild/cli/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@ def main(self, *args: str) -> int:
if self.store_config:
config_path = ".benchbuild.yml"
CFG.store(config_path)
print("Storing config in {0}".format(os.path.abspath(config_path)))
store_path = os.path.abspath(config_path)
print(f'Storing config in {store_path}')
return 0
3 changes: 2 additions & 1 deletion benchbuild/cli/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ class BBConfigWrite(cli.Application):
def main(self):
config_path = ".benchbuild.yml"
settings.CFG.store(config_path)
print("Storing config in {0}".format(os.path.abspath(config_path)))
store_path = os.path.abspath(config_path)
print(f'Storing config in {store_path}')
23 changes: 12 additions & 11 deletions benchbuild/cli/log.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
""" Analyze the BB database. """
import typing as tp

from plumbum import cli

Expand All @@ -13,9 +14,9 @@ def print_runs(query):
return

for tup in query:
print(("{0} @ {1} - {2} id: {3} group: {4}".format(
tup.end, tup.experiment_name, tup.project_name,
tup.experiment_group, tup.run_group)))
print(
f'{tup.end} @ {tup.experiment_name} - {tup.project_name} id: {tup.experiment_group} group: {tup.run_group}'
)


def print_logs(query, types=None):
Expand All @@ -24,10 +25,10 @@ def print_logs(query, types=None):
return

for run, log in query:
print(("{0} @ {1} - {2} id: {3} group: {4} status: {5}".format(
run.end, run.experiment_name, run.project_name,
run.experiment_group, run.run_group, log.status)))
print(("command: {0}".format(run.command)))
print(
f'{run.end} @ {run.experiment_name} - {run.project_name} id: {run.experiment_group} group: {run.run_group} status: {log.status}'
)
print(f'command: {run.command}')
if "stderr" in types:
print("StdErr:")
print((log.stderr))
Expand Down Expand Up @@ -73,10 +74,10 @@ def log_type(self, types):
""" Set the output types to print. """
self._types = types

_experiments = None
_experiment_ids = None
_project_ids = None
_types = None
_experiments: tp.Optional[tp.List[str]] = None
_experiment_ids: tp.Optional[tp.List[str]] = None
_project_ids: tp.Optional[tp.List[str]] = None
_types: tp.Optional[tp.List[str]] = None

def main(self, *projects):
""" Run the log command. """
Expand Down
2 changes: 1 addition & 1 deletion benchbuild/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def main(self, *args: str) -> int:
init_functions(Session())

if args:
print("Unknown command {0!r}".format(args[0]))
print(f'Unknown command {args[0]!r}')
return 1
if not self.nested_command:
self.help()
Expand Down
6 changes: 2 additions & 4 deletions benchbuild/cli/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def print_project(project: tp.Type[Project], limit: int) -> None:
print(f'domain: {project.DOMAIN}')
print('source:')
for source in project.SOURCE:
num_versions = len(source.versions())
num_versions = len(list(source.versions()))

print(' -', f'{source.remote}')
print(' ', 'default:', source.default)
Expand Down Expand Up @@ -113,9 +113,7 @@ def print_projects(projects: ProjectIndex) -> None:
if prj.GROUP not in grouped_by:
grouped_by[prj.GROUP] = []

grouped_by[prj.GROUP].append(
"{name}/{group}".format(name=prj.NAME, group=prj.GROUP)
)
grouped_by[prj.GROUP].append(f'{prj.NAME}/{prj.GROUP}')

project_column_width = max([
len(f'{p.NAME}/{p.GROUP}') for p in projects.values()
Expand Down
10 changes: 4 additions & 6 deletions benchbuild/cli/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,11 @@ def print_summary(num_actions, failed, duration):
"""
num_failed = len(failed)
print(
"""
f'''
Summary:
{num_total} actions were in the queue.
{num_actions} actions were in the queue.
{num_failed} actions failed to execute.

This run took: {elapsed_time:8.3f} seconds.
""".format(
num_total=num_actions, num_failed=num_failed, elapsed_time=duration
)
This run took: {duration:8.3f} seconds.
'''
)
2 changes: 1 addition & 1 deletion benchbuild/cli/slurm.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def experiment_tag(self, description):
list=True,
requires=["--experiment"],
help="Run a group of projects under the given experiments")
def group(self, groups: tp.List[str]) -> None: # type: ignore
def group(self, groups: tp.List[str]) -> None:
"""Run a group of projects under the given experiments"""
self.group_args = groups

Expand Down
Loading