lsstdarkmatter / dark-matter-graph

Create dark matter graphics
https://lsstdarkmatter.github.io/dark-matter-graph/
MIT License
5 stars 2 forks source link

add server.py to make starting a server easier #43

Closed yymao closed 6 years ago

yymao commented 6 years ago

This PR adds server.py to make starting a server easier.

@kadrlica can you help testing this new way of starting a http server on a Mac? Thanks!

kadrlica commented 6 years ago

Thinking about it more, we could potentially start the browser or open a new tab the way jupyter notebooks do. The current implementation (manual redirect) is simple and straightforward, so I don't think this is a high-priority item.

yymao commented 6 years ago

@kadrlica thanks, can you try this again to see the browser thing works?

kadrlica commented 6 years ago

That worked for me (it took ~5s to load, which was strange).

yymao commented 6 years ago

@kadrlica which part tooks 5s? opening the browser or browser opening the page?

kadrlica commented 6 years ago

@yymao it was loading the page that took time. I just checked the most recent commit and it is lightning fast! However, when I closed and then re-ran it, it stalled loading the network image. When I killed it I got:

----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 58585)

I've tried closing and re-running multiple times and this appears to be an unpredictable (but repeatable) event.

yymao commented 6 years ago

@kadrlica Thanks for testing. The "Exception happened..." was due to a bug in Python 2.7. It's harmless, but I have tried to remove it.

Some of the slowness or not loading pictures seem to be the issue of browser not cleaning up cache. Try pressing cmd + shift + R to see if that helps.

I probably won't attempt to make this convenient function more sophisticated. I'm merging this now. Please open an issue there's something not usable.