question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Improvements to `keplerlib.py` and `elementslib.py`

See original GitHub issue

I’d like to start a discussion of what things in keplerlib.py and elementslib.py can be improved, and also putting them in priority order so I can work on the more important things first. Here are some ideas I’ve had:

  • Should all of the math functions in elementslib have one code path that can handle floats or arrays instead of one path for arrays and one path for floats? Possibly a decorator could convert floats into arrays and then back to floats so only the array branch would be necessary
  • Should the KeplerOrbit and OsculatingElements objects use au^3/d^2 to store GM internally to match the rest of Skyfield instead of km^3/s^2? I think the only place this would effect users is that OsculatingElements has a keyword argument mu_km_s. How should this be handled?
  • Should the user be expected to specify a value for GM whenever it is necessary rather than saving values internally? If so how should this be handled for backwards compatibility?
  • I need to refamiliarize myself with what is happening in PR #340 so it can be either merged or closed
  • After the signature for KeplerOrbit objects is finalized it can be specified in the API reference section.
  • revise the documentation for osculating orbital elements so it better matches the rest of the documentation both in tone and in the formatting of the examples

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
JoshPatersoncommented, Nov 28, 2020

Is it clear enough what this would look like that you could try a quick draft PR, or should I suggest a rough draft of what the API would look like, to save you a round-trip if you are imagining something a bit different?

Yes, this feels clear enough to make a draft PR.

any further dimensions should work seamlessly, as long as both time and coordinates are extended to the same number of dimensions.

Interesting! I think KeplerOrbit objects are similar in that once keplerlib.propagate is vectorized the KeplerOrbit doesn’t need to change, the arrays are just passed right through.

1reaction
Bernmeistercommented, Nov 23, 2020

@brandon-rhodes Am crafting said script (it is similar to that in #449 but taking into account your suggestions with regards to dataframe loading). I’ll post the script in a new ticket so this doesn’t get muddied.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Handling EphemerisRangeError when observing a minor ...
On looking at the downloaded data, there is a piece of data missing from one field when compared to lines before/after. I presume...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found