ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 02 May 2022 15:02:19 +0200Evaluating the tangent vector of a previously saved and loaded integrated geodesichttps://ask.sagemath.org/question/62165/evaluating-the-tangent-vector-of-a-previously-saved-and-loaded-integrated-geodesic/I am trying to figure out how to load a previously computed and saved integrated geodesic and find the tangent vector using `geod.tangent_vector_eval_at` at a later time. The problem is that i can not seem to find a way to refer a `solution_key=` to the solution after i've loaded it in order to interpolate it. Is there a way to do that at a time different than the one that the solution is being computed? Thanks in advance.Tue, 26 Apr 2022 11:33:08 +0200https://ask.sagemath.org/question/62165/evaluating-the-tangent-vector-of-a-previously-saved-and-loaded-integrated-geodesic/Answer by kva for <p>I am trying to figure out how to load a previously computed and saved integrated geodesic and find the tangent vector using <code>geod.tangent_vector_eval_at</code> at a later time. The problem is that i can not seem to find a way to refer a <code>solution_key=</code> to the solution after i've loaded it in order to interpolate it. Is there a way to do that at a time different than the one that the solution is being computed? Thanks in advance.</p>
https://ask.sagemath.org/question/62165/evaluating-the-tangent-vector-of-a-previously-saved-and-loaded-integrated-geodesic/?answer=62275#post-id-62275Hello Bubbz, thank you for your question. It seems indeed that the contents of the attributes **_solutions** and **_interpolations** of **geod** are lost in the process save/load, although all the other attributes are well preserved (e.g. **_initial_tangent_vector** or **_parameters**).
In the case of the attribute **_interpolations**, this seems to be expected because pickling does not work on Spline objects: calling e.g. **save(geod._interpolations, "geod_interps.sobj")** yields the error message **TypeError: cannot pickle 'sage.calculus.interpolation.Spline' object**.
In the case of the attribute **_solutions**, the reason why it is lost is probably tricky, as this is easily worked around with the idea above: you could save and reload the attribute **_solutions** independently from **geod** itself, by executing e.g. **save(geod._solutions, "geod_sols.sobj")**, so that you could execute **geod._solutions = load("geod_sols.sobj")** after having reloaded **geod** itself at any later time.Mon, 02 May 2022 15:02:19 +0200https://ask.sagemath.org/question/62165/evaluating-the-tangent-vector-of-a-previously-saved-and-loaded-integrated-geodesic/?answer=62275#post-id-62275