Skip to content

Commit

Permalink
Fix doc build
Browse files Browse the repository at this point in the history
Most notably, taskflow is hitting the sphinx issue
sphinx-doc/sphinx#2549 which causes a
spurious warning that breaks the build with -W.  There is a
workaround posted in
https://stackoverflow.com/questions/31784830/sphinx-ivar-tag-goes-looking-for-cross-references
to move :ivar: docstrings to inline comments on the member variable
itself.  This is not ideal because it causes the docs to render
differently from :ivar:, but until the sphinx bug is fixed it will
allow us to keep documenting the problematic variables.

There was also a problem with one of the doctests because the
output had changed.  That is now fixed.

I also noticed a typo in one of the parameter descriptions so that
is fixed too.

Change-Id: Ib44621f6c3ba2c5476ec430218a0449f9f45d18f
  • Loading branch information
cybertron committed May 9, 2018
1 parent 8fb318e commit e93f40c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
6 changes: 3 additions & 3 deletions doc/source/user/inputs_and_outputs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ prior to running:
>>> engines.run(flo)
Traceback (most recent call last):
...
taskflow.exceptions.MissingDependencies:
taskflow.patterns.linear_flow.Flow: cat-dog;
2 requires ['meow', 'woof'] but no other entity produces said requirements
taskflow.exceptions.MissingDependencies: 'linear_flow.Flow: cat-dog(len=2)' requires ['meow', 'woof'] but no other entity produces said requirements
MissingDependencies: 'execute' method on '__main__.DogTalk==1.0' requires ['woof'] but no other entity produces said requirements
MissingDependencies: 'execute' method on '__main__.CatTalk==1.0' requires ['meow'] but no other entity produces said requirements

The recommended way to provide flow inputs is to use the ``store`` parameter
of the engine helpers (:py:func:`~taskflow.engines.helpers.run` or
Expand Down
8 changes: 5 additions & 3 deletions taskflow/atom.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class Atom(object):
:param requires: A set or list of required inputs for this atom's
``execute`` method.
:param revert_requires: A set or list of required inputs for this atom's
``revert`` method. If unpassed, ```requires`` will
``revert`` method. If unpassed, ``requires`` will
be used.
:ivar version: An *immutable* version that associates version information
with this atom. It can be useful in resuming older versions
Expand All @@ -212,8 +212,6 @@ class Atom(object):
a different ``revert_rebind`` value was received.
:ivar inject: See parameter ``inject``.
:ivar Atom.name: See parameter ``name``.
:ivar requires: A :py:class:`~taskflow.types.sets.OrderedSet` of inputs
this atom requires to function.
:ivar optional: A :py:class:`~taskflow.types.sets.OrderedSet` of inputs
that are optional for this atom to ``execute``.
:ivar revert_optional: The ``revert`` version of ``optional``.
Expand Down Expand Up @@ -284,6 +282,10 @@ def __init__(self, name=None, provides=None, requires=None,
(self.revert_rebind, addl_requires,
self.revert_optional) = revert_mapping

# TODO(bnemec): This should be documented as an ivar, but can't be due
# to https://github.com/sphinx-doc/sphinx/issues/2549
#: A :py:class:`~taskflow.types.sets.OrderedSet` of inputs this atom
#: requires to function.
self.requires = exec_requires.union(addl_requires)

def _build_arg_mapping(self, executor, requires=None, rebind=None,
Expand Down
8 changes: 6 additions & 2 deletions taskflow/persistence/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,13 +301,15 @@ class FlowDetail(object):
guaranteed to be persisted when a save (or update) occurs via some backend
connection.
:ivar state: The state of the flow associated with this flow detail.
:ivar meta: A dictionary of meta-data associated with this flow detail.
"""
def __init__(self, name, uuid):
self._uuid = uuid
self._name = name
self._atomdetails_by_id = {}
# TODO(bnemec): This should be documented as an ivar, but can't be due
# to https://github.com/sphinx-doc/sphinx/issues/2549
#: The state of the flow associated with this flow detail.
self.state = None
self.meta = {}

Expand Down Expand Up @@ -486,7 +488,6 @@ class AtomDetail(object):
guaranteed to be persisted when a save (or update) occurs via some backend
connection.
:ivar state: The state of the atom associated with this atom detail.
:ivar intention: The execution strategy of the atom associated
with this atom detail (used by an engine/others to
determine if the associated atom needs to be
Expand Down Expand Up @@ -515,6 +516,9 @@ class AtomDetail(object):
def __init__(self, name, uuid):
self._uuid = uuid
self._name = name
# TODO(bnemec): This should be documented as an ivar, but can't be due
# to https://github.com/sphinx-doc/sphinx/issues/2549
#: The state of the atom associated with this atom detail.
self.state = None
self.intention = states.EXECUTE
self.results = None
Expand Down

0 comments on commit e93f40c

Please sign in to comment.