Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v0.1.3 #160

Merged
merged 96 commits into from
Mar 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
434a513
Added check of constraint function
gomezzz Feb 1, 2023
7b7aae3
Moved get_constellation function for use in multiple examples
gomezzz Feb 1, 2023
980c063
Added some utility functions for MPI
gomezzz Feb 1, 2023
2f3ba77
Small bugfix
gomezzz Feb 1, 2023
f2de912
Added MPI example
gomezzz Feb 1, 2023
10915b7
flaking
gomezzz Feb 1, 2023
d8bfff8
Updated readme to mention examples folder explicitly
gomezzz Feb 1, 2023
a245274
Updated prints to be more verbose
gomezzz Feb 1, 2023
ba7c85c
Docstring fix
gomezzz Feb 1, 2023
2e80fd3
better docs
gomezzz Feb 1, 2023
86059a9
hotfix to get pypi to comply
gomezzz Feb 3, 2023
3d82389
Merge pull request #125 from aidotse/pypi_hotfix
gomezzz Feb 6, 2023
b97c5ca
Apply suggestions from code review
gomezzz Feb 6, 2023
98977c9
Fixed whitespace
gomezzz Feb 6, 2023
89983ed
Applied suggestions from code review
gomezzz Feb 6, 2023
c73ef5d
Small fix to plot ground stations
gomezzz Feb 7, 2023
6c24c85
Fixed temperature formatting
gomezzz Feb 7, 2023
960fa26
Some more small fixes
gomezzz Feb 7, 2023
4372346
Merge pull request #121 from aidotse/MPI-Example
gomezzz Feb 13, 2023
067c292
Merge pull request #126 from aidotse/hotfix-ground-station-plotting
gomezzz Feb 13, 2023
9ad8171
Skipping LOS betweens ground stations
gomezzz Feb 13, 2023
da62347
fixed typo in function name
gomezzz Feb 13, 2023
76fd262
Fix broken learning example
johanos1 Feb 14, 2023
e84baa0
Added Dockerfile
Feb 14, 2023
1be1194
Create docker-image.yml
GabrieleMeoni Feb 14, 2023
ca1a1aa
Merge pull request #137 from aidotse/GabrieleMeoni-patch-1
GabrieleMeoni Feb 14, 2023
c11a215
Update docker-image.yml
GabrieleMeoni Feb 14, 2023
0a56503
Small doc update
gomezzz Feb 15, 2023
5006f0c
Update README.md
gomezzz Feb 15, 2023
be9f24d
Update Dockerfile.
Feb 16, 2023
30e7796
Update docker-image.yml
GabrieleMeoni Feb 16, 2023
7968d98
Update docker-image.yml
GabrieleMeoni Feb 16, 2023
730958e
Create docker-nightly-image.yml
GabrieleMeoni Feb 16, 2023
97040dc
Merge pull request #142 from aidotse/GabrieleMeoni-patch-2
GabrieleMeoni Feb 16, 2023
081a417
Update README.md
GabrieleMeoni Feb 17, 2023
0be75e5
Update README.md
GabrieleMeoni Feb 17, 2023
3c03020
Added updated Dockerfile.
Feb 17, 2023
fbaf2dc
Adding workflow_dispatch to workflows.
Feb 17, 2023
eb94f7a
Exposed simulation and current time to user
gomezzz Feb 17, 2023
10fe4cf
Updated readme
gomezzz Feb 17, 2023
1cfde56
hed updated workflows.
Feb 17, 2023
6be124e
Added PR.
Feb 17, 2023
ffaa7a9
Try
Feb 17, 2023
50197ba
Updating flows.
Feb 18, 2023
23ae24e
Merge pull request #135 from aidotse/fix_learning_example
johanos1 Feb 18, 2023
e0e2434
Fixing links in the README.
Feb 20, 2023
6582a01
Fix broken visualization example
johanos1 Feb 20, 2023
643ff17
Fixed visualization
johanos1 Feb 20, 2023
3c433ac
linting
johanos1 Feb 20, 2023
b11d0cb
Delete example_sentinel2.py
johanos1 Feb 20, 2023
b3a15be
Merge pull request #144 from aidotse/fix_visualization_example
johanos1 Feb 20, 2023
cf64ca0
Merge branch 'main' into Provide-access-to-local-and-simulation-time-…
gomezzz Feb 20, 2023
6bad945
Merge pull request #143 from aidotse/Provide-access-to-local-and-simu…
gomezzz Feb 20, 2023
c340ea3
Merge pull request #132 from aidotse/typo-fix
gomezzz Feb 20, 2023
f2e8653
Merge pull request #131 from aidotse/hotfix-vis
gomezzz Feb 20, 2023
da8f6bb
updated readme with paper reference.
johanos1 Feb 20, 2023
b161258
Citation file added
johanos1 Feb 20, 2023
fab781f
Updated citation
johanos1 Feb 20, 2023
9b9cb14
Small change to citation
johanos1 Feb 20, 2023
32faa0d
changes
johanos1 Feb 20, 2023
8a575df
new attempt at cff file
johanos1 Feb 20, 2023
f969d0e
Fix indents
johanos1 Feb 20, 2023
22002ab
Merge branch 'main' into create_docker_image
Feb 21, 2023
213d4d9
Merge pull request #138 from aidotse/create_docker_image
GabrieleMeoni Feb 21, 2023
badebf3
Merge pull request #146 from aidotse/paper-reference
johanos1 Feb 21, 2023
87276b0
Added temprature_in_C
gomezzz Feb 23, 2023
70f4edb
Added cfg check code and autocheck
gomezzz Feb 24, 2023
256ded6
Fixed default cfg
gomezzz Feb 24, 2023
1e4f34c
Fixed tests and notebooks
gomezzz Feb 24, 2023
0cf8fbe
Added test for default cfg
gomezzz Feb 24, 2023
471056d
Flaking
gomezzz Feb 24, 2023
b88aa9d
Added option to set initial epoch
gomezzz Feb 24, 2023
8784169
Merge branch 'check_cfg' into setting-initial-epoch
gomezzz Feb 24, 2023
06fe8b8
Flaking
gomezzz Feb 24, 2023
ca2d72c
Merge pull request #148 from aidotse/check_cfg
gomezzz Feb 27, 2023
a8126c7
Merge pull request #147 from aidotse/temp_in_celsiu
gomezzz Feb 27, 2023
20d695c
Added cfg parameter for los blocking sphere
gomezzz Feb 27, 2023
a1de84e
Added central body to paseos instance and refactored in actor
gomezzz Feb 27, 2023
348da21
Fixed tests
gomezzz Feb 27, 2023
91d9aa6
Removing unused imports
gomezzz Feb 27, 2023
229247a
Changed default LOS sphere size
gomezzz Feb 27, 2023
58b03da
Applying suggestions from review
gomezzz Feb 27, 2023
308db4a
small fix
gomezzz Feb 27, 2023
02f62f8
flaking
gomezzz Feb 27, 2023
dd62a90
Merge pull request #152 from aidotse/improve-LOS-customizability
gomezzz Feb 28, 2023
e51aaed
Add direct link to paper to readme
gomezzz Mar 1, 2023
24b671c
Fixed bug
gomezzz Mar 1, 2023
982226b
Fixed tests badge
gomezzz Mar 1, 2023
f93ba2a
Merge pull request #154 from aidotse/Add-direct-link-to-paper-to-readme
gomezzz Mar 1, 2023
f5b945f
Merge pull request #155 from aidotse/hotfix-CI-bug
gomezzz Mar 1, 2023
f50bcfd
Increased allowed ranges for tests to allow passing tests on slower d…
gomezzz Mar 2, 2023
98ecefb
Add direct link to paper to readme
gomezzz Mar 1, 2023
71efb81
Fixed bug
gomezzz Mar 1, 2023
fbb4c82
Merge pull request #150 from aidotse/setting-initial-epoch
gomezzz Mar 3, 2023
5d84682
Merge pull request #156 from aidotse/fix-test-badge
gomezzz Mar 3, 2023
3156aa9
Merge pull request #158 from aidotse/OS-X-CI-Bugs
gomezzz Mar 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/deploy_to_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
python-version: 3.8
- name: Install dependencies
run: |
export SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True
pip install --upgrade pip
pip install setuptools wheel twine
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy_to_test_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
python-version: 3.8
- name: Install dependencies
run: |
export SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True
pip install --upgrade pip
pip install setuptools wheel twine
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.

