Skip to content

Conversation

@tomvanmele
Copy link
Member

What type of change is this?

  • Bug fix in a backwards-compatible manner.
  • New feature in a backwards-compatible manner.
  • Breaking change: bug fix or new feature that involve incompatible API changes.
  • Other (e.g. doc update, configuration, etc)

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.

  • I added a line to the CHANGELOG.md file in the Unreleased section under the most fitting heading (e.g. Added, Changed, Removed).
  • I ran all tests on my computer and it's all green (i.e. invoke test).
  • I ran lint on my computer and there are no errors (i.e. invoke lint).
  • I added new functions/classes and made them available on a second-level import, e.g. compas.datastructures.Mesh.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added necessary documentation (if appropriate)

@tomvanmele tomvanmele marked this pull request as ready for review July 5, 2021 07:03
self.edge = {}
self.adjacency = {}
self.default_node_attributes = {}
self.default_node_attributes = {'x': 0.0, 'y': 0.0, 'z': 0.0}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised to see this. I thought Graphs were purely topological.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they are. before this was added in the network init. however, even graphs have to be visualised so purely from a practical point of view we might as well add the default coordinates here. can change this back if it doesn't feel right ...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in general, i think the separation between graph and network, and between halfedge and mesh, etc. is a bit artificial and is only there to make the individual class definitions a bit shorter. especially in case of the mesh it doesn't make much sense because halfedge is not meaningful by itself...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a graph were visualized with all the nodes at the origin, it's not much of a visualization...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed it is not. the defaults are just there such that more meaningful coordinates can be set through the attribute functions. if no geometry is explicitly assigned, the graph could be considered as purely topological and visualisations are meaningless without a chosen layout. we could wrap the layout mechanisms of networkx for this...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would vote for not having coords in the graph and keeping it as purely topological as possible. Then, as mentioned, visualization needs layouting, but we can either use some of the networkx ones, or our own, I wrote a few simple ones for our workshops, which surely need improvement but might be a starting point.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure will move it to network

Copy link
Member

@beverlylytle beverlylytle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Copy link
Member

@gonzalocasas gonzalocasas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides the comment about moving coordinates out of Graph, it lgtm. If possible, throw in a couple of unit tests to verify basic default attr behavior.

@tomvanmele
Copy link
Member Author

closed in favoour of #892

@tomvanmele tomvanmele closed this Sep 8, 2021
@tomvanmele tomvanmele deleted the ds-defaults branch September 8, 2021 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants