Skip to content

Commit

Permalink
Bring API docs up to date (#23)
Browse files Browse the repository at this point in the history
* fix API docs
  • Loading branch information
dahlend authored May 17, 2024
1 parent c976bc1 commit 5f9d2f2
Show file tree
Hide file tree
Showing 19 changed files with 212 additions and 40 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Moved population definitions to the base level and renamed it `population`.
- Changed references to diameters in the broken power law sampler.
- FOV propagation tests now return a flatten list of states.
- Renamed `data` to `cache` to more accurately represent its function.

### Fixed

Expand Down
4 changes: 1 addition & 3 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
include src/neospy/data/*
include src/neospy/_core*
exclude src/neospy/data/*.gz
include src/neospy/_core*
2 changes: 2 additions & 0 deletions docs/api/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ API
.. toctree::
:maxdepth: 2

cache
conversion
flux
fov
interface
observatory
population
Expand Down
8 changes: 8 additions & 0 deletions docs/api/cache.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
cache
=====

Tools to interact with NEOSpy's Cache folder.

.. automodule:: neospy.cache
:members:
:inherited-members:
8 changes: 8 additions & 0 deletions docs/api/fov.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
fov
===

Field of View

.. automodule:: neospy.fov
:members:
:inherited-members:
22 changes: 22 additions & 0 deletions docs/api/spice.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,28 @@
spice
=====

This is a thread-safe, read only re-implementation of a SPICE kernel interpreter.
Outputs of this exactly match the common cSPICE interpreter, but can be easily
used among an arbitrary number of cores. SPICE kernel files are loaded directly
into RAM.

.. note::

This does not use cSPICE, or any original SPICE library code.

cSPICE is difficult to use in a thread safe manner which is limiting when
performing orbit calculations on millions of objects.

Data files which are automatically included:

DE440 - A SPICE file containing the planets within a few hundred years.

BSP files are also automatically included for the 5 largest asteroids, which are
used for numerical integrations when the correct flags are set.

PCK Files which enable coordinate transformations between Earths surface and the
common inertial frames.

.. automodule:: neospy.spice
:members:
:inherited-members:
8 changes: 6 additions & 2 deletions docs/api/vector.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
core
====
vectors/states/frames
=====================

Units used throughout NEOSpy are distance in au, and time in Days TDB scaled.

Coordinate frames match the coordinate frames used by cSPICE.

.. automodule:: neospy.vector
:members: Vector
Expand Down
4 changes: 4 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
"sphinx_gallery.gen_gallery",
"matplotlib.sphinxext.plot_directive",
]

suppress_warnings = ["config.cache"]


autodoc_typehints = "description"
autodoc_inherit_docstrings = True
autodoc_warningiserror = True
Expand Down
16 changes: 9 additions & 7 deletions src/neospy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
from .vector import Vector, Frames, State, CometElements
from .vector import (
Vector,
Frames,
State,
CometElements,
SimultaneousStates,
)
from . import (
constants,
covariance,
wise,
neos,
data,
cache,
population,
flux,
mpc,
Expand All @@ -30,18 +36,14 @@
)
from .horizons import HorizonsProperties


# pylint: disable-next=import-error
from ._core import SimultaneousStates # type: ignore

import logging


__all__ = [
"cache",
"constants",
"CometElements",
"covariance",
"data",
"irsa",
"Frames",
"moid",
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/neospy/horizons.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def _fetch_json(
have fragments, as these objects are difficult to query since there are
several names which have matches on substrings.
"""
from .data import cache_path
from .cache import cache_path
from .mpc import unpack_designation, pack_designation
import json

Expand Down
2 changes: 1 addition & 1 deletion src/neospy/mpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from . import conversion, constants
from .time import float_day_to_d_h_m_s, Time
from .vector import Vector, Frames, CometElements
from .data import cached_gzip_json_download
from .cache import cached_gzip_json_download

# pylint: disable-next=no-name-in-module
from . import _core # type: ignore
Expand Down
1 change: 1 addition & 0 deletions src/neospy/rust/fovs/collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ impl FOVList {
FOVList(list)
}

/// Sort the list of FOVs by their JD.
pub fn sort(&mut self) {
self.0.sort_by(|a, b| a.jd().total_cmp(&b.jd()))
}
Expand Down
Loading

0 comments on commit 5f9d2f2

Please sign in to comment.