Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upWIP:adding benchmarks #16
Conversation
Juanlu001
approved these changes
Jul 25, 2018
def time_propagation(method, ecc): | ||
a = 7000 * u.km | ||
_a = 0.0 * u.rad | ||
if ecc < 1.0: |
This comment has been minimized.
This comment has been minimized.
Juanlu001
Jul 25, 2018
Member
Now that I see this, I'm not supper happy with the "discontinuity" of the Orbit.from_classical
function (which we were already aware of anyway, see https://github.com/poliastro/poliastro/wiki/Parabolic-orbits:-final-decision). On the other hand, this test is backwards compatible no matter we decide regarding this particular point.
Juanlu001
requested changes
Jul 27, 2018
Left some comments. Regarding the setup functions, I don't care whether we use the Object-Oriented approach or the functional approach. The objects look cleaner and don't make you use module-level variables, but I don't have a strong opinion. |
r = [12214.83399, 10249.46731, 0.0] * u.km | ||
tof = 76.0 * u.min | ||
|
||
expected_va = [2.058925, 2.915956, 0.0] * u.km / u.s |
This comment has been minimized.
This comment has been minimized.
expected_va = [2.058925, 2.915956, 0.0] * u.km / u.s | ||
expected_vb = [-3.451569, 0.910301, 0.0] * u.km / u.s | ||
|
||
va, vb = next(lambert(k, r0, r, tof)) |
This comment has been minimized.
This comment has been minimized.
Juanlu001
Jul 27, 2018
Member
I don't think we even need variable assignment here (IDEs will complain anyway that "variables are not used" or "statement has no effect")
|
||
|
||
def time_J2_propagation_Earth(): | ||
r0 = np.array([-2384.46, 5729.01, 3050.46]) # km |
This comment has been minimized.
This comment has been minimized.
Juanlu001
Jul 27, 2018
Member
With this structure, if the setup takes a significant amount of time, we will get noisy results. We should move everything that is not cowell(...)
to a setup function:
https://asv.readthedocs.io/en/latest/writing_benchmarks.html#setup-and-teardown-functions
orbit = Orbit.from_classical(Earth, a_ini, ecc_ini, inc_ini, raan_ini, argp_ini, nu_ini) | ||
|
||
tof = (1.0 * u.min).to(u.s).value | ||
r_J2, v_J2 = cowell(orbit, tof, ad=J2_perturbation, |
This comment has been minimized.
This comment has been minimized.
rho0 = Earth.rho0.to(u.kg / u.km**3).value # kg/km^3 | ||
H0 = Earth.H0.to(u.km).value | ||
tof = 60 # s | ||
r, v = cowell(orbit, tof, ad=atmospheric_drag, R=R, C_D=C_D, A=A, m=m, H0=H0, rho0=rho0) |
This comment has been minimized.
This comment has been minimized.
Juanlu001
approved these changes
Jul 27, 2018
Juanlu001
merged commit ebbcf39
into
poliastro:master
Jul 27, 2018
1 check passed
This comment has been minimized.
This comment has been minimized.
Great, thanks! I will start running them tonight. |
nikita-astronaut commentedJul 25, 2018
No description provided.