Skip to content

Commit

Permalink
some fixes for numpy 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mfranz13 committed Oct 21, 2024
1 parent 48b76b2 commit 992dfed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/pandapipes/component_models/component_toolbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def init_results_element(net, element, output, all_float):
"""
res_element = "res_" + element
if all_float:
net[res_element] = pd.DataFrame(np.NAN, columns=output, index=net[element].index,
net[res_element] = pd.DataFrame(np.nan, columns=output, index=net[element].index,
dtype=np.float64)
else:
net[res_element] = pd.DataFrame(np.zeros(0, dtype=output), index=[])
Expand Down
4 changes: 2 additions & 2 deletions src/pandapipes/pf/result_extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,10 @@ def extract_results_active_pit(net, mode="hydraulics"):

amb = get_net_option(net, 'ambient_temperature')

net["_pit"]["node"][~nodes_connected, result_node_col] = np.NaN if mode == "hydraulics" else amb
net["_pit"]["node"][~nodes_connected, result_node_col] = np.nan if mode == "hydraulics" else amb
net["_pit"]["node"][rows_nodes[:, np.newaxis], copied_node_cols[np.newaxis, :]] = \
net["_active_pit"]["node"][:, copied_node_cols]
net["_pit"]["branch"][~branches_connected, result_branch_col] = np.NaN if mode == "hydraulics" else \
net["_pit"]["branch"][~branches_connected, result_branch_col] = np.nan if mode == "hydraulics" else \
net["_pit"]["branch"][~branches_connected, TEXT]
net["_pit"]["branch"][rows_branches[:, np.newaxis], copied_branch_cols[np.newaxis, :]] = \
net["_active_pit"]["branch"][:, copied_branch_cols]
Expand Down

0 comments on commit 992dfed

Please sign in to comment.