Skip to content

Commit

Permalink
Minor Docs Edit (#2445)
Browse files Browse the repository at this point in the history
* Backtick typo fix in auto_namespace method

* Added a few more backticks and edits
  • Loading branch information
chadlagore authored and dlstadther committed Jun 18, 2018
1 parent 1a4802d commit 5c9395a
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 25 deletions.
2 changes: 1 addition & 1 deletion luigi/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def auto_namespace(scope=''):
luigi.auto_namespace(scope=__name__)
To reset an ``auto_namespace()`` call, you can use
``namespace(scope='my_scope'``). But this will not be
``namespace(scope='my_scope')``. But this will not be
needed (and is also discouraged) if you use the ``scope`` kwarg.
*New since Luigi 2.6.0.*
Expand Down
4 changes: 2 additions & 2 deletions luigi/tools/luigi_grep.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ def _build_results(self, jobs, job):
return {"name": job, "status": job_info['status'], "deps_by_status": deps_status}

def prefix_search(self, job_name_prefix):
"""searches for jobs matching the given job_name_prefix."""
"""Searches for jobs matching the given ``job_name_prefix``."""
json = self._fetch_json()
jobs = json['response']
for job in jobs:
if job.startswith(job_name_prefix):
yield self._build_results(jobs, job)

def status_search(self, status):
"""searches for jobs matching the given status"""
"""Searches for jobs matching the given ``status``."""
json = self._fetch_json()
jobs = json['response']
for job in jobs:
Expand Down
46 changes: 24 additions & 22 deletions luigi/tools/range.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
"""
Produces contiguous completed ranges of recurring tasks.
See RangeDaily and RangeHourly for basic usage.
See ``RangeDaily`` and ``RangeHourly`` for basic usage.
Caveat - if gaps accumulate, their causes (e.g. missing dependencies) going
unmonitored/unmitigated, then this will eventually keep retrying the same gaps
over and over and make no progress to more recent times. (See 'task_limit' and
'reverse' parameters.)
over and over and make no progress to more recent times. (See ``task_limit``
and ``reverse`` parameters.)
TODO foolproof against that kind of misuse?
"""

Expand All @@ -48,16 +48,16 @@ class RangeEvent(luigi.Event): # Not sure if subclassing currently serves a pur
"""
Events communicating useful metrics.
COMPLETE_COUNT would normally be nondecreasing, and its derivative would
describe performance (how many instances complete
``COMPLETE_COUNT`` would normally be nondecreasing, and its derivative
would describe performance (how many instances complete
invocation-over-invocation).
COMPLETE_FRACTION reaching 1 would be a telling event in case of a backfill
with defined start and stop. Would not be strikingly useful for a typical
recurring task without stop defined, fluctuating close to 1.
``COMPLETE_FRACTION`` reaching 1 would be a telling event in case of a
backfill with defined start and stop. Would not be strikingly useful for a
typical recurring task without stop defined, fluctuating close to 1.
DELAY is measured from the first found missing datehour till (current time
+ hours_forward), or till stop if it is defined. In hours for Hourly.
``DELAY`` is measured from the first found missing datehour till (current
time + hours_forward), or till stop if it is defined. In hours for Hourly.
TBD different units for other frequencies?
TODO any different for reverse mode? From first missing till last missing?
From last gap till stop?
Expand All @@ -72,17 +72,18 @@ class RangeBase(luigi.WrapperTask):
Produces a contiguous completed range of a recurring task.
Made for the common use case where a task is parameterized by e.g.
DateParameter, and assurance is needed that any gaps arising from downtime
are eventually filled.
``DateParameter``, and assurance is needed that any gaps arising from
downtime are eventually filled.
Emits events that one can use to monitor gaps and delays.
At least one of start and stop needs to be specified.
(This is quite an abstract base class for subclasses with different
datetime parameter class, e.g. DateParameter, DateHourParameter, ..., and
different parameter naming, e.g. days_back/forward, hours_back/forward,
..., as well as different documentation wording, for good user experience.)
datetime parameter classes, e.g. ``DateParameter``, ``DateHourParameter``,
..., and different parameter naming, e.g. days_back/forward,
hours_back/forward, ..., as well as different documentation wording,
to improve user experience.)
Subclasses will need to use the ``of`` parameter when overriding methods.
"""
Expand Down Expand Up @@ -621,8 +622,9 @@ def infer_bulk_complete_from_fs(datetimes, datetime_to_task, datetime_to_re):
Efficiently determines missing datetimes by filesystem listing.
The current implementation works for the common case of a task writing
output to a FileSystemTarget whose path is built using strftime with format
like '...%Y...%m...%d...%H...', without custom complete() or exists().
output to a ``FileSystemTarget`` whose path is built using strftime with
format like '...%Y...%m...%d...%H...', without custom ``complete()`` or
``exists()``.
(Eventually Luigi could have ranges of completion as first-class citizens.
Then this listing business could be factored away/be provided for
Expand All @@ -645,7 +647,7 @@ def infer_bulk_complete_from_fs(datetimes, datetime_to_task, datetime_to_re):

class RangeDaily(RangeDailyBase):
"""Efficiently produces a contiguous completed range of a daily recurring
task that takes a single DateParameter.
task that takes a single ``DateParameter``.
Falls back to infer it from output filesystem listing to facilitate the
common case usage.
Expand All @@ -671,9 +673,9 @@ def missing_datetimes(self, finite_datetimes):

class RangeHourly(RangeHourlyBase):
"""Efficiently produces a contiguous completed range of an hourly recurring
task that takes a single DateHourParameter.
task that takes a single ``DateHourParameter``.
Benefits from bulk_complete information to efficiently cover gaps.
Benefits from ``bulk_complete`` information to efficiently cover gaps.
Falls back to infer it from output filesystem listing to facilitate the
common case usage.
Expand All @@ -700,9 +702,9 @@ def missing_datetimes(self, finite_datetimes):

class RangeByMinutes(RangeByMinutesBase):
"""Efficiently produces a contiguous completed range of an recurring
task every interval minutes that takes a single DateMinuteParameter.
task every interval minutes that takes a single ``DateMinuteParameter``.
Benefits from bulk_complete information to efficiently cover gaps.
Benefits from ``bulk_complete`` information to efficiently cover gaps.
Falls back to infer it from output filesystem listing to facilitate the
common case usage.
Expand Down

0 comments on commit 5c9395a

Please sign in to comment.