Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Get the tour model generation code to work again (#788)
* Get the tour model generation code to work again The big changes were to move the visualization imports, notably matplotlib, into the individual visualization functions. It is terrible practice to mix computation and viz, not the least because the dependencies for the computation are unnecessarily bloated by viz modules other changes: - remove invalid and unused reference to edb directly - change print -> print() to support python3 - remove erroneous close paranthesis - add pykov to the computation environment Testing done: Without the fixes: ``` (emission) kshankar-35069s:e-mission-server kshankar$ ./e-mission-py.bash emission/pipeline/model_stage.py storage not configured, falling back to sample, default configuration Connecting to database URL localhost Traceback (most recent call last): File "emission/pipeline/model_stage.py", line 13, in <module> import emission.storage.decorations.tour_model_queries as esdtmq File "/Users/kshankar/e-mission/e-mission-server/emission/storage/decorations/tour_model_queries.py", line 12, in <module> import emission.storage.decorations.common_place_queries as esdcpq File "/Users/kshankar/e-mission/e-mission-server/emission/storage/decorations/common_place_queries.py", line 16, in <module> import pykov as pk ModuleNotFoundError: No module named 'pykov' ``` and multiple other errors With the fixes: ``` Cleanedplace({'source': 'DwellSegmentationTimeFilter', 'enter_ts': 1610812590, 'enter_local_dt': {'year': 2021, 'month': 1, 'day': 16, 'hour': 8, 'minute': 56, 'second': 30, 'weekday': 5, 'timezone': 'America/Denver'}, 'enter_fmt_time': '2021-01-16T08:56:30-07:00', 'location': {'type': 'Point', 'coordinates': [-104.891193, 39.7660244]}, 'raw_places': [ObjectId('60031cc37dc9bcbfa487c31e'), ObjectId('60031cc37dc9bcbfa487c31e')], 'ending_trip': ObjectId('60031cc47dc9bcbfa487c327'), 'starting_trip': ObjectId('60039b632fb2ebf61146462a'), 'exit_ts': 1610843452.733473, 'exit_fmt_time': '2021-01-16T17:30:52.733473-07:00', 'exit_local_dt': {'year': 2021, 'month': 1, 'day': 16, 'hour': 17, 'minute': 30, 'second': 52, 'weekday': 5, 'timezone': 'America/Denver'}, 'duration': 30862.733473062515})], 'end': 0, 'start': 1, 'start_coords': [-104.90605494323428, 39.764846852552445], 'end_coords': [-104.89127443959791, 39.765978419090914]} 2021-01-24 15:07:42,885:DEBUG:After creating map, number of places is 2 2021-01-24 15:07:42,885:DEBUG:Adding 55 places for this place 2021-01-24 15:07:42,889:DEBUG:Adding 55 places for this place ``` * Revert changes to the webserver conf and the notebook additions Which should really go into a different PR
- Loading branch information