Skip to content

Commit 5750d7d

Browse files
authored
Merge pull request #5 from kesslerlib/probprog_model
probabilistic generative model of conjunctions
2 parents d445b82 + f0126e7 commit 5750d7d

31 files changed

Lines changed: 2810 additions & 534 deletions

.github/workflows/build.yml

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
name: build
22

3+
env:
4+
# Use the same ssh-agent socket value across all jobs
5+
# Useful when a GH action is using SSH behind-the-scenes
6+
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
7+
38
on:
49
push:
510
branches: [ master ]
@@ -12,21 +17,36 @@ jobs:
1217
runs-on: ubuntu-latest
1318

1419
steps:
15-
- uses: actions/checkout@master
16-
- name: Set up Python 3.7
20+
- name: Checkout repository
21+
uses: actions/checkout@v3
22+
- name: Set up Python 3.9
1723
uses: actions/setup-python@master
1824
with:
19-
python-version: 3.7
25+
python-version: 3.9
2026
- name: Install
2127
run: |
2228
python -m pip install --upgrade pip
23-
pip install torch==1.7.1+cpu torchvision==0.8.2+cpu torchaudio==0.7.2 -f https://download.pytorch.org/whl/torch_stable.html
29+
pip install matplotlib
30+
pip install jupyter
31+
pip install numpy
32+
pip install torch==1.11.0+cpu torchvision==0.12.0+cpu torchaudio==0.11.0+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html
2433
pip install .[dev]
34+
pip install sphinx
35+
pip install sphinx-book-theme
36+
pip install myst-nb
37+
cd docs
38+
make html linkcheck
2539
- name: Test
2640
run: |
27-
sh tests/run_basics.sh
41+
coverage run -m pytest
42+
coverage xml
2843
- name: Codecov
29-
uses: codecov/codecov-action@v2
44+
uses: codecov/codecov-action@v3
3045
with:
3146
token: ${{ secrets.CODECOV_TOKEN }}
3247
verbose: true
48+
- name: Upload to github pages 🚀
49+
if: ${{ github.event_name == 'push' }}
50+
uses: JamesIves/github-pages-deploy-action@v4
51+
with:
52+
folder: docs/_build/html # The folder the action should deploy.

docs/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33

44
# You can set these variables from the command line, and also
55
# from the environment for the first two.
6-
SPHINXOPTS ?=
6+
SPHINXOPTS ?= -WT --keep-going
77
SPHINXBUILD ?= sphinx-build
8-
SOURCEDIR = source
9-
BUILDDIR = build
8+
SOURCEDIR = .
9+
BUILDDIR = _build
1010

1111
# Put it first so that "make" without argument is like "make help".
1212
help:
File renamed without changes.

docs/api.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
.. _api:
2+
3+
API
4+
#########
5+
6+
Kessler API
7+
8+
.. toctree::
9+
:maxdepth: 2
10+
:caption: API Documentation
11+
12+
_autosummary/kessler.cdm
13+
_autosummary/kessler.data
14+
_autosummary/kessler.event
15+
_autosummary/kessler.model
16+
_autosummary/kessler.nn
17+
_autosummary/kessler.observation_model
18+
_autosummary/kessler.plot
19+
_autosummary/kessler.util
Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,11 @@
22
"cells": [
33
{
44
"cell_type": "markdown",
5+
"id": "b8ca3794",
56
"metadata": {},
67
"source": [
7-
"# Capabilities"
8-
]
9-
},
10-
{
11-
"cell_type": "markdown",
12-
"metadata": {},
13-
"source": [
14-
"Overview\n",
8+
"# Capabilities\n",
9+
"\n",
1510
"Kessler is an open-source Python package that currently includes Bayesian ML and probabilistic programming components. The library currently provides the following key capabiolities:\n",
1611
"\n",
1712
"\n",
@@ -28,7 +23,7 @@
2823
],
2924
"metadata": {
3025
"kernelspec": {
31-
"display_name": "Python 3",
26+
"display_name": "Python 3 (ipykernel)",
3227
"language": "python",
3328
"name": "python3"
3429
},
@@ -42,9 +37,9 @@
4237
"name": "python",
4338
"nbconvert_exporter": "python",
4439
"pygments_lexer": "ipython3",
45-
"version": "3.7.9"
40+
"version": "3.8.15"
4641
}
4742
},
4843
"nbformat": 4,
49-
"nbformat_minor": 4
44+
"nbformat_minor": 5
5045
}

