Open
Description
Is your feature related to a problem?
When plotting geodesics, calling connecting_geodesic
, the function assumes that the graph is connected. When not connected, networks.shortest_path
throws after some time an error that can be seen as cryptic by the users.
Describe the solution you would like:
Either when discretising the manifold, or before plotting the geodesics, a warning message can be added to check that the graph is connected: assert nx.is_connected(graph), "Graph not connected"
. Additional guidance or best practices can be added to ensure the graph is connected.
Activity
[-][Improvement] Unsure the graph is connected before connecting geodesics[/-][+][Improvement] Ensure the graph is connected before connecting geodesics[/+]a-pouplin commentedon Mar 20, 2023
Another improvement would be to check if the size are as expected. For example, in
DiscretizedManifold.fit()
function:a-pouplin commentedon Mar 20, 2023
Another question regarding
DiscretizedManifold.fit()
: a graph is created based on two points obtained from a curve:and this method mainly relies on giving a metric tensor to compute the graph ( ) of the curve: . Derivatives can be nicely computed only if the curve is discretised enough.
curve_length
depends oninner_product
which depends onmetric
). Yet, when the metric tensor is not easily accessible, once might want to compute the curve lenght based on the derivatives (The question is: would it make sense to add an argument (ex: num_curve_points) to discretise the curve and use the derivatives to compute the expected metric (or a Finsler metric for example)?