Skip to content

Commit 5261422

Browse files
committed
REFACT: don't import All CONFIGS; mv NO_RESULT
1 parent b33788c commit 5261422

File tree

5 files changed

+21
-43
lines changed

5 files changed

+21
-43
lines changed

graphtik/__init__.py

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,8 @@
1111
__author__ = "hnguyen, ankostis"
1212

1313

14-
from .base import NO_RESULT, AbortedException, IncompleteExecutionError
15-
from .config import (
16-
abort_run,
17-
debug_enabled,
18-
evictions_skipped,
19-
execution_pool_plugged,
20-
get_execution_pool,
21-
is_abort,
22-
is_debug,
23-
is_endure_operations,
24-
is_marshal_tasks,
25-
is_parallel_tasks,
26-
is_reschedule_operations,
27-
is_skip_evictions,
28-
operations_endured,
29-
operations_reschedullled,
30-
reset_abort,
31-
set_debug,
32-
set_endure_operations,
33-
set_execution_pool,
34-
set_marshal_tasks,
35-
set_parallel_tasks,
36-
set_reschedule_operations,
37-
set_skip_evictions,
38-
tasks_in_parallel,
39-
tasks_marshalled,
40-
)
14+
from .base import AbortedException, IncompleteExecutionError
15+
from .composition import NO_RESULT, NULL_OP, compose, operation
4116
from .modifiers import (
4217
mapped,
4318
optional,
@@ -48,7 +23,6 @@
4823
vararg,
4924
varargs,
5025
)
51-
from .composition import NULL_OP, operation, compose
5226

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

graphtik/base.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,6 @@ def __repr__(self):
9696
return self.__str__()
9797

9898

99-
#: When an operation function returns this special value,
100-
#: it implies operation has no result at all,
101-
#: (otherwise, it would have been a single result, ``None``).
102-
#: Usefull for :term:`partial outputs` who want to cancel their single result
103-
#: witout being delcared as :term:`returns dictionary`.
104-
NO_RESULT = Token("NO_RESULT")
10599
UNSET = Token("UNSET")
106100

107101

graphtik/composition.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
from boltons.setutils import IndexedSet as iset
2020

2121
from .base import (
22-
NO_RESULT,
2322
UNSET,
2423
Items,
2524
MultiValueError,
2625
PlotArgs,
2726
Plottable,
27+
Token,
2828
aslist,
2929
astuple,
3030
func_name,
@@ -54,6 +54,13 @@
5454

5555
log = logging.getLogger(__name__)
5656

57+
#: When an operation function returns this special value,
58+
#: it implies operation has no result at all,
59+
#: (otherwise, it would have been a single result, ``None``).
60+
#: Usefull for :term:`partial outputs` who want to cancel their single result
61+
#: witout being delcared as :term:`returns dictionary`.
62+
NO_RESULT = Token("NO_RESULT")
63+
5764

5865
def as_renames(i, argname):
5966
"""

graphtik/modifiers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ def sfxed(
544544
To view all internal :term:`dependencies <dependency>`, enable DEBUG
545545
in :term:`configurations`:
546546
547-
>>> from graphtik import debug_enabled
547+
>>> from graphtik.config import debug_enabled
548548
549549
>>> with debug_enabled(True):
550550
... finalize_prices

test/test_graphtik.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,29 @@
2020

2121
import pytest
2222

23-
from graphtik import (
23+
from graphtik import network
24+
from graphtik.base import AbortedException, IncompleteExecutionError
25+
from graphtik.composition import (
2426
NO_RESULT,
2527
NULL_OP,
26-
AbortedException,
27-
IncompleteExecutionError,
28-
abort_run,
28+
NetworkOperation,
29+
Operation,
2930
compose,
31+
operation,
32+
)
33+
from graphtik.config import (
34+
abort_run,
35+
debug_enabled,
3036
evictions_skipped,
3137
execution_pool_plugged,
3238
get_execution_pool,
3339
is_marshal_tasks,
34-
network,
35-
operation,
3640
operations_endured,
3741
operations_reschedullled,
3842
tasks_marshalled,
3943
)
4044
from graphtik.execution import Solution
4145
from graphtik.modifiers import optional, sfx, sfxed, vararg
42-
from graphtik.composition import NetworkOperation, Operation
4346

4447
log = logging.getLogger(__name__)
4548

0 commit comments

Comments
 (0)