docs/conf.py

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
5+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6+
7+
# -- Path setup --------------------------------------------------------------
8+
9+
# If extensions (or modules to document with autodoc) are in another directory,
10+
# add these directories to sys.path here. If the directory is relative to the
11+
# documentation root, use os.path.abspath to make it absolute, like shown here.
12+
#
13+
project = 'Kessler'
14+
copyright = "2020, 2021, 2022, 2023, 2024, 2025, Kessler contributors"
15+
author = 'Giacomo Acciarini, Atılım Güneş Baydin, Francesco Pinto'
16+
17+
18+
# The full version, including alpha/beta/rc tags
19+
import kessler
20+
import sys
21+
import os
22+
sys.path.insert(0, os.path.abspath('../')) # Add the root directory of your repo
23+
24+
release = kessler.__version__
25+
26+
27+
28+
# -- General configuration ---------------------------------------------------
29+
30+
# Add any Sphinx extension module names here, as strings. They can be
31+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
32+
# ones.
33+
extensions = ["myst_nb", "sphinx.ext.autodoc", "sphinx.ext.doctest", "sphinx.ext.intersphinx", "sphinx.ext.autosummary","sphinx.ext.napoleon"]
34+
35+
36+
# build the templated autosummary files
37+
autosummary_generate = True
38+
autosummary_imported_members = False
39+
napoleon_google_docstring = True
40+
numpydoc_show_class_members = False
41+
panels_add_bootstrap_css = False
42+
43+
autosectionlabel_prefix_document = True
44+
45+
# katex options
46+
#
47+
#
48+
katex_prerender = True
49+
50+
napoleon_use_ivar = True
51+
52+
# Add any paths that contain templates here, relative to this directory.
53+
templates_path = ["_templates"]
54+
55+
intersphinx_mapping = {
56+
"numpy": ("https://numpy.org/doc/stable/", None),
57+
"python": ("https://docs.python.org/3", None),
58+
"matplotlib": ("https://matplotlib.org/stable/", None),
59+
}
60+
61+
62+
autoclass_content = 'both'
63+
64+
# List of patterns, relative to source directory, that match files and
65+
# directories to ignore when looking for source files.
66+
# This pattern also affects html_static_path and html_extra_path.
67+
exclude_patterns = ["_build", ".DS_Store",'jupyter_execute/**/*.ipynb','jupyter_execute/*.ipynb']
68+
69+
70+
# -- Options for HTML output -------------------------------------------------
71+
72+
# The theme to use for HTML and HTML Help pages. See the documentation for
73+
# a list of builtin themes.
74+
#
75+
html_theme = "sphinx_book_theme"
76+
77+
# Add any paths that contain custom static files (such as style sheets) here,
78+
# relative to this directory. They are copied after the builtin static files,
79+
# so a file named "default.css" will overwrite the builtin "default.css".
80+
html_static_path = ["_static"]
81+
82+
html_logo = "_static/kessler_logo.png"
83+
84+
html_theme_options = {
85+
"repository_url": "https://github.com/kesslerlib/kessler/",
86+
"repository_branch": "master",
87+
"path_to_docs": "docs",
88+
"use_repository_button": True,
89+
"use_issues_button": True,
90+
"launch_buttons": {
91+
"binderhub_url": "https://mybinder.org",
92+
"notebook_interface": "jupyterlab"
93+
},
94+
"navigation_with_keys": False,
95+
}
96+
97+
nb_execution_mode = "force"
98+
99+
nb_execution_excludepatterns = ['basics.ipynb','cdms_analysis_and_plotting.ipynb','LSTM_training.ipynb']
100+
#autosummary_ignore_module = ['']
101+
102+
latex_engine = "xelatex"
103+
104+
myst_enable_extensions = [
105+
"amsmath",
106+
"colon_fence",
107+
"deflist",
108+
"dollarmath",
109+
"html_image",
110+
]
Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,26 @@
22
"cells": [
33
{
44
"cell_type": "markdown",
5-
"id": "stainless-bracket",
5+
"id": "96b808b8",
66
"metadata": {},
77
"source": [
8-
"# Credits\n"
8+
"# Credits\n",
9+
"\n",
10+
"Kessler was initially developed by the Constellations team at the [Frontier Development Lab](https://frontierdevelopmentlab.org/) (FDL) Europe 2020, a public-private partnership between the European Space Agency (ESA), Trillium Technologies, and University of Oxford.\n",
11+
"\n",
12+
"The main developers are: Giacomo Acciarini ( giacomo.acciarini@gmail.com ), Francesco Pinto, Atılım Güneş Baydin.\n"
913
]
1014
},
1115
{
1216
"cell_type": "markdown",
13-
"id": "monetary-albuquerque",
17+
"id": "e36830ab",
1418
"metadata": {},
15-
"source": [
16-
"Kessler was initially developed by the Constellations team at the [Frontier Development Lab](https://frontierdevelopmentlab.org/) (FDL) Europe 2020, a public-private partnership between the European Space Agency (ESA), Trillium Technologies, and University of Oxford.\n",
17-
"\n",
18-
"\n",
19-
"Constellations team members: Giacomo Acciarini (University of Oxford), Francesco Pinto (University of Oxford), Sascha Metz (TU Darmstadt), Sarah Boufelja (IBM), Sylvester Kaczmarek (Imperial College London), Klaus Merz (European Space Agency), José A. Martinez-Heras (European Space Agency), Francesca Letizia (European Space Agency), Christopher Bridges (University of Surrey), Atılım Güneş Baydin (University of Oxford).\n",
20-
"\n",
21-
"The main developers are: Giacomo Acciarini ( giacomo.acciarini@gmail.com ), Francesco Pinto ( francesco1.pinto@gmail.com ), Atılım Güneş Baydin ( gunes@robots.ox.ac.uk ).\n",
22-
"\n"
23-
]
19+
"source": []
2420
}
2521
],
2622
"metadata": {
2723
"kernelspec": {
28-
"display_name": "Python 3",
24+
"display_name": "Python 3 (ipykernel)",
2925
"language": "python",
3026
"name": "python3"
3127
},
@@ -39,7 +35,7 @@
3935
"name": "python",
4036
"nbconvert_exporter": "python",
4137
"pygments_lexer": "ipython3",
42-
"version": "3.7.9"
38+
"version": "3.8.15"
4339
}
4440
},
4541
"nbformat": 4,
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,37 @@ Kessler is a Python package for machine learning applied to spacecraft collision
55

