Skip to content

Commit

Permalink
Fix other instances of job_id missed in #363.
Browse files Browse the repository at this point in the history
  • Loading branch information
bdice committed Dec 6, 2020
1 parent 15833b8 commit fccb388
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions flow/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def hello(job):
help="The operation to execute.",
)
parser.add_argument(
"jobid",
"job_id",
type=str,
nargs="*",
help="The job ids, as registered in the signac project. "
Expand Down Expand Up @@ -238,9 +238,9 @@ def _open_job_by_id(_id):
except LookupError:
raise LookupError(f"Multiple matches for id '{_id}'.")

if len(args.jobid):
if len(args.job_id):
try:
jobs = [_open_job_by_id(jid) for jid in args.jobid]
jobs = [_open_job_by_id(jid) for jid in args.job_id]
except (KeyError, LookupError) as error:
print(error, file=sys.stderr)
sys.exit(1)
Expand Down
2 changes: 1 addition & 1 deletion flow/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -4599,7 +4599,7 @@ def operation_function(job):
operation_function(*aggregate)

def _select_jobs_from_args(self, args):
"""Select jobs with the given command line arguments ('-j/-f/--doc-filter/--jobid')."""
"""Select jobs with the given command line arguments ('-j/-f/--doc-filter/--job-id')."""
if (
not args.func == self._main_exec
and args.job_id
Expand Down
4 changes: 2 additions & 2 deletions flow/scheduling/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ class JobStatus(enum.IntEnum):
class ClusterJob:
"""This class represents a cluster job."""

def __init__(self, jobid, status=None):
self._job_id = jobid
def __init__(self, job_id, status=None):
self._job_id = job_id
self._status = status

def _id(self):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -1183,9 +1183,9 @@ def test_main_run(self):

def test_main_next(self):
assert len(self.project)
jobids = set(self.call_subcmd("next op1").decode().split())
job_ids = set(self.call_subcmd("next op1").decode().split())
even_jobs = [job.get_id() for job in self.project if job.sp.b % 2 == 0]
assert jobids == set(even_jobs)
assert job_ids == set(even_jobs)

def test_main_status(self):
assert len(self.project)
Expand Down

0 comments on commit fccb388

Please sign in to comment.