No flags found
Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.
e.g., #unittest #integration
#production #enterprise
#frontend #backend
Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.
e.g., #unittest #integration
#production #enterprise
#frontend #backend
4 | 4 | ||
5 | 5 | import numpy as np |
|
6 | 6 | ||
7 | + | ||
7 | 8 | def _sum_by_group_sorted(indices, *values): |
|
8 | 9 | """Auxiliary function to sum up values by some given indices (both as numpy arrays). Expects the |
|
9 | 10 | indices and values to already be sorted. |
56 | 57 | ||
57 | 58 | def select_from_pit(table_index_array, input_array, data): |
|
58 | 59 | """ |
|
59 | - | Auxiliary function to retrieve values from a table like a pit. Each data entry corresponds to a |
|
60 | - | table_index_array entry. Example: velocities are indexed by the corresponding from_nodes stored in the |
|
61 | - | pipe pit. |
|
62 | - | ||
63 | - | The function inputs another array which consists of some table_index_array entries the user wants to retrieve. |
|
64 | - | The function is used in pandapipes results evaluation. The input array is the list of from_junction entries, |
|
65 | - | corresponding only to the junction elements, not containing additional pipe nodes. The table_index_array |
|
66 | - | is the complete list of from_nodes consisting of junction element entries and additional pipe section nodes. |
|
67 | - | Data corresponds to the gas velocities. |
|
68 | - | ||
69 | - | :param indices: |
|
70 | - | :type indices: |
|
71 | - | :param values: |
|
72 | - | :type values: |
|
60 | + | Auxiliary function to retrieve values from a table like a pit. Each data entry corresponds |
|
61 | + | to a table_index_array entry. Example: velocities are indexed by the corresponding |
|
62 | + | from_nodes stored in the pipe pit. |
|
63 | + | ||
64 | + | The function inputs another array which consists of some table_index_array entries the user |
|
65 | + | wants to retrieve. The function is used in pandapipes results evaluation. The input array is |
|
66 | + | the list of from_junction entries, corresponding only to the junction elements, not |
|
67 | + | containing additional pipe nodes. The table_index_array is the complete list of from_nodes |
|
68 | + | consisting of junction element entries and additional pipe section nodes. Data corresponds |
|
69 | + | to the gas velocities. |
|
70 | + | ||
71 | + | :param table_index_array: |
|
72 | + | :type table_index_array: |
|
73 | + | :param input_array: |
|
74 | + | :type input_array: |
|
75 | + | :param data: |
|
76 | + | :type data: |
|
73 | 77 | :return: |
|
74 | 78 | :rtype: |
|
75 | 79 | """ |
|
76 | 80 | sorter = np.argsort(table_index_array) |
|
77 | 81 | indices = sorter[np.searchsorted(table_index_array, input_array, sorter=sorter)] |
|
78 | 82 | ||
79 | - | return data[indices] |
185 | 185 | if hasattr(net, "res_junction"): |
|
186 | 186 | net.res_junction.index = get_indices(net.res_junction.index, junction_lookup) |
|
187 | 187 | ||
188 | - | for element, value in element_junction_tuples(): |
|
188 | + | for element, value in element_junction_tuples(net=net): |
|
189 | 189 | if element in net.keys(): |
|
190 | 190 | net[element][value] = get_indices(net[element][value], junction_lookup) |
|
191 | 191 | net["junction_geodata"].set_index(get_indices(net["junction_geodata"].index, junction_lookup), |
400 | 400 | if "res_pipe" in net.keys(): |
|
401 | 401 | res_pipes = net.res_pipe.index.intersection(pipes) |
|
402 | 402 | net["res_pipe"].drop(res_pipes, inplace=True) |
|
403 | - | logger.info("dropped %d pipes" % len(pipes)) |
|
403 | + | logger.info("dropped %d pipes" % len(list(pipes))) |
|
404 | 404 | ||
405 | 405 | ||
406 | 406 | # TODO: change to pumps?? |
Learn more Showing 2 files with coverage changes found.
pandapipes/toolbox.py
pandapipes/internals_toolbox.py
Files | Coverage |
---|---|
pandapipes | -0.11% 90.93% |
Project Totals (71 files) | 90.93% |
#210
5d36f42
3f1754a