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

Create instrument swath outlines as shapefiles #93

Open
wants to merge 39 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
34ac1d2
Refactor and use pyproject.toml for intallation - first draft add of …
Oct 3, 2024
3609a71
Version file is now generated upon installation
Oct 3, 2024
23c0888
Merge branch 'main' into swathoutline-shapefile
Nov 19, 2024
03af390
Merge branch 'bugfix-slstr-not-yet-properly-supported' into swathoutl…
Nov 19, 2024
692eb25
Merge branch 'main' into swathoutline-shapefile
Nov 19, 2024
5d14d72
Add a first script to create the shapefiles from the XML schedule file
Nov 19, 2024
29e7576
Add a basic logger module
Nov 19, 2024
9682861
Bugfix
Nov 19, 2024
d1533c2
Attempt to fix the ruff/linter stuf in the pyproject toml file
Nov 20, 2024
a78d7f4
Try fix pyproject.toml
Nov 20, 2024
8ed05a8
Trt fix the CI and github actions
Nov 20, 2024
c364f6e
Bugfix - we do not try to run CI tests with Basemap support
Nov 20, 2024
e675cd2
Fix so the Code-factor bot is happy
Nov 20, 2024
e2268f8
Update pre-commit config -copying from Satpy
Nov 20, 2024
7a37ec3
Test add back rye
Nov 20, 2024
8150fdd
Fix cut'n'paste error
Nov 20, 2024
972f4a2
Add a minimum amount of documentation for the new script
Nov 22, 2024
8e82f37
Bugfix
Nov 22, 2024
472c1e0
Add tests and fix style issues
Nov 22, 2024
354ff71
Fix codefactor complaints
Nov 22, 2024
2d26ef0
Add support for building the RTD pages for CI
Nov 22, 2024
4243e57
Cleanup in the build system
Nov 22, 2024
2b1e276
Bugfix and minor clean up
Nov 25, 2024
dfebf59
Update trollsched/satpass.py
adybbroe Dec 2, 2024
22f689e
Fix more meaningful doc strings
Dec 2, 2024
ba59c38
Merge branch 'swathoutline-shapefile' of github.com:adybbroe/pytroll-…
Dec 2, 2024
9df160b
Add more test coverage
Dec 2, 2024
ba5f81e
Fix style issues
Dec 2, 2024
e545647
Update trollsched/pass_scheduling_utils.py
adybbroe Dec 3, 2024
c5d3e40
Remove __main__ from module. It uses the run part for the script
Dec 3, 2024
26c8f3b
Clean up, removing unneccessary/unused stuff, and fixing cut'n'paste …
Dec 4, 2024
754c607
Update trollsched/schedule.py
adybbroe Dec 4, 2024
bdc004c
Update trollsched/graph.py
adybbroe Dec 4, 2024
38330e2
Add more debug logging
Dec 4, 2024
2b4ef25
Restructure imports
Dec 4, 2024
c949c58
Merge branch 'swathoutline-shapefile' of github.com:adybbroe/pytroll-…
Dec 4, 2024
5243dbe
Fix test to include the testing of running the main script with comma…
Dec 4, 2024
a5a2e77
Re-introduce some of the debug printouts using the logging module
Dec 4, 2024
086d579
Update the example config with current satellites
Dec 4, 2024
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
3 changes: 2 additions & 1 deletion .bandit
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[bandit]
exclude: trollsched/version.py,versioneer.py,trollsched/tests
skips: B506
exclude: trollsched/tests
1 change: 0 additions & 1 deletion .bumpversion.cfg
adybbroe marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ commit = True
tag = True

[bumpversion:file:trollsched/version.py]

