Skip to content

Suggestion: use properties for these methods #74

@mpvanderschelling

Description

@mpvanderschelling

Problem

These methods are currently implemented as individual statements, but they could be implemented as the result of a function. This allows them to be documented better. Instead of functions, these would allow the user to access the values as if they were attributes, which is more pythonic.

Proposed solution

change

self.len_start = -1 * self.radius_mu

to

@property
def len_start(self):
    return -1 * self.radius_mu

Assignees:
Labels:

# initial coordinate for position of fibre
self.len_start = -1 * self.radius_mu
self.len_end = self.length + self.radius_mu
self.wid_start = -1 * self.radius_mu
self.wid_end = self.width + self.radius_mu
self.hei_start = -1 * self.radius_mu
self.hei_end = self.height + self.radius_mu

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions