Skip to content

Commit e278926

Browse files
committed
REFACT: Unify Op+Netop modules
1 parent 883c427 commit e278926

File tree

12 files changed

+418
-437
lines changed

12 files changed

+418
-437
lines changed

CHANGES.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ v8.0.0 (7 May 2020, @ankostis): re-MODULE; sideffect --> sfx; all DIACRITIC Modi
9292

9393
+ :mod:`.network` module was splitted into :mod:`.execution` which now
9494
contains plan+solution;
95-
+ renamed module ``netop`` --> :mod:`.pipeline`.
95+
+ renamed module ``netop`` --> ``.pipeline``.
9696
+ DOC: module dependencies diagram in :doc:`reference`.
9797

9898
+ BREAK: sideffect modifier functions *shortened* to :func:`.sfx` & :func:`.sfxed`.
@@ -579,7 +579,7 @@ Details
579579
or else they will fail.
580580

581581
+ FEAT(OP, netop): specify :term:`endurance`/`reschedule` on a per operation basis,
582-
or collectively for all operations grouped under some :term:`netop`.
582+
or collectively for all operations grouped under some :term:`pipeline`.
583583

584584
+ REFACT(NETOP):
585585

@@ -630,7 +630,7 @@ v4.3.0 (16 Dec 2019, @ankostis): Aliases
630630
v4.2.0 (16 Dec 2019, @ankostis): ENDURED Execution
631631
==================================================
632632
+ FEAT(NET): when :func:`.set_endure_operations` configuration is set to true,
633-
a :term:`netop` will keep on calculating solution, skipping any operations
633+
a :term:`pipeline` will keep on calculating solution, skipping any operations
634634
downstream from failed ones. The :term:`solution` eventually collects all failures
635635
in ``Solution.failures`` attribute.
636636

docs/source/arch.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Architecture
3737
.. autosummary::
3838

3939
graphtik.op.FunctionalOperation
40-
graphtik.pipeline.NetworkOperation
40+
graphtik.op.NetworkOperation
4141
graphtik.network.Network
4242
graphtik.execution.ExecutionPlan
4343
graphtik.execution.Solution

docs/source/plotting.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ The same :meth:`.Plottable.plot()` method applies also for:
4040

4141
each one capable to producing diagrams with increasing complexity.
4242
Whenever possible, the top-level ``plot()`` methods will delegate to the ones below;
43-
specifically, the :term:`netop` keeps a transient reference to the last `plan`.
43+
specifically, the :term:`pipeline` keeps a transient reference to the last `plan`.
4444
BUT the `plan` does not hold such a reference, you have to plot the `solution`.
4545

4646
For instance, when a net-operation has just been composed, plotting it will
@@ -307,7 +307,7 @@ Directives
307307
.. rst:directive:option:: alt
308308
:type: `str`
309309
310-
If not given, derived from string representation of the :term:`netop`.
310+
If not given, derived from string representation of the :term:`pipeline`.
311311
312312
.. rst:directive:: graphtik-output
313313

docs/source/reference.rst

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ API Reference
77
graphtik
88
graphtik.op
99
graphtik.modifiers
10-
graphtik.pipeline
1110
graphtik.network
1211
graphtik.execution
1312
graphtik.plot
@@ -34,13 +33,6 @@ Module: `modifiers`
3433
:members:
3534
:private-members:
3635

37-
Module: `pipeline`
38-
====================
39-
40-
.. automodule:: graphtik.pipeline
41-
:members:
42-
:undoc-members:
43-
4436
Module: `network`
4537
=================
4638

graphtik/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@
4848
vararg,
4949
varargs,
5050
)
51-
from .pipeline import compose
52-
from .op import NULL_OP, operation
51+
from .op import NULL_OP, operation, compose
5352

5453
## SEE ALSO: `.plot.active_plotter_plugged()`, `.plot.set_active_plotter()` &
5554
# `.plot.get_active_plotter()` configs, not imported, unless plot is needed..

graphtik/config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ def _tristate_armed(context_var: ContextVar, enabled):
7979
8080
:param enabled:
8181
- ``None, False, string(0, false, off, no)``: Disabled
82+
- ``1``: Enable ALL ``DEBUG_XXX``
83+
- integers: Enable respective ``DEBUG_XXX`` bit-field constants
8284
- anything else: Enable ALL ``DEBUG_XXX``
8385
8486
Affected behavior:
@@ -260,6 +262,6 @@ def get_execution_pool() -> "Optional[Pool]":
260262
."""
261263

262264

263-
def first_solid(*tristates, default=False):
265+
def first_solid(*tristates, default=None):
264266
"""Utility combining multiple tri-state booleans."""
265267
return first(tristates, default=default, key=lambda i: i is not None)

graphtik/network.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -639,8 +639,7 @@ def build_network(
639639
see same-named param in :func:`.compose`
640640
"""
641641
from boltons.setutils import IndexedSet as iset
642-
from .op import NULL_OP
643-
from .pipeline import NetworkOperation
642+
from .op import NULL_OP, NetworkOperation
644643

645644
def proc_op(op, parent=None):
646645
"""clone FuncOperation with certain props changed"""

0 commit comments

Comments
 (0)