|
16 | 16 | pair = _generic_attribute( |
17 | 17 | attr_prefix="pair", |
18 | 18 | arg_names=("vertex_type", "vertex_type"), |
19 | | - options={(i, j) |
20 | | - for i in _simple_vertex_types for j in _simple_vertex_types}, |
| 19 | + options={(i, i) for i in _simple_vertex_types}, |
21 | 20 | function_module=_reticula_ext, |
22 | 21 | api_module_name=__name__) |
23 | 22 |
|
| 23 | +_pair_vertex_types = set([ |
| 24 | + getattr(_reticula_ext, f"pair_{i.__name__}_{i.__name__}") |
| 25 | + for i in _simple_vertex_types]) |
| 26 | + |
24 | 27 | _static_edge_prefixes = [ |
25 | 28 | "directed_edge", "undirected_edge", |
26 | 29 | "directed_hyperedge", "undirected_hyperedge"] |
|
92 | 95 |
|
93 | 96 | _time_types = set(_reticula_ext.types.time_types) |
94 | 97 |
|
| 98 | +_temporal_edge_verts = _simple_vertex_types | _pair_vertex_types |
95 | 99 | for _e in _temporal_edge_prefixes: |
96 | 100 | setattr(_sys.modules[__name__], |
97 | 101 | _e, _generic_attribute( |
98 | 102 | attr_prefix=_e, |
99 | 103 | arg_names=("vertex_type", "time_type"), |
100 | 104 | options={(v, t) |
101 | | - for v in _all_vertex_types for t in _time_types}, |
| 105 | + for v in _temporal_edge_verts for t in _time_types}, |
102 | 106 | function_module=_reticula_ext, |
103 | 107 | api_module_name=__name__)) |
104 | 108 | _n = _e[:-4] + "network" |
|
107 | 111 | attr_prefix=_n, |
108 | 112 | arg_names=("vertex_type", "time_type"), |
109 | 113 | options={(v, t) |
110 | | - for v in _all_vertex_types for t in _time_types}, |
| 114 | + for v in _temporal_edge_verts for t in _time_types}, |
111 | 115 | function_module=_reticula_ext, |
112 | 116 | api_module_name=__name__)) |
113 | 117 |
|
|
202 | 206 | arg_names=("integer_vertex_type",), |
203 | 207 | options={(t,) for t in _integer_vertex_types}, |
204 | 208 | function_module=_reticula_ext, |
205 | | - api_module_name=__name__)) |
| 209 | + api_module_name=__name__, |
| 210 | + default_callable=getattr(_reticula_ext, _a+"_int64"))) |
206 | 211 |
|
207 | 212 | _integer_vertex_generic_generators = [ |
208 | 213 | "square_grid_graph", "path_graph", "cycle_graph", |
|
215 | 220 | arg_names=("integer_vertex_type",), |
216 | 221 | options={(t,) for t in _integer_vertex_types}, |
217 | 222 | function_module=_reticula_ext, |
218 | | - api_module_name=__name__)) |
| 223 | + api_module_name=__name__, |
| 224 | + default_callable=getattr(_reticula_ext, _a+"_int64"))) |
219 | 225 |
|
220 | 226 | from ._reticula_ext import ( |
221 | 227 | random_link_activation_temporal_network, |
|
0 commit comments