Skip to content

Commit

Permalink
Merge pull request #55 from MineralsCloud:filter
Browse files Browse the repository at this point in the history
Rename `list*` to `filter*`
  • Loading branch information
singularitti authored Oct 25, 2023
2 parents 9d25a87 + 8939f4e commit 1086b57
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
30 changes: 15 additions & 15 deletions EasyJobsBase/src/status.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ export getstatus,
isexited,
issucceeded,
isfailed,
listpending,
listrunning,
listexited,
listsucceeded,
listfailed,
filterpending,
filterrunning,
filterexited,
filtersucceeded,
filterfailed,
setsucceeded!,
setpending!,
setfailed!
Expand Down Expand Up @@ -56,39 +56,39 @@ Test if the `job` failed during running.
isfailed(job::AbstractJob) = getstatus(job) === FAILED

"""
listpending(jobs)
filterpending(jobs)
Filter the pending jobs in a sequence of jobs.
"""
listpending(jobs) = Iterators.filter(ispending, jobs)
filterpending(jobs) = Iterators.filter(ispending, jobs)

"""
listrunning(jobs)
filterrunning(jobs)
Filter the running jobs in a sequence of jobs.
"""
listrunning(jobs) = Iterators.filter(isrunning, jobs)
filterrunning(jobs) = Iterators.filter(isrunning, jobs)

"""
listexited(jobs)
filterexited(jobs)
Filter the exited jobs in a sequence of jobs.
"""
listexited(jobs) = Iterators.filter(isexited, jobs)
filterexited(jobs) = Iterators.filter(isexited, jobs)

"""
listsucceeded(jobs)
filtersucceeded(jobs)
Filter the succeeded jobs in a sequence of jobs.
"""
listsucceeded(jobs) = Iterators.filter(issucceeded, jobs)
filtersucceeded(jobs) = Iterators.filter(issucceeded, jobs)

"""
listfailed(jobs)
filterfailed(jobs)
Filter the failed jobs in a sequence of jobs.
"""
listfailed(jobs) = Iterators.filter(isfailed, jobs)
filterfailed(jobs) = Iterators.filter(isfailed, jobs)

setsucceeded!(job::AbstractJob) = job.status = SUCCEEDED

Expand Down
12 changes: 6 additions & 6 deletions docs/src/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ isexited
issucceeded
isfailed
isinterrupted
listpending
listrunning
listexited
listsucceeded
listfailed
listinterrupted
filterpending
filterrunning
filterexited
filtersucceeded
filterfailed
filterinterrupted
countexecution
descriptionof
creationtimeof
Expand Down

0 comments on commit 1086b57

Please sign in to comment.