Skip to content

Commit b31ff16

Browse files
committed
WIP: +Solution class to fix multithreading x3TCs FAIL!
1 parent 72bd9e4 commit b31ff16

File tree

8 files changed

+186
-149
lines changed

8 files changed

+186
-149
lines changed

docs/source/index.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ It might be of use in computer vision, machine learning and other data science d
2525
or become the core of a custom ETL pipelne.
2626

2727
.. toctree::
28-
:maxdepth: 2
28+
:maxdepth: 3
29+
:numbered:
2930

3031
operations
3132
composition

docs/source/operations.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,5 +137,11 @@ Modifiers on ``operation`` inputs and outputs
137137

138138
Certain modifiers are available to apply to input or output values in ``needs`` and ``provides``, for example to designate an optional input. These modifiers are available in the ``graphkit.modifiers`` module:
139139

140+
141+
Optionals
142+
^^^^^^^^^
140143
.. autoclass:: graphkit.modifiers.optional
144+
145+
Sideffects
146+
^^^^^^^^^^
141147
.. autoclass:: graphkit.modifiers.sideffect

docs/source/reference.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
API Reference
33
=============
44

5+
Package: `graphkit`
6+
===================
7+
8+
.. automodule:: graphkit
9+
510
Module: `base`
611
==============
712

graphkit/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414

1515
# For backwards compatibility
1616
from .base import Operation
17-
from .network import Network
17+
from .network import Network, Solution

graphkit/base.py

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,6 @@ def __init__(self, **kwargs):
291291

292292
# set execution mode to single-threaded sequential by default
293293
self._execution_method = "sequential"
294-
self._overwrites_collector = None
295294

296295
def _build_pydot(self, **kws):
297296
"""delegate to network"""
@@ -300,12 +299,7 @@ def _build_pydot(self, **kws):
300299
return plotter._build_pydot(**kws)
301300

302301
def _compute(self, named_inputs, outputs=None):
303-
return self.net.compute(
304-
named_inputs,
305-
outputs,
306-
method=self._execution_method,
307-
overwrites_collector=self._overwrites_collector,
308-
)
302+
return self.net.compute(named_inputs, outputs, method=self._execution_method)
309303

310304
def __call__(self, *args, **kwargs):
311305
return self._compute(*args, **kwargs)
@@ -328,24 +322,6 @@ def set_execution_method(self, method):
328322
)
329323
self._execution_method = method
330324

331-
def set_overwrites_collector(self, collector):
332-
"""
333-
Asks to put all *overwrites* into the `collector` after computing
334-
335-
An "overwrites" is intermediate value calculated but NOT stored
336-
into the results, becaues it has been given also as an intemediate
337-
input value, and the operation that would overwrite it MUST run for
338-
its other results.
339-
340-
:param collector:
341-
a mutable dict to be fillwed with named values
342-
"""
343-
if collector is not None and not isinstance(collector, abc.MutableMapping):
344-
raise ValueError(
345-
"Overwrites collector was not a MutableMapping, but: %r" % collector
346-
)
347-
self._overwrites_collector = collector
348-
349325
def __getstate__(self):
350326
state = Operation.__getstate__(self)
351327
state["net"] = self.__dict__["net"]

0 commit comments

Comments
 (0)