benmaier / netwulf

Interactive visualization of networks based on Ulf Aslak's d3 web app.
MIT License
294 stars 26 forks source link

Post to python functionality not working #20

Closed vc1492a closed 5 years ago

vc1492a commented 5 years ago

I am not able to get the Post to Python functionality working in my environment. More specifically, the UI indicates success and closes the browser window, but the Python kernel remains busy indefinitely and on manually stopping execution, the network_properties object is not returned. This occurred in both a Jupyter notebook as well as a Python session session within a terminal window.

Environment details:

leouieda commented 5 years ago

Related to openjournals/joss-reviews#1425 (so I can keep track of progress in the review issue)

benmaier commented 5 years ago

Thank you for opening the issue! Would you mind running the function again with keyword verbose=True?

visualize(G,verbose=True)

then click "Post to Python" and copy-paste the console output here. Thanks!

vc1492a commented 5 years ago

Sure, see below:

changing directory to /Users/valentinoconstantinou/.netwulf
starting server here ... /Users/valentinoconstantinou/.netwulf
127.0.0.1 12/May/2019 10:31:14 GET /?data=tmp_16aad193d82.json&config=config_tmp_16aad193d82.json HTTP/1.1 200 -
127.0.0.1 12/May/2019 10:31:14 GET /style.css HTTP/1.1 200 -
127.0.0.1 12/May/2019 10:31:14 GET /libs/d3.v4.min.js HTTP/1.1 200 -
127.0.0.1 12/May/2019 10:31:14 GET /libs/dat.gui.js HTTP/1.1 200 -
127.0.0.1 12/May/2019 10:31:14 GET /libs/sweetalert.min.js HTTP/1.1 200 -
127.0.0.1 12/May/2019 10:31:14 GET /libs/lodash.js HTTP/1.1 200 -
127.0.0.1 12/May/2019 10:31:14 GET /vis.js HTTP/1.1 200 -
127.0.0.1 12/May/2019 10:31:14 GET /parse_options.js HTTP/1.1 200 -
127.0.0.1 12/May/2019 10:31:14 GET /post_json.js HTTP/1.1 200 -
127.0.0.1 12/May/2019 10:31:14 GET /config_tmp_16aad193d82.json HTTP/1.1 200 -
127.0.0.1 12/May/2019 10:31:14 GET /tmp_16aad193d82.json HTTP/1.1 200 -
127.0.0.1 12/May/2019 10:31:14 HTTPStatus.NOT_FOUND File not found
127.0.0.1 12/May/2019 10:31:14 GET /favicon.ico HTTP/1.1 404 -
127.0.0.1 12/May/2019 10:31:29 POST /?data=tmp_16aad193d82.json&config=config_tmp_16aad193d82.json HTTP/1.1 200 -
Successfully posted network data to Python!
127.0.0.1 12/May/2019 10:31:32 POST /?data=tmp_16aad193d82.json&config=config_tmp_16aad193d82.json HTTP/1.1 200 -
stopping server ...
was asked to stop the server
deleted all files

This is the output I see after not killing the process for about 10 minutes or so. Digging a little further, running: lsof -t -i :9853 in terminal returns a running process as expected when the interface is open, and does not when the interface has closed (which I am assuming is correct behavior). Hope this helps.

benmaier commented 5 years ago

I think I managed to replicate the behavior, which seems to appear with Python 3.5 if netwulf is installed using the 0.0.14 version on PyPI, and not from the repository. I've now updated the version on PyPI to 0.0.16 which seems to have fixed the issue of the Post to Python-button. Could you try again (without the verbose=True flag, which suppresses the replicated matplotlib-figure)?

vc1492a commented 5 years ago

@benmaier Thanks for the update! I installed version 0.0.16 via PyPi and the Post to Python functionality is working as now. A unit test could be written in the future test to ensure the proper behavior. Let me know if there's any remaining items to test related to this issue - if there are none, please feel free to ahead and close this issue. Thanks for the quick turn-around! 👍

benmaier commented 5 years ago

Cool! Closing this now :) @ulfaslak and I will discuss the testing issues separately and get back to you on that!