dependencies.py
extract_master(part_table)
¶
given a part table name, return master part. None if not a part table
Source code in datajoint/dependencies.py
8 9 10 11 12 13 |
|
topo_sort(graph)
¶
topological sort of a dependency graph that keeps part tables together with their masters
Returns:
Type | Description |
---|---|
list of table names in topological order |
Source code in datajoint/dependencies.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
|
Dependencies
¶
Bases: DiGraph
The graph of dependencies (foreign keys) between loaded tables.
Note: the 'connection' argument should normally be supplied; Empty use is permitted to facilitate use of networkx algorithms which internally create objects with the expectation of empty constructors. See also: https://github.com/datajoint/datajoint-python/pull/443
Source code in datajoint/dependencies.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 |
|
load(force=True)
¶
Load dependencies for all loaded schemas. This method gets called before any operation that requires dependencies: delete, drop, populate, progress.
Source code in datajoint/dependencies.py
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
|
topo_sort()
¶
Returns:
Type | Description |
---|---|
list of tables names in topological order |
Source code in datajoint/dependencies.py
170 171 172 |
|
parents(table_name, primary=None)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table_name |
|
required | |
primary |
if None, then all parents are returned. If True, then only foreign keys composed of primary key attributes are considered. If False, the only foreign keys including at least one non-primary attribute are considered. |
None
|
Returns:
Type | Description |
---|---|
dict of tables referenced by the foreign keys of table |
Source code in datajoint/dependencies.py
174 175 176 177 178 179 180 181 182 183 184 185 186 187 |
|
children(table_name, primary=None)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table_name |
|
required | |
primary |
if None, then all children are returned. If True, then only foreign keys composed of primary key attributes are considered. If False, the only foreign keys including at least one non-primary attribute are considered. |
None
|
Returns:
Type | Description |
---|---|
dict of tables referencing the table through foreign keys |
Source code in datajoint/dependencies.py
189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
|
descendants(full_table_name)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
full_table_name |
In form |
required |
Returns:
Type | Description |
---|---|
all dependent tables sorted in topological order. Self is included. |
Source code in datajoint/dependencies.py
204 205 206 207 208 209 210 211 |
|
ancestors(full_table_name)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
full_table_name |
In form |
required |
Returns:
Type | Description |
---|---|
all dependent tables sorted in topological order. Self is included. |
Source code in datajoint/dependencies.py
213 214 215 216 217 218 219 220 |
|