2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
```
#### Problem description

[this should also explain **why** the current behaviour is a problem and why the
[this should also explain **why** the current behaviour is a problem and why the
expected output is a better solution.]

#### Expected Output
Expand Down
55 changes: 46 additions & 9 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,66 @@ on:
- pull_request

jobs:
build:
runs-on: ubuntu-latest
test:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: true
matrix:
os: ["windows-latest", "ubuntu-latest", "macos-latest"]
python-version: ["3.10", "3.11", "3.12"]
experimental: [false]
include:
- python-version: "3.12"
os: "ubuntu-latest"
experimental: true
env:
PYTHON_VERSION: ${{ matrix.python-version }}
OS: ${{ matrix.os }}
UNSTABLE: ${{ matrix.experimental }}
ACTIONS_ALLOW_UNSECURE_COMMANDS: true

steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5

- name: Setup Conda Environment
uses: conda-incubator/setup-miniconda@v3
with:
environment-file: continuous_integration/environment.yaml
miniforge-version: latest
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
activate-environment: test-environment

- name: Install unstable dependencies
if: matrix.experimental == true
shell: bash -l {0}
run: |
pip install --no-deps -e .
sudo apt-get install \
gcc \
python3-dev; \
python -m pip install \
-f https://pypi.anaconda.org/scientific-python-nightly-wheels/simple/ \
--no-deps --pre --upgrade \
matplotlib \
numpy \
pandas \
geopandas \
scipy; \
python -m pip install \
--no-deps --upgrade \
git+https://github.com/dask/dask \
git+https://github.com/dask/distributed \
git+https://github.com/Unidata/cftime \
git+https://github.com/pydata/bottleneck \
git+https://github.com/pydata/xarray;
adybbroe marked this conversation as resolved.
Show resolved Hide resolved


- name: Run tests
shell: bash -l {0}
run: |
pytest --cov=trollsched trollsched/tests --cov-report=xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,7 @@ tmp
.vscode
.ropeproject
*~

# Version
# this should be generated automatically when installed
trollsched/version.py
32 changes: 26 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,40 @@
exclude: '^$'
fail_fast: false
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: 'v0.7.2'
hooks:
- id: ruff
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v5.0.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'
- repo: https://github.com/PyCQA/bandit
rev: '1.7.10' # Update me!
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: bandit
args: [--ini, .bandit]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.13.0' # Use the sha / tag you want to point at
hooks:
- id: mypy
additional_dependencies:
- types-docutils
- types-setuptools
- types-PyYAML
- types-requests
args: ["--python-version", "3.10", "--ignore-missing-imports"]
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
language_version: python3
ci:
# To trigger manually, comment on a pull request with "pre-commit.ci autofix"
autofix_prs: false
autoupdate_schedule: "monthly"
skip: [bandit]
19 changes: 19 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: 2

build:
os: "ubuntu-20.04"
tools:
python: "mambaforge-4.10"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py
fail_on_warning: true

conda:
environment: docs/environment.yaml

python:
install:
- method: pip
path: .
1 change: 0 additions & 1 deletion .stickler.yml
adybbroe marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ files:
ignore:
- 'docs/Makefile'
- 'docs/make.bat'

8 changes: 4 additions & 4 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007

Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

Expand Down Expand Up @@ -645,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found.
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <https://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

Expand All @@ -664,11 +664,11 @@ might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
<https://www.gnu.org/licenses/>.

The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
<https://www.gnu.org/licenses/why-not-lgpl.html>.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
pytroll-schedule
================
# pytroll-schedule

Reception scheduling of polar orbiting weather satellites


[![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=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)


Reception scheduling of polar orbiting weather satellites
3 changes: 0 additions & 3 deletions changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,3 @@ v0.2.0 (2014-05-20)
- Renamed a few things to avoid -_ problems. [Martin Raspaud]
- Initial commit. [Martin Raspaud]
- Initial commit. [Martin Raspaud]



38 changes: 38 additions & 0 deletions continuous_integration/environment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: test-environment
channels:
- conda-forge
dependencies:
- xarray
- dask
- distributed
- toolz
- sphinx
- matplotlib
- cartopy
- scipy
- pyyaml
- coveralls
- coverage
- codecov
- behave
- netcdf4
- paramiko
- oauthlib
- watchdog
- s3fs
- shapely
- pyproj
- pandas
- geopandas
- mock
- pytest
- pytest-cov
- responses
- platformdirs
- defusedxml
- pyorbital
- pyresample
- trollsift
- pip
- pip:
- posttroll
1 change: 0 additions & 1 deletion docs/about.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,3 @@ A is respected.

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

37 changes: 18 additions & 19 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand All @@ -25,32 +24,32 @@

# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.pngmath']
extensions = ["sphinx.ext.autodoc", "sphinx.ext.intersphinx", "sphinx.ext.pngmath"]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# The suffix of source filenames.
source_suffix = '.rst'
source_suffix = ".rst"

# The encoding of source files.
#source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# General information about the project.
project = u'pytroll-schedule'
copyright = u'2014, Martin Raspaud'
project = u"pytroll-schedule"
copyright = u"2014, 2024-{}, The PyTroll Team".format(dt.datetime.utcnow().strftime("%Y")) # noqa: A001

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.1.0'
version = "0.1.0"
# The full version, including alpha/beta/rc tags.
release = '0.1.0'
release = "0.1.0"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand All @@ -64,7 +63,7 @@

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build']
exclude_patterns = ["_build"]

# The reST default role (used for this markup: `text`) to use for all documents.
#default_role = None
Expand All @@ -81,7 +80,7 @@
#show_authors = False

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
pygments_style = "sphinx"

# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
Expand All @@ -91,7 +90,7 @@

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'default'
html_theme = "default"

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand Down Expand Up @@ -120,7 +119,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = ["_static"]

# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
Expand Down Expand Up @@ -164,7 +163,7 @@
#html_file_suffix = None

# Output file base name for HTML help builder.
htmlhelp_basename = 'pytroll-scheduledoc'
htmlhelp_basename = "pytroll-scheduledoc"


# -- Options for LaTeX output --------------------------------------------------
Expand All @@ -178,8 +177,8 @@
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'pytroll-schedule.tex', u'pytroll-schedule Documentation',
u'Martin Raspaud', 'manual'),
("index", "pytroll-schedule.tex", u"pytroll-schedule Documentation",
u"Martin Raspaud", "manual"),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -211,10 +210,10 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'pytroll-schedule', u'pytroll-schedule Documentation',
[u'Martin Raspaud'], 1)
("index", "pytroll-schedule", u"pytroll-schedule Documentation",
[u"Martin Raspaud"], 1)
]


# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'http://docs.python.org/': None}
intersphinx_mapping = {"http://docs.python.org/": None}
Loading
Loading