Skip to content

Commit

Permalink
Temporary commit
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanBryan51 committed Nov 2, 2023
1 parent 7d9e808 commit 16f9766
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions benchcab/benchcab.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,13 @@ def _validate_environment(self, project: str, modules: list):
)
sys.exit(1)

def _get_config(self, config_path) -> dict:
@functools.cache
def _get_config(self, config_path: str) -> dict:
return read_config(config_path)

Check warning on line 99 in benchcab/benchcab.py

View check run for this annotation

Codecov / codecov/patch

benchcab/benchcab.py#L99

Added line #L99 was not covered by tests

@functools.cache
def _get_repos(self, config: dict) -> list[CableRepository]:
def _get_repos(self, config_path: str) -> list[CableRepository]:
config = self._get_config(config_path)
return [

Check warning on line 104 in benchcab/benchcab.py

View check run for this annotation

Codecov / codecov/patch

benchcab/benchcab.py#L103-L104

Added lines #L103 - L104 were not covered by tests
CableRepository(**repo_config, repo_id=id)
for id, repo_config in enumerate(config["realisations"])
Expand Down Expand Up @@ -178,7 +180,7 @@ def checkout(self, config_path: str, verbose: bool):

print("Checking out repositories...")
rev_number_log = ""
for repo in self._get_repos(config):
for repo in self._get_repos(config_path):
repo.checkout(verbose=verbose)

Check warning on line 184 in benchcab/benchcab.py

View check run for this annotation

Codecov / codecov/patch

benchcab/benchcab.py#L183-L184

Added lines #L183 - L184 were not covered by tests
rev_number_log += (
f"{repo.name} last changed revision: "
Expand All @@ -205,7 +207,7 @@ def build(self, config_path: str, verbose: bool):
config = self._get_config(config_path)
self._validate_environment(project=config["project"], modules=config["modules"])

Check warning on line 208 in benchcab/benchcab.py

View check run for this annotation

Codecov / codecov/patch

benchcab/benchcab.py#L207-L208

Added lines #L207 - L208 were not covered by tests

for repo in self._get_repos():
for repo in self._get_repos(config_path):

Check warning on line 210 in benchcab/benchcab.py

View check run for this annotation

Codecov / codecov/patch

benchcab/benchcab.py#L210

Added line #L210 was not covered by tests
if repo.build_script:
print(
"Compiling CABLE using custom build script for "
Expand Down

0 comments on commit 16f9766

Please sign in to comment.