Skip to content
This repository has been archived by the owner on Oct 14, 2023. It is now read-only.

Refactor math (was: poliastro.ephem cleanup) #1434

Merged
merged 9 commits into from
Jan 9, 2022

Conversation

astrojuanlu
Copy link
Member

@astrojuanlu astrojuanlu commented Dec 27, 2021

Notable changes:

  • Rewrite build_ephem_interpolant in terms of existing classes. I tried to remove its usage but it will require a bit more care. Had to revert this because it caused a massive slowdown, see below.
  • Embrace the Astropy builtin ephemeris everywhere in the tests, now that Astropy >= 5.0 can compute the Moon velocity! Use new erfa routine to calculate the position of the Moon聽astropy/astropy#11753 The large diff in the tests is because of the indentation removal, should be mostly a whitespace change.
  • As a result, drop support for Python 3.7.
  • Create new poliastro._math package with all mathematical functions not strictly related to Astrodynamics, so we can easily identify (and possibly refactor) dependencies with SciPy. I decided to make it private but maybe we shouldn't be so overprotective, I'm open to suggestions... 馃構

@astrojuanlu
Copy link
Member Author

Pro tip:

Screenshot 2021-12-27 at 07-46-57 poliastro ephem cleanup by astrojuanlu 路 Pull Request #1434 路 poliastro poliastro

@astrojuanlu
Copy link
Member Author

Next in line: astrojuanlu#13

@astrojuanlu
Copy link
Member Author

Hmmm slow tests got really slow? 馃

@astrojuanlu astrojuanlu reopened this Dec 27, 2021
@astrojuanlu
Copy link
Member Author

py38-slow took ~12 minutes on main, let's see if there's a slowdown. I did some tests and I think there shouldn't, but we'll see.


r_values[i] = r.xyz.to(u.km)
def interpolant(t):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably poses a big performance regression and can't be merged as it stands now 馃槶

@astrojuanlu
Copy link
Member Author

I have some ideas on how I could tackle this but I'll need more time. For now, I'll partially revert this and merge.

@astrojuanlu
Copy link
Member Author

@astrojuanlu astrojuanlu changed the title poliastro.ephem cleanup Refactor math (was: poliastro.ephem cleanup) Jan 9, 2022
@astrojuanlu
Copy link
Member Author

Looking much better now.

@astrojuanlu astrojuanlu merged commit 7746b13 into poliastro:main Jan 9, 2022
@astrojuanlu astrojuanlu deleted the ephem-cleanup branch January 14, 2022 09:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant