Skip to content

Commit

Permalink
-adapted tests
Browse files Browse the repository at this point in the history
  • Loading branch information
EPrade committed Oct 30, 2023
1 parent 2ac2c4f commit f16fc41
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pandapipes/std_types/library/Pipe.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
std_type;nominal_width_mm;outer_diameter_mm;inner_diameter_mm;standard_dimension_ratio;material;U_W/mK
std_type;nominal_width_mm;outer_diameter_mm;inner_diameter_mm;standard_dimension_ratio;material;u_w/mk
80_GGG;80;98;86;16.33;GGG;
100_GGG;100;118;105.8;19.34;GGG;
125_GGG;125;144;131.6;23.23;GGG;
Expand Down
14 changes: 9 additions & 5 deletions pandapipes/test/api/test_std_types.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics
# and Energy System Technology (IEE), Kassel, and University of Kassel. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.


import numpy as np
import pytest

import pandas as pd
import pandapipes


Expand Down Expand Up @@ -305,15 +304,20 @@ def test_available_std_types():
do = 99.5
di = 87.5
rat = 16.33
u = 0.2
mat = "GGG"

typdata = {"standard_dimension_ratio": rat, "material": mat, "inner_diameter_mm": di,
"outer_diameter_mm": do, "nominal_width_mm": w}
"outer_diameter_mm": do, "nominal_width_mm": w, "u_w/mk": u}

typdatas = {"typ1": typdata, "typ2": typdata}
pandapipes.create_std_types(net, component="pipe", type_dict=typdatas)
av = pandapipes.available_std_types(net, component="pipe")
assert av.to_dict(orient="index") == net.std_types["pipe"]

pipe_df = pd.DataFrame(net.std_types["pipe"]).T
assert av.isnull().equals(pipe_df.isnull())
assert np.all((av==pipe_df) | av.isnull())



if __name__ == "__main__":
Expand Down

0 comments on commit f16fc41

Please sign in to comment.