NREL / mappymatch

Pure-python package for map matching
http://mappymatch.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
58 stars 19 forks source link

str and repr for mappymatch objects #111

Closed machallboyd closed 2 years ago

machallboyd commented 2 years ago

Addresses issue [#35], adding string representations to objects

Before opening PR for approval, could use feedback on what's useful string representations of objects. Currently on this branch:

str(matcher)
"LCSSMatcher({'road_map': NXMap('(g, MultiDiGraph with 1239 nodes and 3417 edges), (crs, epsg:3857), (_dist_weight, kilometers), (_time_weight, travel_time), (_geom_key, geometry), (_road_id_key, road_id), (rtree, rtree.index.Index(bounds=[-11684967.812039806, 4815101.583056703, -11678639.588418882, 4829602.061216707], size=3417)), (_nodes, list of 1239 elements), (_roads, list of 3417 elements)'), 'distance_epsilon': 50.0, 'similarity_cutoff': 0.9, 'cutting_threshold': 10.0, 'random_cuts': 0, 'distance_threshold': 10000})"
repr(matcher.road_map)

'NXMap(g: MultiDiGraph with 1239 nodes and 3417 edges, crs: epsg:3857, _dist_weight: kilometers, _time_weight: travel_time, _geom_key: geometry, _road_id_key: road_id, rtree: rtree.index.Index(bounds=[-11684967.812039806, 4815101.583056703, -11678639.588418882, 4829602.061216707], size=3417), _nodes: list of 1239 elements, _roads: list of 3417 elements)'
machallboyd commented 2 years ago

Going back to the drawing board.