Skip to content

Commit

Permalink
removed default dictionary parameter
Browse files Browse the repository at this point in the history
uncommented few working tests
removed few comments
unit tests: 119 passed, 10 skipped in 132.23s
  • Loading branch information
MichalO committed Mar 24, 2022
1 parent cfe07a8 commit 4027c0e
Show file tree
Hide file tree
Showing 85 changed files with 964 additions and 807 deletions.
1 change: 0 additions & 1 deletion Examples/Cantilever/Demo1.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
print('dirname: ', dirName)
sys.path.append(dirName + r'/../..')

# Import der Bibliotheken
from RFEM.enums import NodalSupportType, LoadDirectionType
from RFEM.initModel import Model, Calculate_all
from RFEM.BasicObjects.material import Material
Expand Down
2 changes: 1 addition & 1 deletion Examples/Hall/hall.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
Member(4*n+i, j+2, j+7, 0.0, 2, 2)
Member(4*n+i + n-1, j+4, j+9, 0.0, 2, 2)

# vertical bracing
# vertical bracing
# add a question about repeating in every block, one yes one no, only beginning and end

BracingV = input('Would you like to include vertical bracing? (Y/N)')
Expand Down
12 changes: 6 additions & 6 deletions RFEM/BasicObjects/bracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# start_section_no: int = 1,
# end_section_no: int = 1,
# comment: str = '',
# params: dict = {}):
# params: dict = None):

# '''
# Args:
Expand All @@ -23,7 +23,7 @@
# start_section_no (int): Tag of Start Section
# end_section_no (int): End of End Section
# comment (str, optional): Comment
# params (dict, optional): Parameters
# params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary
# '''

# # Client model | Bracing
Expand Down Expand Up @@ -80,7 +80,7 @@
# start_bracing_hinge_no: int = 0,
# end_bracing_hinge_no: int = 0,
# comment: str = '',
# params: dict = {}):
# params: dict = None):

# '''
# Args:
Expand All @@ -94,7 +94,7 @@
# start_bracing_hinge_no (int): Hinge at Bracing Start
# end_bracing_hinge_no (int): Hinge at Bracing End
# comment (str, optional): Comment
# params (dict, optional): Parameters
# params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary
# '''

# # Client model | Bracing
Expand Down Expand Up @@ -151,7 +151,7 @@
# start_bracing_hinge_no: int = 0,
# end_bracing_hinge_no: int = 0,
# comment: str = '',
# params: dict = {}):
# params: dict = None):

# '''
# Args:
Expand All @@ -165,7 +165,7 @@
# start_bracing_hinge_no (int): Hinge at Bracing Start
# end_bracing_hinge_no (int): Hinge at Bracing End
# comment (str, optional): Comment
# params (dict, optional): Parameters
# params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary
# '''

# # Client model | Bracing
Expand Down
4 changes: 2 additions & 2 deletions RFEM/BasicObjects/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# insertion_point_y: int = 4,
# insertion_point_z: int = 3,
# comment: str = '',
# params: dict = {}):
# params: dict = None):

# '''
# Args:
Expand All @@ -30,7 +30,7 @@
# insertion_point_y (int): Insertion Point y
# insertion_point_z (int): Insertion Point z
# comment (str, optional): Comment
# params (dict, optional): Parameters
# params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary
# '''

# # Client model | Frame
Expand Down
91 changes: 50 additions & 41 deletions RFEM/BasicObjects/line.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ def __init__(self,
no: int = 1,
nodes_no: str = '1 2',
comment: str = '',
params: dict = {}):
params: dict = None):

'''
Args:
no (int): Line Tag
nodes_no (str): Nodes Defining Line
comment (str, optional): Comments
params (dict, optional): Parameters
params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary
'''

# Client model | Line
Expand All @@ -32,8 +32,9 @@ def __init__(self,
clientObject.comment = comment

# Adding optional parameters via dictionary
for key in params:
clientObject[key] = params[key]
if params:
for key in params:
clientObject[key] = params[key]

# Add Line to client model
Model.clientModel.service.set_line(clientObject)
Expand All @@ -43,14 +44,14 @@ def Polyline(
no: int = 1,
nodes_no: str = '1 2',
comment: str = '',
params: dict = {}):
params: dict = None):

'''
Args:
no (int): Line Tag
nodes_no (str): Nodes Defining Polyline
comment (str, optional): Comments
params (dict, optional): Parameters
params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary
'''

# Client model | Line
Expand All @@ -72,29 +73,30 @@ def Polyline(
clientObject.comment = comment

# Adding optional parameters via dictionary
for key in params:
clientObject[key] = params[key]
if params:
for key in params:
clientObject[key] = params[key]

# Add Line to client model
Model.clientModel.service.set_line(clientObject)

@staticmethod
def Arc(
no: int = 1,
nodes_no: str = [1,2],
control_point: list = [10,0,0], # X,Y,Z
no: int,
nodes_no: list,
control_point: list,
alpha_adjustment_target = LineArcAlphaAdjustmentTarget.ALPHA_ADJUSTMENT_TARGET_BEGINNING_OF_ARC,
comment: str = '',
params: dict = {}):
params: dict = None):

'''
Args:
no (int): Line Tag
nodes_no (list): Node Tags Defining Arc
nodes_no (list): Node Tags Defining Arc; [first_node, second_node]
control_point (list): Control Point for Arc in [X, Y, Z]
alpha_adjustment_target (enum): Line Arc Alpha Adjustment Target Enumeration
comment (str, optional): Comments
params (dict, optional): Parameters
params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary
'''

