Skip to content

BUG: Member.Beam is used as static method, but not defined as static #107

@ZTThomasOberthanner

Description

@ZTThomasOberthanner

Describe the bug
in member.py the method Member.Beam is defined as an instance method with self as first argument
def Beam(self,

but in test_member.py Member.Beam is used like a static/class method of the Member Class
Member.Beam(0, 1, 1, 2, MemberSectionDistributionType.SECTION_DISTRIBUTION_TYPE_UNIFORM, MemberRotationSpecificationType.COORDINATE_SYSTEM_ROTATION_VIA_ANGLE, [0.2618], 1, 1)
with 0 as an additional parameter for self and not as an instance method

Expected behavior
Member.Beam should be defined as a static method without self as first argument

@staticmethod
def Beam(no: int = 1,

As all the arguments to this method have default values, using kwargs is a great thing to produce readable code like this:

Member.Beam(
            no=1,
            start_node_no=1,
            end_node_no=2,
            start_section_no=1,
        )

this raises an error because self is not defined.

btw:
rotation_parameters = [0], is again an example for a mutable default argument

This is just an example for this design pattern that is used on many locations

Metadata

Metadata

Assignees

Labels

bugExisting feature isn't working properly

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions