-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changed beam to generic element #263
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I generally like this change. commented on some issues
src/compas_timber/model/model.py
Outdated
An instance of a Joint class. | ||
|
||
beams : tuple(:class:`~compas_timber.elements.Beam`) | ||
The two beams that should be joined. | ||
beams : tuple(:class:`~compas_timber.elements.Element`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
beams -> elements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a change that would probably have larger consequences. I would do that in another PR :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was referring to the name of the argument. you changes the type to Element
(btw Element
is a compas_model
thing) but argument is still called beams
. But maybe it should only be called using Beam
in which case I'd just revert the change to the type.
src/compas_timber/model/model.py
Outdated
|
||
def remove_joint(self, joint): | ||
def remove_interaction(self, joint): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should still be called remove_joint
as it is not quite the same as the parent implementation, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. I was thinking about this in terms of Joint
being a specific type of the generic type Interaction
. However, without any other types of interaction we could leave it as remove_joint
What about add_interaction
? should I change that to match the input parameters of the compas_model
method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep in mind that since TimberModel
inherits from Model
, the Model
interface is fully available on TimberModel
objects. We could totally have remove_joint
/add_joint
live alongside remove_interaction
/add_interaction
.
Any specific operation to interactions of type Joint
can be handled in add_joint
whereas other kinds of interactions that are not timber model specific can still be added using add_interaction
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
CHANGELOG.md
Outdated
* Changed `TimberModel.beams` to return generator of `Beam` elements. | ||
* Changed `TimberModel.walls` to return generator of `Wall` elements. | ||
* Changed `TimberModel.plates` to return generator of `Plate` elements. | ||
* Changed `TimberModel.joints` to return generator of `Plate` elements. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
repeated line
This is to make the process of adding elements to a Model simpler by eliminating the need for multiple functions e.g.
add_beam
andadd_plate
. I left the TimberModel.plates attribute commented out, but if the Plates element PR gets accepted, then I can uncomment those lines. I tested this withinvoke test
and with GH. It may still break some things...What type of change is this?
Checklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.CHANGELOG.md
file in theUnreleased
section under the most fitting heading (e.g.Added
,Changed
,Removed
).invoke test
).invoke lint
).compas_timber.datastructures.Beam
.