name: Build and publish a Docker image for PASEOS

on:
push:
branches: [ "release" ]

workflow_dispatch:

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Build the Docker image
uses: actions/checkout@v3

- name: Log in to Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: gabrielemeoni/paseos

- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
44 changes: 44 additions & 0 deletions .github/workflows/docker-nightly-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.

name: Build and publish a Docker image for PASEOS-nightly

on:
push:
branches: [ "main" ]

workflow_dispatch:

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Build the Docker image
uses: actions/checkout@v3

- name: Log in to Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: gabrielemeoni/paseos-nightly

- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
57 changes: 57 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
title: "PAseos Simulates the Environment for Operating multiple Spacecraft"
authors:
- given-names: Pablo
family-names: Gómez
email: pablo.gomez@esa.int
affiliation: >-
Advanced Concepts Team, European Space Agency,
Noordwijk, The Netherlands
orcid: "https://orcid.org/0000-0002-5631-8240"
- given-names: Johan
family-names: Östman
affiliation: >-
AI Sweden, Gothenburg, Sweden
orcid: "https://orcid.org/0000-0003-4138-0508"
- given-names: Vinutha
family-names: Magal Shreenath
affiliation: >-
AI Sweden, Gothenburg, Sweden
- given-names: Gabriele
family-names: Meoni
affiliation: >-
Phi-Lab, European Space Agency, Rome, Italy
orcid: "http://orcid.org/0000-0001-9311-6392"
repository-code: "https://github.com/aidotse/PASEOS"
url: "https://paseos.readthedocs.io/en/latest/"
repository-artifact: "https://pypi.org/project/paseos/"
license: GPL-3.0
preferred-citation:
type: article
authors:
- given-names: Pablo
family-names: Gómez
email: pablo.gomez@esa.int
affiliation: >-
Advanced Concepts Team, European Space Agency,
Noordwijk, The Netherlands
orcid: "https://orcid.org/0000-0002-5631-8240"
- given-names: Johan
family-names: Östman
affiliation: >-
AI Sweden, Gothenburg, Sweden
orcid: "https://orcid.org/0000-0003-4138-0508"
- given-names: Vinutha
family-names: Magal Shreenath
affiliation: >-
AI Sweden, Gothenburg, Sweden
- given-names: Gabriele
family-names: Meoni
affiliation: >-
Phi-Lab, European Space Agency, Rome, Italy
orcid: "http://orcid.org/0000-0001-9311-6392"
doi: "10.48550/ARXIV.2302.02659"
journal: "ArXiV"
title: "PAseos Simulates the Environment for Operating multiple Spacecraft"
year: 2023
50 changes: 50 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
FROM ubuntu:22.10
ARG CONDA_PYTHON_VERSION=3
ARG USERNAME=user
ARG HOME=/home/user
ARG CONDA_DIR=$HOME/conda
ARG USERID=1000


