Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
# Conflicts:
#	.stickler.yml
  • Loading branch information
Adam.Dybbroe committed Apr 28, 2024
2 parents bf89371 + 0a9c19a commit 4fb9ff6
Show file tree
Hide file tree
Showing 37 changed files with 2,613 additions and 2,619 deletions.
2 changes: 2 additions & 0 deletions .bandit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[bandit]
exclude: trollsched/version.py,versioneer.py,trollsched/tests
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
- [ ] Closes #xxxx <!-- remove if there is no corresponding issue, which should only be the case for minor changes -->
- [ ] Tests added <!-- for all bug fixes or enhancements -->
- [ ] Tests passed <!-- for all non-documentation changes) -->
- [ ] Passes ``git diff origin/master **/*py | flake8 --diff`` <!-- remove if you did not edit any Python files -->
- [ ] Passes ``git diff origin/main **/*py | flake8 --diff`` <!-- remove if you did not edit any Python files -->
- [ ] Fully documented <!-- remove if this change should not be visible to users, e.g., if it is an internal clean-up, or if this is part of a larger project that will be documented later -->
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "github-actions" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
35 changes: 35 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Run tests

on:
- push
- pull_request

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: ["3.10", "3.11", "3.12"]
experimental: [false]
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install -U pytest pytest-cov numpy pyresample pyorbital six pyyaml defusedxml
- name: Install pytroll-collectors
run: |
pip install --no-deps -e .
- name: Run tests
run: |
pytest --cov=trollsched trollsched/tests --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
env_vars: PYTHON_VERSION
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,9 @@ nosetests.xml
.mr.developer.cfg
.project
.pydevproject

tmp
.idea
.vscode
.ropeproject
*~
20 changes: 20 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
exclude: '^$'
fail_fast: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
args: [--unsafe]
- repo: https://github.com/charliermarsh/ruff-pre-commit
# Ruff version.
rev: 'v0.0.247'
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
ci:
# To trigger manually, comment on a pull request with "pre-commit.ci autofix"
autofix_prs: false
skip: [bandit]
8 changes: 8 additions & 0 deletions .stickler.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
linters:
flake8:
python: 3
config: setup.cfg
fixer: true
fixers:
enable: true

files:
ignore:
- 'docs/Makefile'
- 'docs/make.bat'
50 changes: 0 additions & 50 deletions .travis.yml

This file was deleted.

76 changes: 76 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,79 @@
###############################################################################
## Version 0.7.1 (2024/02/16)


### Pull Requests Merged

#### Features added

