Commit 1e92ce93 authored by S. Lackner's avatar S. Lackner

[doc] Fix sphinx issues in documentation

parent 47e47366
......@@ -13,9 +13,9 @@ from .profiles import *
from .alloc import *
__all__ = [
Scheduler, as_scheduler,
Job, Jobs,
Resource, Resources,
Profiles, Profile,
Allocation,
"Scheduler", "as_scheduler",
"Job", "Jobs",
"Resource", "Resources",
"Profiles", "Profile",
"Allocation",
]
......@@ -12,7 +12,7 @@ def filler_sched(scheduler, abort_on_first_nonfitting=False, jobs=None):
never fit into the machine.
:param abort_on_first_nonfitting: whether or not the filling should be aborted on the first
job which does not fit (default: `False`)
job which does not fit (default: `False`)
"""
abort_on_first_nonfitting = (
......
......@@ -150,8 +150,8 @@ class Allocation:
:param job: the job to be checked whether or not it fits
:param remaining_time: the time which still remains on this allocation. If not given the
actual remaining time is returned.
:param remaining_time: the time which still remains on this allocation.
If not given the actual remaining time is returned.
"""
if remaining_time is None:
elapsed_time = job._scheduler.time - self.start_time
......@@ -250,9 +250,8 @@ class Allocation:
def free(self):
"""Either free a finished allocation or clear an allocation which was not started yet.
:param scheduler: The scheduler argument is required when a finished allocation
should be freed. It is not required to clear an allocation which was not started
yet.
:param scheduler: The scheduler argument is required when a finished allocation should be freed.
It is not required to clear an allocation which was not started yet.
"""
assert not self._previously_allocated, "Allocation is in invalid state"
if not self._allocated:
......
......@@ -304,7 +304,7 @@ class Job:
"""Whether or not all dependencies of this job are fulfilled.
:param jobs: a list of all jobs in the system which is needed to resolve
the actual jobs to which the dependencies are referring
the actual jobs to which the dependencies are referring
"""
for dep in self.resolved_dependencies:
if not isinstance(dep, Job) or not dep.completed:
......@@ -361,8 +361,8 @@ class Job:
In this case the times of the allocation are not touched as long as the job
fits in the walltime.
:param resource: either a single `Resource` a list in the form of a `Resources`
object or an `Allocation`
:param resource: either a single `Resource` a list in the form of a
`Resources` object or an `Allocation`
"""
assert self._batsim_job, "Batsim job is not set => job was not correctly initialised"
assert self._allocation is None, "Job has already an allocation"
......@@ -568,11 +568,13 @@ class Job:
:param requested_time: the number of requested time (walltime)
:param profile: The profile object (either a `Profile` object or a dictionary containing the
actual Batsim profile configuration).
:param profile: The profile object (either a `Profile` object or a
dictionary containing the actual Batsim profile configuration).
:param workload_name: The name of the workload which should be chosen if the profiles should be cached,
since profiles are always related to their workload. If omitted a dynamically generated name for the workload will be used.
:param workload_name: The name of the workload which should be chosen if
the profiles should be cached, since profiles are
always related to their workload. If omitted a
dynamically generated name for the workload will be used.
"""
return DynamicJobRequest(*args, **kwargs)
......@@ -587,11 +589,13 @@ class Job:
:param requested_time: the number of requested time (walltime)
:param profile: The profile object (either a `Profile` object or a dictionary containing the
actual Batsim profile configuration).
:param profile: The profile object (either a `Profile` object or a
dictionary containing the actual Batsim profile configuration).
:param workload_name: The name of the workload which should be chosen if the profiles should be cached,
since profiles are always related to their workload. If omitted a dynamically generated name for the workload will be used.
:param workload_name: The name of the workload which should be chosen if
the profiles should be cached, since profiles are
always related to their workload. If omitted a
dynamically generated name for the workload will be used.
"""
assert self._batsim_job, "Batsim job is not set => job was not correctly initialised"
return DynamicJobRequest(*args, parent_job=self, **kwargs)
......@@ -606,11 +610,13 @@ class DynamicJobRequest(Job):
:param requested_time: the number of requested time (walltime)
:param profile: The profile object (either a `Profile` object or a dictionary containing the
actual Batsim profile configuration).
:param profile: The profile object (either a `Profile` object or a dictionary
containing the actual Batsim profile configuration).
:param workload_name: The name of the workload which should be chosen if the profiles should be cached,
since profiles are always related to their workload. If omitted a dynamically generated name for the workload will be used.
:param workload_name: The name of the workload which should be chosen if the
profiles should be cached, since profiles are always
related to their workload. If omitted a dynamically
generated name for the workload will be used.
:param parent_job: the parental job object if this job should be a sub job
"""
......
......@@ -43,7 +43,7 @@ class Logger:
"""Base logger class which handles various cases needed for the loggers.
:param obj: either a string with the name of the logger or an object or a type
(in which case the logger will be based on the type).
(in which case the logger will be based on the type).
:param logger_suffix: a suffix appended to the generated logger name
......@@ -54,7 +54,6 @@ class Logger:
:param to_file: the file to log to if set (will be overwritten each time)
:param append_to_file: the file to log to if set (new lines will be appended)
"""
def __init__(
......
......@@ -121,6 +121,7 @@ class Resource:
"""Finds the first time after which the requested walltime is available for a job start.
:param requested_walltime: the size of the requested time slot
:param time: the starting time after which a time slot is needed
"""
if time is None:
......@@ -265,8 +266,7 @@ class Resources(ObserveList):
:param requested_walltime: the walltime which should fit in the allocation
:param time: the earliest allowed start time of the allocation
time are allowed
:param time: the earliest allowed start time of the allocation time are allowed
:param min_matches: discard resources if less than `min_matches` were found
......@@ -301,8 +301,8 @@ class Resources(ObserveList):
:param job: the job for which the start times and resources should be found
:param allow_future_allocations: whether or not allocations starting after the current simulation
time are allowed
:param allow_future_allocations: whether or not allocations starting after
the current simulation time are allowed
:param args: forwarded to filter the resources
......@@ -326,8 +326,8 @@ class Resources(ObserveList):
:param job: the job for which the start times and resources should be found
:param allow_future_allocations: whether or not allocations starting after the current simulation
time are allowed
:param allow_future_allocations: whether or not allocations starting after
the current simulation time are allowed
:param args: forwarded to filter the resources
......
......@@ -567,7 +567,7 @@ def as_scheduler(*args, on_init=[], on_end=[], base_classes=[], **kwargs):
"""Decorator to convert a function to a scheduler class.
The function should accept the scheduler as first argument and optionally
*args and **kwargs arguments which will be given from additional arguments
`*args` and `**kwargs` arguments which will be given from additional arguments
to the call of the decorator.
:param args: additional arguments passed to the scheduler function (in each iteration)
......
......@@ -156,8 +156,9 @@ def filter_list(
:param data: the list to be filtered.
:param filter: a list of generators through which the entries will be piped. The generators
should iterate through the data (first argument) and should `yield` the searched elements.
:param filter: a list of generators through which the entries will be piped.
The generators should iterate through the data (first argument)
and should `yield` the searched elements.
:param cond: a function evaluating the entries and returns True or False whether or not the entry should be returned.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment