Skip to content

Commit

Permalink
Merge branch 'main' into add-jpss2
Browse files Browse the repository at this point in the history
  • Loading branch information
adybbroe authored Nov 23, 2024
2 parents e828412 + 9700076 commit cf3f268
Show file tree
Hide file tree
Showing 43 changed files with 1,456 additions and 3,857 deletions.
3 changes: 3 additions & 0 deletions .bandit
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[bandit]
skips: B506
exclude: pyorbital/tests
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
87 changes: 76 additions & 11 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,112 @@ name: CI

on: [push, pull_request]

env:
CACHE_NUMBER: 1

jobs:
test:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: true
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ["3.8", "3.9", "3.10"]
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@v3
uses: actions/checkout@v4

- name: Setup Conda Environment
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
miniforge-version: latest
python-version: ${{ matrix.python-version }}
mamba-version: "*"
channels: conda-forge,defaults
environment-file: continuous_integration/environment.yaml
activate-environment: test-environment
channels: conda-forge
conda-remove-defaults: true
channel-priority: strict

- name: Set cache environment variables
shell: bash -l {0}
run: |
echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV
CONDA_PREFIX=$(python -c "import sys; print(sys.prefix)")
echo "CONDA_PREFIX=$CONDA_PREFIX" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
path: ${{ env.CONDA_PREFIX }}
key: ${{ matrix.os }}-${{matrix.python-version}}-conda-${{ hashFiles('continuous_integration/environment.yaml') }}-${{ env.DATE }}-${{matrix.experimental}}-${{ env.CACHE_NUMBER }}
id: cache

- name: Update environment
run: mamba env update -n test-environment -f continuous_integration/environment.yaml
if: steps.cache.outputs.cache-hit != 'true'

- name: Install unstable dependencies
if: matrix.experimental == true
shell: bash -l {0}
# We must get LD_PRELOAD for stdlibc++ or else the manylinux wheels
# may break the conda-forge libraries trying to use newer glibc versions
run: |
python -m pip install \
--index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple/ \
--trusted-host pypi.anaconda.org \
--no-deps --pre --upgrade \
matplotlib \
numpy \
pandas \
scipy; \
python -m pip install \
--no-deps --upgrade \
git+https://github.com/dask/dask \
git+https://github.com/pydata/xarray;
LD_PRELOAD=$(python -c "import sys; print(sys.prefix)")/lib/libstdc++.so
echo "LD_PRELOAD=${LD_PRELOAD}" >> $GITHUB_ENV
- name: Install Pyorbital
shell: bash -l {0}
run: |
pip install --no-deps -e .
python -m pip install --no-deps -e .
- name: Run unit tests
shell: bash -l {0}
run: |
pytest --cov=pyorbital pyorbital/tests --cov-report=xml
export LD_PRELOAD=${{ env.LD_PRELOAD }};
pytest --cov=pyorbital pyorbital/tests --cov-report=xml --cov-report=
- name: Upload unittest coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v5
with:
flags: unittests
file: ./coverage.xml
env_vars: OS,PYTHON_VERSION,UNSTABLE

- name: Coveralls Parallel
uses: AndreMiras/coveralls-python-action@develop
with:
flag-name: run-${{ matrix.test_number }}
parallel: true
if: runner.os == 'Linux'

coveralls:
needs: [test]
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: AndreMiras/coveralls-python-action@develop
with:
parallel-finished: true
6 changes: 3 additions & 3 deletions .github/workflows/deploy-sdist.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ jobs:

steps:
- name: Checkout source
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Create sdist
shell: bash -l {0}
run: python setup.py sdist

