Commit 152063c
authored
Avoid Deepcopy on Tree and ParticleTree (#47)
* Implement a constructor of Tree with all the atributes(tree_structure, idx_leaf_nodes and output);
Create the class method new_tree with the previous behaviour of the constructor;
Change the implementation of copy on Tree, avoiding deepcopying all and just deepcopying the output;
Improve method trim(), previously we copy all and then we delete the atributes that we do not need, now we just create the tree copying the atributes that we care;
Insted of creating an empty list and append each particle we create an comprehensive list;
We implement the method copy on ParticleTree, instead of deepcopying;
* Changes Code Review;1 parent cd5191f commit 152063c
2 files changed
+42
-29
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
| |||
107 | 106 | | |
108 | 107 | | |
109 | 108 | | |
110 | | - | |
| 109 | + | |
111 | 110 | | |
112 | 111 | | |
113 | 112 | | |
| |||
136 | 135 | | |
137 | 136 | | |
138 | 137 | | |
139 | | - | |
140 | | - | |
141 | | - | |
| 138 | + | |
142 | 139 | | |
143 | 140 | | |
144 | 141 | | |
| |||
239 | 236 | | |
240 | 237 | | |
241 | 238 | | |
242 | | - | |
| 239 | + | |
243 | 240 | | |
244 | 241 | | |
245 | 242 | | |
| |||
274 | 271 | | |
275 | 272 | | |
276 | 273 | | |
277 | | - | |
| 274 | + | |
278 | 275 | | |
279 | 276 | | |
280 | 277 | | |
| |||
328 | 325 | | |
329 | 326 | | |
330 | 327 | | |
331 | | - | |
| 328 | + | |
332 | 329 | | |
333 | 330 | | |
334 | 331 | | |
335 | 332 | | |
336 | 333 | | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
337 | 344 | | |
338 | 345 | | |
339 | 346 | | |
| |||
500 | 507 | | |
501 | 508 | | |
502 | 509 | | |
503 | | - | |
504 | 510 | | |
505 | 511 | | |
506 | 512 | | |
| |||
509 | 515 | | |
510 | 516 | | |
511 | 517 | | |
512 | | - | |
513 | 518 | | |
514 | 519 | | |
515 | 520 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
| |||
42 | 41 | | |
43 | 42 | | |
44 | 43 | | |
45 | | - | |
46 | | - | |
47 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
48 | 47 | | |
49 | 48 | | |
50 | 49 | | |
| |||
53 | 52 | | |
54 | 53 | | |
55 | 54 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
62 | 69 | | |
63 | 70 | | |
64 | 71 | | |
| |||
67 | 74 | | |
68 | 75 | | |
69 | 76 | | |
70 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
71 | 82 | | |
72 | 83 | | |
73 | 84 | | |
| |||
82 | 93 | | |
83 | 94 | | |
84 | 95 | | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
93 | 101 | | |
94 | 102 | | |
95 | 103 | | |
| |||
0 commit comments