66
The package comprises a Deep Learning module, where a Bayesian recurrent neural network can be trained with existing collections of CDM data and then deployed in order to predict the contents of future CDMs received up to now, with associated uncertainty estimates about all predictions.
77

8-
Kessler also includes a novel generative model of conjunction events and CDM sequences implemented using probabilistic programming and simulating the CDM generation process, which we will soon release to the public: stay tuned!
8+
Kessler also includes a novel generative model of conjunction events and CDM sequences implemented using probabilistic programming and simulating the CDM generation process.
99

10-
The documentation is currently a work in progress.
10+
For more details on the model and results, check out our publications listed in the README of the repository.
11+
12+
The authors are [Giacomo Acciarini](https://www.esa.int/gsp/ACT/team/giacomo_acciarini/), [Atılım Güneş Baydin](https://gbaydin.github.io/), [Dario Izzo](https://www.esa.int/gsp/ACT/team/dario_izzo/). The main developer is Giacomo Acciarini (giacomo.acciarini@gmail.com).
1113

12-
.. toctree::
1314
:maxdepth: 1
1415
:caption: Getting started
1516

16-
install
17+
install.rst
1718
capabilities
1819
credits
1920

2021

21-
.. toctree::
2222
:maxdepth: 1
2323
:caption: Tutorials
2424

25-
tutorials/basics
26-
tutorials/cdms_analysis_and_plotting
27-
tutorials/LSTM_training
28-
tutorials/probabilistic_programming_module
25+
notebooks/basics
26+
notebooks/cdms_analysis_and_plotting
27+
notebooks/LSTM_training
28+
notebooks/probabilistic_programming_module
2929

3030

31-
.. toctree::
3231
:maxdepth: 1
3332
:caption: API documentation
3433

35-
kessler package <_autosummary/kessler>
34+
api
3635

3736
Indices and tables
3837
==================
3938

4039
* :ref:`genindex`
4140
* :ref:`modindex`
41+

docs/install.rst

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
Installation
2+
============
3+
4+
.. _installation_deps:
5+
6+
7+
Packages
8+
--------
9+
10+
11+
pip
12+
^^^
13+
14+
`kessler` is available on [Pypi](https://pypi.org/project/kessler/). You can install it via `pip` as:
15+
16+
.. code-block:: console
17+
18+
$ pip install kessler
19+
20+
Installation from source
21+
------------------------
22+
23+
24+
Using ``git``:
25+
26+
.. code-block:: console
27+
28+
$ git clone https://github.com/kesslerlib/kessler
29+
$ cd kessler
30+
$ pip install -e .
31+
32+
We follow the usual PR-based development workflow, thus kessler's ``master``
33+
branch is normally kept in a working state.
34+
35+
Verifying the installation
36+
--------------------------
37+
38+
You can verify that dSGP4 was successfully compiled and
39+
installed by running the tests. To do so, you must first install the
40+
optional dependencies.
41+
42+
.. code-block:: bash
43+
44+
$ pytest
45+
46+
If this command executes without any error, then
47+
your kessler installation is ready for use.
48+
49+
Getting help
50+
------------
51+
52+
If you run into troubles installing kessler, please do not hesitate
53+
to contact us by opening an issue report on `github <https://github.com/kesslerlib/kessler/issues>`__.

0 commit comments

Comments
 (0)