* [PR 85](https://github.com/pytroll/pytroll-schedule/pull/85) - Update CI Python versions
* [PR 84](https://github.com/pytroll/pytroll-schedule/pull/84) - Update versioneer

In this release 2 pull requests were closed.

## Version 0.7.0 (2023/06/21)

### Issues Closed

* [Issue 74](https://github.com/pytroll/pytroll-schedule/issues/74) - numpy 1.24.0 np.bool removed needs cleanup ([PR 72](https://github.com/pytroll/pytroll-schedule/pull/72) by [@mraspaud](https://github.com/mraspaud))
* [Issue 68](https://github.com/pytroll/pytroll-schedule/issues/68) - Test failure with PyResample 1.23 ([PR 72](https://github.com/pytroll/pytroll-schedule/pull/72) by [@mraspaud](https://github.com/mraspaud))

In this release 2 issues were closed.

### Pull Requests Merged

#### Features added

* [PR 72](https://github.com/pytroll/pytroll-schedule/pull/72) - Start refactoring pytroll schedule ([74](https://github.com/pytroll/pytroll-schedule/issues/74), [68](https://github.com/pytroll/pytroll-schedule/issues/68))
* [PR 71](https://github.com/pytroll/pytroll-schedule/pull/71) - Create dependabot.yml

In this release 2 pull requests were closed.


## Version 0.6.0 (2021/12/09)

### Issues Closed

* [Issue 62](https://github.com/pytroll/pytroll-schedule/issues/62) - Remove remnants of Python 2 support ([PR 67](https://github.com/pytroll/pytroll-schedule/pull/67) by [@pnuu](https://github.com/pnuu))
* [Issue 60](https://github.com/pytroll/pytroll-schedule/issues/60) - Deprecated import of Mapping
* [Issue 59](https://github.com/pytroll/pytroll-schedule/issues/59) - Failures in Schedule tests ([PR 61](https://github.com/pytroll/pytroll-schedule/pull/61) by [@pnuu](https://github.com/pnuu))
* [Issue 54](https://github.com/pytroll/pytroll-schedule/issues/54) - Deprecated use of abstract base classes ([PR 57](https://github.com/pytroll/pytroll-schedule/pull/57) by [@pnuu](https://github.com/pnuu))
* [Issue 53](https://github.com/pytroll/pytroll-schedule/issues/53) - The unittests are not run automatically ([PR 55](https://github.com/pytroll/pytroll-schedule/pull/55) by [@pnuu](https://github.com/pnuu))
* [Issue 52](https://github.com/pytroll/pytroll-schedule/issues/52) - Boundary calculations are broken ([PR 56](https://github.com/pytroll/pytroll-schedule/pull/56) by [@pnuu](https://github.com/pnuu))
* [Issue 49](https://github.com/pytroll/pytroll-schedule/issues/49) - Three unit tests failed.

In this release 7 issues were closed.

### Pull Requests Merged

#### Bugs fixed

* [PR 61](https://github.com/pytroll/pytroll-schedule/pull/61) - Allow `mersi-2` as instrument name ([59](https://github.com/pytroll/pytroll-schedule/issues/59))
* [PR 56](https://github.com/pytroll/pytroll-schedule/pull/56) - Remove a bug introduced in PR38 ([52](https://github.com/pytroll/pytroll-schedule/issues/52))
* [PR 51](https://github.com/pytroll/pytroll-schedule/pull/51) - Remove some redundant code and fix a failed unit test.
* [PR 45](https://github.com/pytroll/pytroll-schedule/pull/45) - Use recent ssl protocol for older python versions
* [PR 38](https://github.com/pytroll/pytroll-schedule/pull/38) - Fix S3 olci scan duration

#### Features added

* [PR 67](https://github.com/pytroll/pytroll-schedule/pull/67) - Refactor remove legacy code support ([62](https://github.com/pytroll/pytroll-schedule/issues/62))
* [PR 66](https://github.com/pytroll/pytroll-schedule/pull/66) - Change tested Python versions to 3.8, 3.9 and 3.10
* [PR 64](https://github.com/pytroll/pytroll-schedule/pull/64) - Use safe loading for YAML config file
* [PR 61](https://github.com/pytroll/pytroll-schedule/pull/61) - Allow `mersi-2` as instrument name ([59](https://github.com/pytroll/pytroll-schedule/issues/59))
* [PR 58](https://github.com/pytroll/pytroll-schedule/pull/58) - Fix a test failure on Python 3.7
* [PR 57](https://github.com/pytroll/pytroll-schedule/pull/57) - Fix an import raising deprecation warning ([54](https://github.com/pytroll/pytroll-schedule/issues/54))
* [PR 55](https://github.com/pytroll/pytroll-schedule/pull/55) - Add GitHub actions to run unittests ([53](https://github.com/pytroll/pytroll-schedule/issues/53))
* [PR 50](https://github.com/pytroll/pytroll-schedule/pull/50) - Add a southern hemisphere pass test.
* [PR 46](https://github.com/pytroll/pytroll-schedule/pull/46) - Give the option to plot multiple polygons
* [PR 45](https://github.com/pytroll/pytroll-schedule/pull/45) - Use recent ssl protocol for older python versions
* [PR 44](https://github.com/pytroll/pytroll-schedule/pull/44) - Make plot filename more complete, including the instrument name
* [PR 42](https://github.com/pytroll/pytroll-schedule/pull/42) - Make it possible to tell cartopy to use offline shapefiles
* [PR 41](https://github.com/pytroll/pytroll-schedule/pull/41) - Fix nasa ftp retrieval
* [PR 38](https://github.com/pytroll/pytroll-schedule/pull/38) - Fix S3 olci scan duration

In this release 19 pull requests were closed.


## Version 0.5.2 (2019/03/19)


Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ pytroll-schedule
================

[![Codacy Badge](https://api.codacy.com/project/badge/Grade/9f039d7d640846ca89be8a78fa11e1f6)](https://www.codacy.com/app/adybbroe/pytroll-schedule?utm_source=github.com&utm_medium=referral&utm_content=pytroll/pytroll-schedule&utm_campaign=badger)
[![Build Status](https://travis-ci.org/pytroll/pytroll-schedule.png?branch=master)](https://travis-ci.org/pytroll/pytroll-schedule)
[![Coverage Status](https://coveralls.io/repos/github/pytroll/pytroll-schedule/badge.svg?branch=master)](https://coveralls.io/github/pytroll/pytroll-schedule?branch=master)
[![Code Health](https://landscape.io/github/pytroll/pytroll-schedule/master/landscape.png)](https://landscape.io/github/pytroll/pytroll-schedule/master)
[![Build Status](https://travis-ci.org/pytroll/pytroll-schedule.png?branch=main)](https://travis-ci.org/pytroll/pytroll-schedule)
[![Coverage Status](https://coveralls.io/repos/github/pytroll/pytroll-schedule/badge.svg?branch=main)](https://coveralls.io/github/pytroll/pytroll-schedule?branch=main)
[![Code Health](https://landscape.io/github/pytroll/pytroll-schedule/main/landscape.png)](https://landscape.io/github/pytroll/pytroll-schedule/main)
[![PyPI version](https://badge.fury.io/py/pytroll-schedule.svg)](https://badge.fury.io/py/pytroll-schedule)


Expand Down
2 changes: 1 addition & 1 deletion RELEASING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Releasing pytroll-schedule

1. checkout master
1. checkout main branch
2. pull from repo
3. run the unittests
4. run `loghub` and update the `CHANGELOG.md` file:
Expand Down
Empty file added codecov.yml
Empty file.
68 changes: 34 additions & 34 deletions docs/about.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,49 +5,49 @@ About PyTroll-Schedule

Case of One Receiving Station
-----------------------------
In the case of a single station, the procedure of scheduling is quite
In the case of a single station, the procedure of scheduling is quite
straightforward. However, let us describe it in detail here, such that the
background will be set for the more complex case of multiple reception station
background will be set for the more complex case of multiple reception station
reception scheduling.

The first step to compute the schedule, is to know which satellites of interest
are going to be rising above the horizon during the duration of the schedule.
In order to find such cases, we retrieve the orbital information for each
satellite of interest and apply orbit prediction using the aiaa sgp4 algorithm
(ref). In practice, we use norad tle files (ref) as orbital elements, and the
python implementation of the sgp4 algorithm provided in pyorbital (ref). From
this, we then obtain a list of the coming overpasses for the station. We define
an overpass as a risetime and fall time for a given satellite, during which it
The first step to compute the schedule, is to know which satellites of interest
are going to be rising above the horizon during the duration of the schedule.
In order to find such cases, we retrieve the orbital information for each
satellite of interest and apply orbit prediction using the aiaa sgp4 algorithm
(ref). In practice, we use norad tle files (ref) as orbital elements, and the
python implementation of the sgp4 algorithm provided in pyorbital (ref). From
this, we then obtain a list of the coming overpasses for the station. We define
an overpass as a risetime and fall time for a given satellite, during which it
will be within reception reach of the station.

Now, we have to find the possible schedules for the station. The set of all
overpasses gives us all the reception possibilities for the station. However,
many of them will be in conflict with at least one other overpass and will be
a concurrent to the reception race. We say that two overpasses conflict when
the risetime dog one of them is comprised within the view time of the second.
In case of conflicts, the scheduling algorithm has to choose one or the other
overpass. However, in the case of several overpasses conflicting sequentially,
we have to find the possible paths through the conflicting zone. In order to do
Now, we have to find the possible schedules for the station. The set of all
overpasses gives us all the reception possibilities for the station. However,
many of them will be in conflict with at least one other overpass and will be
a concurrent to the reception race. We say that two overpasses conflict when
the risetime dog one of them is comprised within the view time of the second.
In case of conflicts, the scheduling algorithm has to choose one or the other
overpass. However, in the case of several overpasses conflicting sequentially,
we have to find the possible paths through the conflicting zone. In order to do
that, we will use graph theory algorithms.

We define the graph of the conflicting zone with overpasses as vertices and
create an edge between two conflicting overpasses. To find the possible
non-conflicting combinations in this graph is actually searching for maximal
cliques in the complementary graph, for which we use the Bron-Kerbosch
We define the graph of the conflicting zone with overpasses as vertices and
create an edge between two conflicting overpasses. To find the possible
non-conflicting combinations in this graph is actually searching for maximal
cliques in the complementary graph, for which we use the Bron-Kerbosch
algorithm.
#illustration click

we obtain thus groups of passes that are not conflicting in the time frame.
The next step is to find the optimal list of non conflicting passes under the
The next step is to find the optimal list of non conflicting passes under the
duration on the schedule.

Cases of Connected Stations
---------------------------
There are several ways to computate schedules for connected stations, two are
There are several ways to compute schedules for connected stations, two are
implemented in this program.

Several points should be considered:
* Technical equipement, reception of L-band, Ku-band, X-band?
* Technical equipment, reception of L-band, Ku-band, X-band?
* Geographic location, nearby or large distance between?

"Master-Slave" Operation
Expand All @@ -58,26 +58,26 @@ other, with similar technical systems.
In this case a schedule for one, namely the "master" station, would be computed,
as if it were only this one station.

In a second step this schedule plan is used as a substraction list when
In a second step this schedule plan is used as a subtraction list when
computing the schedule for the second, the "slave" station.

Co-operating Stations
*********************
A mode of co-operating stations can consider the distance between different
geographical locations and differences in technical equipement, most notable
geographical locations and differences in technical equipment, most notable
different reception capabilities (X- & L-band vs. L-band).

In this case, each station defines a time span requirement for each pass. Then,
if a connected station can fulfil this requirement and is scheduling the same
pass, we can say that the stations are redundant. To avoid such redundancy, we
can define ways to synchronise the schedule to optimise the intake of data and
In this case, each station defines a time span requirement for each pass. Then,
if a connected station can fulfil this requirement and is scheduling the same
pass, we can say that the stations are redundant. To avoid such redundancy, we
can define ways to synchronise the schedule to optimise the intake of data and
fulfil the pareto condition.
A simple protocol can be used to perform this: both A and B provide alternatives
A simple protocol can be used to perform this: both A and B provide alternatives
and compute the enhanced score for the schedule including the others pass.

B can delegate the pass only if it can assure that the time span requirement of
B can delegate the pass only if it can assure that the time span requirement of
A is respected.

This operation can be extended to more than two stations, all receiving a
This operation can be extended to more than two stations, all receiving a
single-operation schedule and an individual cooperating-schedule.

2 changes: 1 addition & 1 deletion docs/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ Stations
described below. If no sub-keys are given, the scores from the section
``satellites`` are used.

Alternativly the satellites can be listed as a list, as shown in the
Alternatively the satellites can be listed as a list, as shown in the
following example for station "nrk". In this case all names refer to the
section ``satellites``.

Expand Down
Loading

0 comments on commit 4fb9ff6

Please sign in to comment.