# Client model | Line
Expand Down Expand Up @@ -122,8 +124,9 @@ def Arc(
clientObject.comment = comment

# Adding optional parameters via dictionary
for key in params:
clientObject[key] = params[key]
if params:
for key in params:
clientObject[key] = params[key]

# Add Line to client model
Model.clientModel.service.set_line(clientObject)
Expand All @@ -135,7 +138,7 @@ def Circle(
circle_radius: float = 1.0,
point_of_normal_to_circle_plane: list = [1,0,0],
comment: str = '',
params: dict = {}):
params: dict = None):

'''
Args:
Expand All @@ -145,7 +148,7 @@ def Circle(
circle_radius (float): Magnitude of Circle Radius
point_of_normal_to_circle_plane (list): Vector from Circle Centre to this Point [X, Y, Z] defines Vector Normal to Circle Plane
comment (str, optional): Comments
params (dict, optional): Parameters
params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary
'''

# Client model | Line
Expand Down Expand Up @@ -176,8 +179,9 @@ def Circle(
clientObject.comment = comment

# Adding optional parameters via dictionary
for key in params:
clientObject[key] = params[key]
if params:
for key in params:
clientObject[key] = params[key]

# Add Line to client model
Model.clientModel.service.set_line(clientObject)
Expand All @@ -191,7 +195,7 @@ def EllipticalArc(
arc_angle_alpha: float = 0,
arc_angle_beta: float = 3.141592653589793,
comment: str = '',
params: dict = {}):
params: dict = None):

'''
Args:
Expand All @@ -202,7 +206,7 @@ def EllipticalArc(
arc_angle_alpha (float): Alpha Arc Angle (in Radians)
arc_angle_beta (float): Beta Arc Angle (in Radians)
comment (str, optional): Comments
params (dict, optional): Parameters
params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary
'''

# Client model | Line
Expand Down Expand Up @@ -237,8 +241,9 @@ def EllipticalArc(
clientObject.comment = comment

# Adding optional parameters via dictionary
for key in params:
clientObject[key] = params[key]
if params:
for key in params:
clientObject[key] = params[key]

# Add Line to client model
Model.clientModel.service.set_line(clientObject)
Expand All @@ -249,15 +254,15 @@ def Ellipse(
nodes_no: list = [5,10],
ellipse_control_point: list = [18,-4.8,0],
comment: str = '',
params: dict = {}):
params: dict = None):

'''
Args:
no (int): Line Tag
nodes_no (list): Node Tags on Line of Ellipse
ellipse_control_point (list): Ellipse Control Point [X, Y, Z]
comment (str, optional): Comments
params (dict, optional): Parameters
params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary
'''

# Client model | Line
Expand Down Expand Up @@ -286,8 +291,9 @@ def Ellipse(
clientObject.comment = comment

# Adding optional parameters via dictionary
for key in params:
clientObject[key] = params[key]
if params:
for key in params:
clientObject[key] = params[key]

# Add Line to client model
Model.clientModel.service.set_line(clientObject)
Expand All @@ -299,7 +305,7 @@ def Parabola(
parabola_control_point: list = [10,-3,0],
parabola_alpha: float = 0,
comment: str = '',
params: dict = {}):
params: dict = None):

'''
Args:
Expand All @@ -308,7 +314,7 @@ def Parabola(
parabola_control_point (list): Parabola Control Point [X, Y, Z]
parabola_alpha (float): Alpha Angle (in Radians)
comment (str, optional): Comments
params (dict, optional): Parameters
params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary
'''

# Client model | Line
Expand Down Expand Up @@ -339,8 +345,9 @@ def Parabola(
clientObject.comment = comment

# Adding optional parameters via dictionary
for key in params:
clientObject[key] = params[key]
if params:
for key in params:
clientObject[key] = params[key]

# Add Line to client model
Model.clientModel.service.set_line(clientObject)
Expand All @@ -350,14 +357,14 @@ def Spline(
no: int = 1,
nodes_no: str = '1 3 5',
comment: str = '',
params: dict = {}):
params: dict = None):

'''
Args:
no (int): Line Tag
nodes_no (str): Node Tags on Line of Spline
comment (str, optional): Comments
params (dict, optional): Parameters
params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary
'''

# Client model | Line
Expand All @@ -379,8 +386,9 @@ def Spline(
clientObject.comment = comment

# Adding optional parameters via dictionary
for key in params:
clientObject[key] = params[key]
if params:
for key in params:
clientObject[key] = params[key]

# Add Line to client model
Model.clientModel.service.set_line(clientObject)
Expand All @@ -392,7 +400,7 @@ def NURBS(
control_points: list = [[0,0,0],[2.33,0,-3,4],[10,0,-11],[17.66,0,-3.4],[20,0,0]],
weights = [1,1,1,1,1],
comment: str = '',
params: dict = {}):
params: dict = None):

'''
Args:
Expand All @@ -401,7 +409,7 @@ def NURBS(
control_points (list): Nested List of Respective Control Point's Cartesian Co-Ordinates
weights (list): Weights of Control Points
comment (str, optional): Comments
params (dict, optional): Parameters
params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary
'''

# Client model | Line
Expand Down Expand Up @@ -433,14 +441,15 @@ def NURBS(
point.global_coordinate_z = control_points[i][2]
point.weight = weights[i]
nurbs_control_points.append(point)
#clientObject.nurbs_control_points_by_components = Model.clientModel.factory.create('ns0:line_nurbs_control_points_by_components')
clientObject.nurbs_control_points_by_components = Model.clientModel.factory.create('ns0:line_nurbs_control_points_by_components')
'''
# Comment
clientObject.comment = comment

# Adding optional parameters via dictionary
for key in params:
clientObject[key] = params[key]
if params:
for key in params:
clientObject[key] = params[key]

# Add Line to client model
Model.clientModel.service.set_line(clientObject)
Loading

0 comments on commit 4027c0e

Please sign in to comment.