Skip to content

Commit

Permalink
Deprecate a redundant method we never used
Browse files Browse the repository at this point in the history
I was far too fearful of underlying libraries when I wrote Skyfield!  If
the user wants something low-level, like an ephemeris comments field, I
shouldn’t be afriad to tell them to drop down one level to look at it.
(Irony: `planets.rst` forgot this existed, and called the lower level!)
  • Loading branch information
brandon-rhodes committed Jan 19, 2025
1 parent 46e3c54 commit 074be43
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
1 change: 0 additions & 1 deletion documentation/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ See :doc:`planets`.

SpiceKernel
SpiceKernel.close
SpiceKernel.comments
SpiceKernel.names
SpiceKernel.decode

Expand Down
19 changes: 1 addition & 18 deletions skyfield/jpllib.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def __init__(self, path):
self.segments = [SPICESegment(self, s) for s in self.spk.segments]
self.codes = set(s.center for s in self.segments).union(
s.target for s in self.segments)
self.comments = self.spk.comments # deprecated pass-through method

def __repr__(self):
return '<{0} {1!r}>'.format(type(self).__name__, self.path)
Expand Down Expand Up @@ -101,24 +102,6 @@ def close(self):
del self.segments[:]
self.codes.clear()

def comments(self):
"""Return the comments string of this kernel.
The resulting string often contains embedded newlines, and is
formatted for a human reader.
>>> print(planets.comments())
; de421.bsp LOG FILE
;
; Created 2008-02-12/11:33:34.00.
...
LEAPSECONDS_FILE = naif0007.tls
SPK_FILE = de421.bsp
...
"""
return self.spk.comments()

def names(self):
"""Return all target names that are valid with this kernel.
Expand Down

0 comments on commit 074be43

Please sign in to comment.