-
Notifications
You must be signed in to change notification settings - Fork 880
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
Make connections in experiment cell spaces named #2096
Conversation
for more information, see https://pre-commit.ci
Performance benchmarks:
|
Thanks for this. It looks very good already. Just a few quick questions
|
Thank you for the response.
I forgot there is a HexGrid 😅, I'll add the names.
So there will be the default name for each connection, right? Should the type of the default name be
I ran the benchmarks on my local PC and the performance loss is not significant. Here is the benchmark result.
Could you re-trigger the performance benchmarks by adding the label
It's actually not needed, we can move the implementation to the
It is necessary if we want to support removing the connection by its index (so that we don't have to iterate the |
for more information, see https://pre-commit.ci
Thanks for this effort, and sorry to let you waiting. While I think named connections are useful, it seems like quite a lot of code for what in my head is a relatively simple feature. But maybe it's needed for this to work properly and I'm underestimating the complexity. Could you expand a bit on this? Also, @quaquel, what's your take on this? |
Hello! Thanks for the response. I wanted to separate the feature's implementation so that we wouldn't have to change too much in other places (we just need to use In the
The complexity in adding and removing the connections mostly comes from dealing with multiple types of input because I don't know the specific requirements so I tried to cover all cases that I can think of. We can remove some of the code to make it simpler. |
for more information, see https://pre-commit.ci
@quaquel I would like your opinion on this before I merge this. |
closed via #2296. |
The proposed solution is to create a new Connection class that stores the connection information of each Cell.
Inside a Connection class, there are three main attributes:
naming
: A dictionary mapping astr
name to anint
index.reverse_naming
: A dictionary mapping anint
index to astr
name.connections
: A list ofCell
containing the connecting cells.Currently,
Connection
implements two methods for adding and deleting connections.I have added additional test cases for
OrthogonalMooreGrid
similar to the example in #2060.