- name: Publish package to PyPI
if: github.event.action == 'published'
uses: pypa/gh-action-pypi-publish@v1.8.7
uses: pypa/gh-action-pypi-publish@v1.12.2
with:
user: __token__
password: ${{ secrets.pypi_password }}
password: ${{ secrets.pypi_password }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,5 @@ nosetests.xml

# rope
.ropeproject

pyorbital/version.py
42 changes: 38 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,42 @@
exclude: '^$'
fail_fast: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.2.3
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: 'v0.7.2'
hooks:
- id: flake8
additional_dependencies: [flake8-docstrings, flake8-debugger, flake8-bugbear]
- id: ruff
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
exclude: pyorbital/tests/SGP4-VER.TLE
- id: end-of-file-fixer
- id: check-yaml
args: [--unsafe]
- repo: https://github.com/PyCQA/bandit
rev: '1.7.10' # Update me!
hooks:
- 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
- types-pytz
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: doc/source/conf.py
fail_on_warning: true

conda:
environment: doc/environment.yaml

python:
install:
- method: pip
path: .
4 changes: 0 additions & 4 deletions .stickler.yml

This file was deleted.

89 changes: 88 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,90 @@
## Version 1.8.3 (2024/06/25)

### Issues Closed

* [Issue 151](https://github.com/pytroll/pyorbital/issues/151) - Issue Calculating Accurate View Zenith Angles on Terra Satellite Overpasses

In this release 1 issue was closed.

### Pull Requests Merged

#### Bugs fixed

* [PR 156](https://github.com/pytroll/pyorbital/pull/156) - Fix dtype preservation in astronomy functions

In this release 1 pull request was closed.


## Version 1.8.2 (2024/02/05)

### Issues Closed

* [Issue 140](https://github.com/pytroll/pyorbital/issues/140) - pyorbital cannot read TLE for MTG-I1 / Meteosat-12 ([PR 141](https://github.com/pytroll/pyorbital/pull/141) by [@gerritholl](https://github.com/gerritholl))
* [Issue 139](https://github.com/pytroll/pyorbital/issues/139) - `Orbital` cannot get TLEs from the internet

In this release 2 issues were closed.

### Pull Requests Merged

#### Bugs fixed

* [PR 143](https://github.com/pytroll/pyorbital/pull/143) - Fix a bug in using TLES env variable

#### Features added

* [PR 141](https://github.com/pytroll/pyorbital/pull/141) - Add Meteosat-12 to platforms.txt ([140](https://github.com/pytroll/pyorbital/issues/140))

In this release 2 pull requests were closed.


## Version 1.8.1 (2024/01/05)

### Pull Requests Merged

#### Bugs fixed

* [PR 138](https://github.com/pytroll/pyorbital/pull/138) - Update celestrak urls ([139](https://github.com/pytroll/pyorbital/issues/139))

#### Features added

* [PR 137](https://github.com/pytroll/pyorbital/pull/137) - Prettify the RTD pages

#### Documentation changes

* [PR 137](https://github.com/pytroll/pyorbital/pull/137) - Prettify the RTD pages
* [PR 132](https://github.com/pytroll/pyorbital/pull/132) - Add .readthedocs.yaml

In this release 4 pull requests were closed.


## Version 1.8.0 (2023/07/12)

### Issues Closed

* [Issue 112](https://github.com/pytroll/pyorbital/issues/112) - Is the TLES environment variable described? ([PR 113](https://github.com/pytroll/pyorbital/pull/113) by [@adybbroe](https://github.com/adybbroe))

In this release 1 issue was closed.

### Pull Requests Merged

#### Bugs fixed

* [PR 129](https://github.com/pytroll/pyorbital/pull/129) - Fix bug getting local tlefiles
* [PR 128](https://github.com/pytroll/pyorbital/pull/128) - Fix typo in VIIRS geoloc definition
* [PR 121](https://github.com/pytroll/pyorbital/pull/121) - fixed geoloc_example and added variable descriptions

#### Features added

* [PR 120](https://github.com/pytroll/pyorbital/pull/120) - Update versioneer to stop using deprecated distutils module.
* [PR 113](https://github.com/pytroll/pyorbital/pull/113) - Make use of env variables free from satpy ([112](https://github.com/pytroll/pyorbital/issues/112))

#### Documentation changes

* [PR 113](https://github.com/pytroll/pyorbital/pull/113) - Make use of env variables free from satpy ([112](https://github.com/pytroll/pyorbital/issues/112))

In this release 6 pull requests were closed.


## Version 1.7.3 (2022/07/11)

### Pull Requests Merged
Expand Down Expand Up @@ -76,7 +163,7 @@ In this release 5 pull requests were closed.
### Issues Closed

* [Issue 63](https://github.com/pytroll/pyorbital/issues/63) - Runtime error in get_next_passes ([PR 64](https://github.com/pytroll/pyorbital/pull/64))
* [Issue 62](https://github.com/pytroll/pyorbital/issues/62) - can this tool run
* [Issue 62](https://github.com/pytroll/pyorbital/issues/62) - can this tool run
* [Issue 22](https://github.com/pytroll/pyorbital/issues/22) - get_next_passes returns max-elevation-time time not between rise & fall time ([PR 76](https://github.com/pytroll/pyorbital/pull/76))

In this release 3 issues were closed.
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ This is the Pyorbital, a Python package for computing orbital parameters from TL
files, and making various astronomical computations.

It is part of the Pytroll project: http://pytroll.org

3 changes: 0 additions & 3 deletions changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,3 @@ v0.1.0 (2011-10-03)
- Cleanup of astronomy file. [Martin Raspaud]
- Added a readme file. [Martin Raspaud]
- Added astronomy.py file. [Martin Raspaud]



2 changes: 1 addition & 1 deletion continuous_integration/environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ dependencies:
- coverage
- codecov
- behave
- mock
- zarr
- geoviews
- pytest
- pytest-cov
- fsspec
- defusedxml
- pip
- pip:
- trollsift
Loading

0 comments on commit cf3f268

Please sign in to comment.