# Create the user
RUN useradd --create-home -s /bin/bash --no-user-group -u $USERID $USERNAME

# Instal basic utilities
RUN apt-get update && \
apt-get install -y --no-install-recommends git wget unzip bzip2 sudo build-essential ca-certificates && \
apt-get install libsm6 libxext6 -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

## Install miniconda
ENV PATH $CONDA_DIR/bin:$PATH
RUN wget --quiet https://repo.continuum.io/miniconda/Miniconda$CONDA_PYTHON_VERSION-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && \
echo 'export PATH=$CONDA_DIR/bin:$PATH' > /etc/profile.d/conda.sh && \
/bin/bash /tmp/miniconda.sh -b -p $CONDA_DIR && \
rm -rf /tmp/*


RUN chown $USERNAME $HOME -R && \
adduser $USERNAME sudo && \
echo "$USERNAME ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers

USER $USERNAME
WORKDIR /home/$USERNAME/paseos

# copy all files.
COPY . $HOME/paseos

# Install mamba
RUN conda install -y mamba -c conda-forge
RUN mamba env update --file environment.yml --name base

# For interactive shell
SHELL ["/bin/bash", "-c"]

RUN echo ". activate base" >> $HOME/.bashrc && \
chmod u+x $HOME/.bashrc && \
$HOME/.bashrc && \
pip install -e . --no-dependencies --ignore-requires-python


ENV PATH $HOME/conda/envs/env/bin:$PATH
49 changes: 47 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## PASEOS - PAseos Simulates the Environment for Operating multiple Spacecraft

![Read the Docs (version)](https://img.shields.io/readthedocs/paseos/latest?style=flat-square) ![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/aidotse/PASEOS/.github/workflows/run_tests.yml?branch=main?style=flat-square) ![GitHub last commit](https://img.shields.io/github/last-commit/aidotse/PASEOS?style=flat-square)
![Read the Docs (version)](https://img.shields.io/readthedocs/paseos/latest?style=flat-square) [![Tests](https://github.com/aidotse/paseos/actions/workflows/run_tests.yml/badge.svg)](https://github.com/aidotse/paseos/actions/workflows/run_tests.yml) ![GitHub last commit](https://img.shields.io/github/last-commit/aidotse/PASEOS?style=flat-square)
![GitHub](https://img.shields.io/github/license/aidotse/PASEOS?style=flat-square)
![GitHub contributors](https://img.shields.io/github/contributors/aidotse/PASEOS?style=flat-square)
![GitHub issues](https://img.shields.io/github/issues/aidotse/PASEOS?style=flat-square) ![GitHub pull requests](https://img.shields.io/github/issues-pr/aidotse/PASEOS?style=flat-square)
Expand All @@ -13,6 +13,8 @@
<a href="https://github.com/aidotse/PASEOS/issues">Report Bug</a>
·
<a href="https://github.com/aidotse/PASEOS/issues">Request Feature</a>
·
<a href="https://arxiv.org/abs/2302.02659">Read the Paper</a>
</p>

Disclaimer: This project is currently under development. Use at your own risk.
Expand Down Expand Up @@ -130,11 +132,26 @@ Alternatively, you can install PASEOS by using [pip](https://www.pypy.org/) as f
cd PASEOS
pip install -e .
```
### Using Docker
Two [Docker](https://www.docker.com/) images are available:
* [paseos](https://hub.docker.com/r/gabrielemeoni/paseos): corresponding to the latest release.
* [paseos-nightly](https://hub.docker.com/r/gabrielemeoni/paseos-nightly): based on the latest commit on the branch `main`.

If you want to install PASEOS using Docker, access the desired repository and follow the provided instructions.

## Examples

The next examples will introduce you to the use of PASEOS.

Comprehensive, self-contained examples can also be found in the `examples` folder where you can find an example on:

* Modelling and analysing a large constellation with PASEOS
* Modelling distributed learning on heterogeneous data in a constellation
* Using PASEOS with MPI to run PASEOS on supercomputers
* Using PASEOS to model the task of onboard satellite volcanic eruptions detection

The following are small snippets on specific topics.

### Actors

#### Create a PASEOS actor
Expand Down Expand Up @@ -277,6 +294,13 @@ Alternatively to the default `paseos.PowerDeviceType.SolarPanel` you can also us

Note that at the moment only one power device is supported. Adding another will override the existing one.

You can check the battery's state of charge and level in Ws with:

```py
print(my_actor.state_of_charge)
print(my_actor.battery_level_in_Ws)
```

#### Thermal Modelling

To model thermal constraints on spacecraft we utilize a model inspired by the one-node model described in [Martínez - Spacecraft Thermal Modelling and Test](http://imartinez.etsiae.upm.es/~isidoro/tc3/Spacecraft%20Thermal%20Modelling%20and%20Testing.pdf). Thus, we model the change in temperature as
Expand Down Expand Up @@ -393,7 +417,9 @@ For each actor you wish to model, you can create a PASEOS instance. Running mult

#### Using the cfg

When you instantiate PASEOS as shown in [Initializing PASEOS](#initializing-paseos), PASEOS instance is created by using the default configuration. However, sometimes it is useful to use a custom configuration. <br> The next code snippet will show how to start the PASEOS simulation with a time different from `pk.epoch(0)` by loading a custom configuration.
When you instantiate PASEOS as shown in [Initializing PASEOS](#initializing-paseos), a PASEOS instance is created by using the default configuration. However, sometimes it is useful to use a custom configuration.

The next code snippet will show how to start the PASEOS simulation with a time different from `pk.epoch(0)` (MJD2000) by loading a custom configuration.

```py
import pykep as pk
Expand Down Expand Up @@ -430,6 +456,13 @@ cfg.sim.start_time=today.mjd2000 * pk.DAY2SEC
sim = paseos.init_sim(local_actor)
```

You can access the current simulation time (seconds since the start) and the current epoch like this:

```py
time_since_start_in_s = sim.simulation_time
current_epoch = sim.local_time
```

#### Faster than real-time execution

In some cases, you may be interested to simulate your spacecraft operating for an extended period. By default, PASEOS operates in real-time, thus this would take a lot of time. However, you can increase the rate of time passing (i.e. the spacecraft moving, power being charged / consumed etc.) using the `time_multiplier` parameter. Set it as follows when initializing PASEOS.
Expand Down Expand Up @@ -890,3 +923,15 @@ Created by $\Phi$[-lab@Sweden](https://www.ai.se/en/data-factory/f-lab-sweden).
- Gabriele Meoni - gabriele.meoni at esa.int, gabriele.meoni at ai.se
- Johan Östman - johan.ostman at ai.se
- Vinutha Magal Shreenath - vinutha at ai.se

## Reference

If you have used `PASEOS`, please cite the following paper:
```
@article{gomez23paseos,
author = {Gómez, Pablo and Östman, Johan and Shreenath, Vinutha Magal and Meoni, Gabriele},
title = {{PA}seos {S}imulates the {E}nvironment for {O}perating multiple {S}pacecraft},
journal = {arXiv:2302.02659 [cs.DC]},
year = {2023},
}
```
Loading