|
1 | 1 | import logging
|
2 |
| -import warnings |
3 | 2 | from operator import itemgetter
|
4 | 3 | from typing import Callable, Optional, Union
|
5 | 4 |
|
|
11 | 10 | from ..utils import NameSet, StringsLike, check_for_duplicates, node_to_dict
|
12 | 11 | from .context import BagContext, ChainContext, Context, NoContext, update_map
|
13 | 12 |
|
14 |
| -__all__ = 'Container', 'EdgesBag' |
| 13 | +__all__ = 'EdgesBag', |
15 | 14 |
|
16 | 15 | logger = logging.getLogger(__name__)
|
17 | 16 |
|
18 | 17 |
|
19 |
| -class Container: |
20 |
| - def __init__(self): |
21 |
| - warnings.warn( |
22 |
| - 'The container interface is deprecated and will be merged with `EdgesBag` soon', |
23 |
| - UserWarning, stacklevel=2 |
24 |
| - ) |
25 |
| - warnings.warn( |
26 |
| - 'The container interface is deprecated and will be merged with `EdgesBag` soon', |
27 |
| - DeprecationWarning, stacklevel=2 |
28 |
| - ) |
29 |
| - |
30 |
| - def wrap(self, container: 'EdgesBag') -> 'EdgesBag': |
31 |
| - raise NotImplementedError |
32 |
| - |
33 |
| - |
34 | 18 | class EdgesBag:
|
35 | 19 | def __init__(self, inputs: Nodes, outputs: Nodes, edges: BoundEdges, context: Optional[Context], *,
|
36 |
| - virtual_nodes: Optional[NameSet] = None, virtual: Optional[NameSet] = None, |
37 |
| - persistent_nodes: Optional[NameSet] = None, persistent: Optional[NameSet] = None, |
38 |
| - optional_nodes: Optional[NodeSet] = None, optional: Optional[NodeSet] = None): |
39 |
| - if virtual_nodes is not None: |
40 |
| - assert virtual is None |
41 |
| - warnings.warn('The "virtual_nodes" argument is deprecated. Use `virtual` instead', stacklevel=2) |
42 |
| - virtual = virtual_nodes |
43 |
| - if optional_nodes is not None: |
44 |
| - assert optional is None |
45 |
| - warnings.warn('The "optional_nodes" argument is deprecated. Use `optional` instead', stacklevel=2) |
46 |
| - optional = optional_nodes |
47 |
| - if persistent_nodes is not None: |
48 |
| - assert persistent is None |
49 |
| - warnings.warn('The "persistent_nodes" argument is deprecated. Use `persistent` instead', stacklevel=2) |
50 |
| - persistent = persistent_nodes |
51 |
| - |
| 20 | + virtual: Optional[NameSet] = None, persistent: Optional[NameSet] = None, |
| 21 | + optional: Optional[NodeSet] = None): |
52 | 22 | if virtual is None:
|
53 | 23 | virtual = set()
|
54 | 24 | if persistent is None:
|
@@ -103,22 +73,6 @@ def loopback(self, func: Callable, inputs: StringsLike, output: StringsLike) ->
|
103 | 73 | virtual=None, persistent=None, optional=state.optional | new_optionals,
|
104 | 74 | )
|
105 | 75 |
|
106 |
| - # TODO: deprecated |
107 |
| - @property |
108 |
| - def persistent_nodes(self): |
109 |
| - warnings.warn('This attribute is deprecated. Use `persistent` instead', stacklevel=2) |
110 |
| - return self.persistent |
111 |
| - |
112 |
| - @property |
113 |
| - def optional_nodes(self): |
114 |
| - warnings.warn('This attribute is deprecated. Use `optional` instead', stacklevel=2) |
115 |
| - return self.optional |
116 |
| - |
117 |
| - @property |
118 |
| - def virtual_nodes(self): |
119 |
| - warnings.warn('This attribute is deprecated. Use `virtual` instead', stacklevel=2) |
120 |
| - return self.virtual |
121 |
| - |
122 | 76 |
|
123 | 77 | def normalize_bag(inputs: Nodes, outputs: Nodes, edges: BoundEdges, virtuals: NameSet, optionals: NodeSet,
|
124 | 78 | persistent_nodes: NameSet, allow_missing_inputs: bool = True):
|
|
0 commit comments