Skip to content

Weird behaviour in UserMaterial.get_constants() #34

@rjodon

Description

@rjodon

In the file compas_fea2.backends.abaqus.model.materials line 276, as mentioned in the TODO I have added, I am sure self.constants does not belong inside the constant list and should be excluded.

    def get_constants(self):
        constants = []
        for k in self.__dict__:
            # TODO: I think we should we add constants in the list below?
            if k not in ['__name__', 'name', 'attr_list', 'sub_path', 'p']:
                constants.append(self.__dict__[k])
        return constants

I propose this:

    def get_constants(self):
        constants = []
        for k in self.__dict__:
            if k not in ['constants', '__name__', 'name', 'attr_list', 'sub_path', 'p']:
                constants.append(self.__dict__[k])
        return constants

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions