Skip to content
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

Bug in module connect #228

Closed
ghost opened this issue Aug 13, 2019 · 3 comments
Closed

Bug in module connect #228

ghost opened this issue Aug 13, 2019 · 3 comments
Assignees

Comments

@ghost
Copy link

ghost commented Aug 13, 2019

Module connect implicitly creates ports using the module names when two modules are connected. This is fine when a module is connected to another one only once. The bug appears when many modules with the same name are connected to each other. Instead of creating a new port for every module, the old one just gets overwritten with the same name. To see this for example, try connecting every droplet together in run_droplet_a.py.

@ghost ghost assigned dealmeidavf Aug 13, 2019
dealmeidavf added a commit that referenced this issue Aug 14, 2019
@dealmeidavf
Copy link
Member

I added a note on usage to avoid the problem.

def connect(self, module_port_a, module_port_b, info=None):
'''Connect two modules using either their ports directly or inferred ports.
A connection always opens a channel for data communication in both ways.
That is, both sends and receives are allowed.
Note
----
The simplest form of usage is with arguments: (`module_a`, `module_b`).
In this case, a `port` with the name of `module_a` **must** exist in `module_b`,
and vice-versa (port names as `str` in lower case). In addition, the connect
must not be called again with these same two modules, else the underlying
connection will be overriden.
For more rigorous connection, the user is advised to fully specify the
module and the port in each list argument.
Parameters
----------
module_port_a: list([Module,Port]) or list([Module,str]) or Module
First `module`-`port` to connect.
module_port_b: list([Module,Port]) or list([Module,str]) or Module
Second `module`-`port` to connect.
info: str
Information on the directionality of the information flow. This is for
graph visualization purposes only. The default value will use the order
in the argument list to define the direction. Default: None. If set
to `bidiretional`, will create a double headed arrow in the graph figure.
'''

dealmeidavf added a commit that referenced this issue Aug 14, 2019
@dealmeidavf
Copy link
Member

I renamed the run_droplet_b.py to run_droplet_test.py because this is an older version we don't want to invest and because it is probably a good use for a CI test. Both options of network are running:

network-0 gv

network-0 gv

However there is something about DataPlot that does not share the data with the main process (multiprocessing option). Maybe look at this later...help appreciated.

@dealmeidavf
Copy link
Member

Please post a fix when the pickled modules are loaded correctly. Refer this Issue number so we close this. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant