Skip to content

Conversation

@Ady1998
Copy link
Owner

@Ady1998 Ady1998 commented Jul 25, 2018

No description provided.

This will make the example easier to cut and paste; fixes #715.
The fallback code that looks for the old undocumented attribute
`rough_period` has been generating a confusing error message, because
the documentation talks only about `step_days`.  Fixes #715.
To prevent confusion, stop using the term ‘geocentric’ for the position
passed to a lat/lon routine, since readers might confuse it with the
idea of ‘geocentric latitude’ (which Skyfield doesn’t use); and make
explicit in each of the methods that ‘geodetic’ coords are returned.
A question in #1048 led me to notice this oversight.
This will let external scripts do a ‘make sync’ to see how the web site
would be updated after a change, without stranding the user at a ‘y/n’
prompt asking whether to actually push the changes out.
A bump from 3.7 to 3.8 might sound trivial, but it took at least a dozen
attempts at tweaking `requirements.txt` before it worked out.  Each time
I had to start over from the beginning.  Turns out?  I needed to pin
`pygments` to avoid massive changes to the documentation HTML, which I
don’t have time to vet right now.
A recent issue alerted me to the fact that the test suite was not
detecting Python deprecation warnings.  Turning them on, alas, revealed
that `astropy` and `pandas` were both triggering warnings on their own,
killing the tests.  Here we upgrade them to safe versions, then turn on
deprecation warnings, hopefully permanently.

(Also: so that the test script works in a minimal container, have it
skip running git if git is not installed.)
To find the position of deflectors like the Sun and Jupiter, the
`.observe()` method uses its position’s `._ephemeris`, which is in turn
copied from the vector function’s `.ephemeris`.  But I had forgotten to
record an `.ephemeris` for the new `jpllib.Stack`, so users saw:

    File ".../skyfield/relativity.py", line 46, in add_deflection
      deflector = ephemeris[name]
                  ~~~~~~~~~^^^^^^
    TypeError: 'NoneType' object is not subscriptable

Fixes #1063. Fixes #1066. Fixes #1068.
Gads, how did I wind up shipping such a huge test file with Skyfield?
Irresponsible.  Not sure what I was thinking.  Apologies, everyone.
A slight gain in efficiency; it bothered me whenever I read the code.
Since I sometimes need the date of a conjunction to write a test.
This test will prove that the next diff, which rewrites the deflection
logic, is a mere refectoring that keeps Skyfield’s behavior the same.
The choice of deflectors is stranded down inside of the ungainly
add_deflection() routine.  Instead of adding yet another parameter to a
routine that already has too many parameters, let’s abandon the routine
entirely, splitting its logic into smaller pieces that can then be
called directly from the .apparent() method.
To reduce the expense of looking up a planet in an ephemeris, each
ephemeris was doing a single scan of its `.segments` in `__init__()` and
caching the resulting vector functions.  But this meant that users could
not usefully edit the `.segments` list — for example, to combine all the
segments from two ephemeris files.  So let’s do everything on-the-fly.
And, improve the exception raised if a deflector is missing.
Since `test-docs.sh` was intermittently finding an import loop while I
was writing the previous commit, but only by chance, when it happened to
run the documentation in some particular order.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants