Skip to content

Commit

Permalink
Ruff checks, pytest passes. #103.
Browse files Browse the repository at this point in the history
  • Loading branch information
bschroeter committed Feb 13, 2024
1 parent 44818a4 commit 222d16d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 14 deletions.
14 changes: 4 additions & 10 deletions benchcab/benchcab.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ def fluxsite_submit_job(self, config_path: str, skip: list[str]) -> None:
project=config["project"],
config_path=config_path,
modules=config["modules"],
pbs_config=config["fluxsite"]["pbs"],
skip_bitwise_cmp="fluxsite-bitwise-cmp" in skip,
benchcab_path=str(self.benchcab_exe_path),
)
Expand Down Expand Up @@ -201,18 +202,11 @@ def checkout(self, config_path: str):

self.logger.info("Checking out repositories...")
rev_number_log = ""

for model in self._get_models(config):
model.repo.checkout()
rev_number_log += f"{model.name}: {model.repo.get_revision()}\n"

# TODO(Sean) we should archive revision numbers for CABLE-AUX
cable_aux_repo = SVNRepo(
svn_root=internal.CABLE_SVN_ROOT,
branch_path=internal.CABLE_AUX_RELATIVE_SVN_PATH,
path=internal.SRC_DIR / "CABLE-AUX",
)
cable_aux_repo.checkout(verbose=verbose)

rev_number_log_path = next_path("rev_number-*.log")
self.logger.info(f"Writing revision number info to {rev_number_log_path}")
with rev_number_log_path.open("w", encoding="utf-8") as file:
Expand Down Expand Up @@ -259,7 +253,7 @@ def fluxsite_run_tasks(self, config_path: str):
self._validate_environment(project=config["project"], modules=config["modules"])

tasks = self.tasks if self.tasks else self._initialise_tasks(config)
print("Running fluxsite tasks...")
self.logger.debug("Running fluxsite tasks...")
try:
multiprocess = config["fluxsite"]["multiprocess"]
except KeyError:
Expand All @@ -286,7 +280,7 @@ def fluxsite_bitwise_cmp(self, config_path: str):
tasks = self.tasks if self.tasks else self._initialise_tasks(config)
comparisons = get_fluxsite_comparisons(tasks)

print("Running comparison tasks...")
self.logger.debug("Running comparison tasks...")
try:
multiprocess = config["fluxsite"]["multiprocess"]
except KeyError:
Expand Down
2 changes: 1 addition & 1 deletion benchcab/fluxsite.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def __init__(
model : Model
Model.
met_forcing_file : str
Met forcinf file.
Met forcing file.
sci_conf_id : int
Science configuration ID.
sci_config : dict
Expand Down
2 changes: 1 addition & 1 deletion benchcab/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def __init__(
Parameters
----------
repo : Repo
Respository.
Repository.
name : Optional[str], optional
Name, by default None
patch : Optional[dict], optional
Expand Down
2 changes: 0 additions & 2 deletions benchcab/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
from pathlib import Path

import yaml

# from benchcab.utils.singleton_logger import SingletonLogger
import logging
import sys

Expand Down

0 comments on commit 222d16d

Please sign in to comment.