Skip to content

Commit

Permalink
update docs and ancillary env files[skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
m-stclair committed Sep 23, 2024
1 parent a1db31c commit bbf8a47
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 71 deletions.
1 change: 0 additions & 1 deletion benchmark/bench-environment.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: lh-bench
channels:
- conda-forge
- defaults
dependencies:
- astroquery
- jupyter
Expand Down
50 changes: 17 additions & 33 deletions docs/conda_installation_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,34 @@

## step 1: install conda

*If you already have Anaconda or Miniconda installed on your computer, you can
*If you already have another version of `conda` installed on your computer, you can
skip this step. If it's very old or not working well, you should uninstall it first.
We **definitely** don't recommend installing multiple versions of `conda`
unless you have a strong and specific reason to do so.*

[You can get `conda` here as part of the Miniconda distribution of Python](https://docs.conda.io/projects/continuumio-conda/en/latest/user-guide/install/index.html).
[You can get `conda` here as part of the Miniforge distribution of Python](https://github.com/conda-forge/miniforge).
Download the appropriate version of the installer for your operating system and
processor architecture (in most cases 64-bit) and follow the instructions on that
website to set up your environment. Make sure you download Miniconda3, not
Miniconda2. `lhorizon` is not compatible with Python 2.
website to set up your environment.

## step 2: create conda environment
## step 2: install `lhorizon` from conda-forge

Now that you have `conda` installed, you can set up a Python environment
to use `lhorizon`. Open a terminal window: Anaconda Prompt on Windows, Terminal on macOS,
or your console emulator of choice on Linux. Navigate to the directory where
you put the repository and run the command:

`conda env create -f environment.yml`

Say yes at the prompts and let the installation finish. Then run:

`conda env list`

You should see `lhorizon` in the list of environments. Now run:
Create a new conda environment and install `lhorizon` into it:
`conda create -n lhorizon lhorizon`.

`conda activate lhorizon`
If you are using a different version of `conda` rather than the Miniforge version
linked above, you may need to specify the conda-forge channel, like:
`conda create -c conda-forge -n lhorizon lhorizon`.

and you will be in a Python environment that contains all the packages
`lhorizon` needs.
## step 3: use the `lhorizon` environment

**Important:** now that you've created this environment, you should
always have it active whenever you work with `lhorizon`.

If you can't activate the environment, see 'common gotchas' below.

## step 3: install `lhorizon` as a site package

With the "lhorizon" environment active, run `python setup.py install`.
Now `lhorizon` can be imported in any code you run using the "lhorizon"
environment.
Now you have a Python environment that contains `lhorizon` and all its dependencies.
Open a terminal window: Anaconda Prompt on Windows, Terminal on macOS,
or your console emulator of choice on Linux. Navigate to the directory where
you put the repository and run the command:

Now go try the example Jupyter Notebooks by running `jupyter notebook` and
navigating to the /lhorizon/examples directory!
`conda activate lhorizon`. Now you can download the example Notebooks from
GitHub and run them, or write whatever other code you like using `lhorizon`

## common gotchas

Expand All @@ -57,4 +41,4 @@ navigating to the /lhorizon/examples directory!
* If you've already got an installed version of `conda` on your system, installing
an additional version without uninstalling the old one may make environment setup very
challenging. We do not recommend installing multiple versions of `conda` at once
unless you really need to.
unless you really need to.
1 change: 0 additions & 1 deletion lhorizon/tests/.doc-environment.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: lh-docs
channels:
- conda-forge
- defaults
dependencies:
- python=3.11
- pydoc-markdown
Expand Down
121 changes: 85 additions & 36 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,57 +8,71 @@

### purpose

`lhorizon` helps you find things in the Solar System. It is built around a thick Python wrapper for the
Jet Propulsion Laboratory (JPL) [Horizons](https://ssd.jpl.nasa.gov/?horizons) service. _Horizons_, provided by JPL's
Solar System Dynamics Group (SSD), is one of the only sources in the world that offers no-assembly-required
high-precision data on the relative positions and velocities of almost every known body in the Solar System.
`lhorizon` offers tools to query _Horizons_ for data, parse its responses into useful Python objects, and smoothly
incorporate them into bulk calculation and transformation workflows.
`lhorizon` helps you find things in the Solar System. It is built around a thick
Python wrapper for the Jet Propulsion Laboratory (JPL) [Horizons](https://ssd.jpl.nasa.gov/?horizons) service,
supplemented by some uses of the SPICE toolkit. _Horizons_, provided by JPL's
Solar System Dynamics Group (SSD), is one of the only sources in the world that
offers no-assembly-required high-precision data on the relative positions and
velocities of almost every known body in the Solar System. `lhorizon` offers
tools to query _Horizons_ for data, parse its responses into useful Python
objects, and smoothly incorporate them into bulk calculation and transformation
workflows.

If you would a quick overview of major package functionality,
[you can try these example Notebooks on Binder.](https://mybinder.org/v2/gh/MillionConcepts/lhorizon/main?filepath=examples)

### origin

`lhorizon` began as a fork of [astroquery.jplhorizons](https://github.com/astropy/astroquery/tree/master/astroquery/jplhorizons)
(originally written by Michael Mommert around 2016). We wrote it in order to circumvent a bug introduced to `jplhorizons` by
serverside changes at JPL that prevented it from correctly parsing queries involving target or observer locations given
in planetodetic coordinates, and more specifically to provide suppport for queries related to arbitrary locations on
the lunar surface. In the process, we extended it to implement a more efficient parser, add support for fast queries in
bulk, and remove the use of `astroquery` and `astropy` features (for both performance and API compatibility reasons).
At some point, we realized that a fast, standalone interface to Horizons might be useful to the community at large and
decided to polish it into a general-use package.
(originally written by Michael Mommert around 2016). We wrote it in order to
circumvent a bug (since fixed) introduced to `jplhorizons` by serverside changes at JPL that
prevented it from correctly parsing queries involving target or observer locations given
in planetodetic coordinates, and more specifically to provide suppport for queries
related to arbitrary locations on the lunar surface. In the process, we extended
it to implement a more efficient parser, add support for fast queries in bulk, and
remove the use of `astroquery` and `astropy` features (for both performance and
API compatibility reasons). At some point, we realized that a fast, standalone
interface to Horizons might be useful to the community at large and decided to
polish it into a general-use package.

### pronunciation

along the lines of "l'horizon" or "low-ree-zahn;" like "the horizon" in French, or the famous Palm Springs Desert
Modern hotel (an easy drive from Pasadena).
along the lines of "l'horizon" or "low-ree-zahn;" like "the horizon" in French,
or the famous Palm Springs Desert Modern hotel (an easy drive from Pasadena).

## installation

### automated

`lhorizon` is available on `conda-forge`, and we recommend installing it using the `conda` package manager:
`conda install -c conda-forge lhorizon`.
`lhorizon` is available on `conda-forge`, and we recommend installing it using
the `conda` package manager: `conda install -c conda-forge lhorizon`.

We do not test or officially support the use of non-`conda` environments for `lhorizon`, but it can also be installed from PyPi:
`pip install lhorizon`, or, if you'd like all the bells and whistles, `pip install lhorizon[target, examples, tests]`.
We do not test or officially support the use of non-`conda` environments for
`lhorizon`, but it can also be installed from PyPi: `pip install lhorizon`,
or, if you'd like all the bells and whistles, `pip install lhorizon[target, examples, tests]`.

### manual

If you'd like to install `lhorizon` by hand, we again recommend that you use `conda` to assemble a Python environment.
If you'd like to install `lhorizon` by hand, we again recommend that you use
`conda` to assemble a Python environment.

If you're already equipped with `conda`, you can create an environment (named "lhorizon") for this package by cloning this repository
and running: `conda env create -f environment.yml` from the repository root directory.
(You could instead add its dependencies to an existing environment by running `conda env update -n existing_env -f environment.yml`).
Then, if you'd like`lhorizon` installed as a site package in this environment, activate the environment and run `pip install -e .`.
If you're already equipped with `conda`, you can create an environment (named
"lhorizon") for this package by cloning this repository and running: `conda
env create -f environment.yml` from the repository root directory. (You could
instead add its dependencies to an existing environment by running `conda env
update -n existing_env -f environment.yml`). Then, if you'd like`lhorizon`
installed as a site package in this environment, activate the environment and run
`pip install -e .`.

If you're new to `conda` or Python environment management in general, please take a look at our easy
[conda installation guide](docs/conda_installation_guide.md).
If you're new to `conda` or Python environment management in general, please
take a look at our easy [conda installation guide](docs/conda_installation_guide.md).

### dependencies and requirements

`lhorizon` requires Python >= 3.9 (there are no plans to implement support for older Python versions).
`lhorizon` requires Python >= 3.11 (there are no plans to implement support
for older Python versions). A handful of feactures that rely on Horizons
capabilities only available through Telnet will not function on Python 3.13;
finding a replacement for deprecated PSL Telnet functionality is planned.

the following packages are required for usage / installation:
* `more-itertools`
Expand All @@ -67,20 +81,23 @@ the following packages are required for usage / installation:
* `requests`
* `pyerfa`

the following dependencies are optional and could potentially be omitted in restrictive install environments:
the following dependencies are optional and could potentially be omitted in
restrictive install environments:
* `jupyter` is only required to run examples
* `pytest`, `pytest-cov`, and `pytest-mock` are only required to run tests
* `spiceypy` and `sympy` are only required for `lhorizon.target` and related tests and examples

Some features of `lhorizon` can be used without internet connectivity, but much of the library requires you to be able
to dial out to the jpl.nasa.gov domain.
Some features of `lhorizon` can be used without internet connectivity, but much of
the library requires you to be able to dial out to the jpl.nasa.gov domain.

`lhorizon` should function in any OS supported by `conda`. The baseline system requirements are fairly light.
Counting dependencies and a base miniconda environment,`lhorizon` takes up about 2.6 GB of space. The respository itself
is ~75 MB, almost all of which could be pruned in a restrictive install environment that did not require full `git`
history and the included SPICE kernels. Many uses of `lhorizon` are not resource-intensive and will run comfortably on
a small machine like an AWS EC2 t3a.micro instance. Conversely, resource requirements can scale as high as you like if
you are planning to process extremely large sets of geometry data.
`lhorizon` should function in any OS supported by `conda`. The baseline system
requirements are fairly light. Counting dependencies and a base miniconda
environment,`lhorizon` takes up about 2.6 GB of space. The respository itself is
~75 MB, almost all of which could be pruned in a restrictive install environment
that did not require full `git` history and the included SPICE kernels. Many uses
of `lhorizon` are not resource-intensive and will run comfortably on a small machine
like an AWS EC2 t3a.micro instance. Conversely, resource requirements can scale as
high as you like if you are planning to process extremely large sets of geometry data.

## usage

Expand All @@ -99,6 +116,38 @@ running them can be found in [benchmarks/readme.md](benchmarks/readme.md)

## changelog

* 2024-09-26
* updates for ephemerides changes
* updates to CI
* fixed environment issue with SPICE kernel loading
* 2024-04-24:
* visibility flags now available in LHorizon.table()
* dependency updates
* 2024-02-26:
* assorted QoL improvements
* improved display of API errors
* handling for ass't OOB times including BCE dates
* updates for new ephemerides
* 2023-12-16:
* improved table design
* updates to test for new ephemerides versions
* fixed a number of edge cases
* 2023-07-12:
* time conversion improvements and optimizations
* updates to tests for new ephemerides
* various fixes for upstream changes
* optimizations for frame-of-reference transformations
* 2022-12-10:
* package now uses new Horizons API endpoint
* type hint compatibility fixes
* 2021-09-13:
* added assorted CI workflows
* improved interface for concatenated tables
* added nbviewer / binder hooks
* improved test coverage
* improved user-facing and in-code documentation
* fixed some edge cases in targeter
* added functionality to retrieve observer quantity codes
* 2021-06-21: Full 1.0.0 release. Extensive changes from older versions:
* completes and rationalizes interface
* concatenates and standardizes target submodule
Expand Down

0 comments on commit bbf8a47

Please sign in to comment.