Skip to content

Commit

Permalink
Merge branch 'main' into sar-independent-reader
Browse files Browse the repository at this point in the history
  • Loading branch information
mraspaud authored Mar 8, 2024
2 parents 5c4da9e + 6c9d8b2 commit ed37b0d
Show file tree
Hide file tree
Showing 71 changed files with 4,280 additions and 2,460 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency
# https://docs.github.com/en/developers/webhooks-and-events/events/github-event-types#pullrequestevent
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.type }}
group: ${{ github.workflow }}-${{ github.event.number || github.event.ref }}-${{ github.event.type }}
cancel-in-progress: true

on: [push, pull_request]
Expand All @@ -18,10 +18,10 @@ jobs:
fail-fast: true
matrix:
os: ["windows-latest", "ubuntu-latest", "macos-latest"]
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.9", "3.11", "3.12"]
experimental: [false]
include:
- python-version: "3.11"
- python-version: "3.12"
os: "ubuntu-latest"
experimental: true

Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
CONDA_PREFIX=$(python -c "import sys; print(sys.prefix)")
echo "CONDA_PREFIX=$CONDA_PREFIX" >> $GITHUB_ENV
- uses: actions/cache@v3
- 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 }}
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
pytest --cov=satpy satpy/tests --cov-report=xml --cov-report=
- name: Upload unittest coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
flags: unittests
file: ./coverage.xml
Expand All @@ -131,7 +131,7 @@ jobs:
coverage xml
- name: Upload behaviour test coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
flags: behaviourtests
file: ./coverage.xml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-sdist.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Publish package to PyPI
if: github.event.action == 'published'
uses: pypa/gh-action-pypi-publish@v1.8.11
uses: pypa/gh-action-pypi-publish@v1.8.12
with:
user: __token__
password: ${{ secrets.pypi_password }}
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ fail_fast: false
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: 'v0.1.9'
rev: 'v0.2.0'
hooks:
- id: ruff
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand All @@ -14,7 +14,7 @@ repos:
- id: check-yaml
args: [--unsafe]
- repo: https://github.com/PyCQA/bandit
rev: '1.7.6' # Update me!
rev: '1.7.7' # Update me!
hooks:
- id: bandit
args: [--ini, .bandit]
Expand Down
76 changes: 76 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,79 @@
## Version 0.47.0 (2024/02/21)

### Issues Closed

* [Issue 2734](https://github.com/pytroll/satpy/issues/2734) - Using a static image alters time information ([PR 2737](https://github.com/pytroll/satpy/pull/2737) by [@pnuu](https://github.com/pnuu))
* [Issue 2723](https://github.com/pytroll/satpy/issues/2723) - MODIS Satpy scene Don't know how to open the following files: {'MOD021KM.A2017131.1325.061.2017314123114.hdf'}
* [Issue 2719](https://github.com/pytroll/satpy/issues/2719) - Add lat lon to Seviri plots
* [Issue 2718](https://github.com/pytroll/satpy/issues/2718) - Set invert as a modifier when do composite
* [Issue 2712](https://github.com/pytroll/satpy/issues/2712) - mitiff writer add config option to add or not to add the size of a pixel in the proj string ([PR 2713](https://github.com/pytroll/satpy/pull/2713) by [@TAlonglong](https://github.com/TAlonglong))
* [Issue 2710](https://github.com/pytroll/satpy/issues/2710) - scene.save_datasets() outputs different values for AHI_HSD reader with calibration="brightness_temperature"
* [Issue 2708](https://github.com/pytroll/satpy/issues/2708) - this is regarding slstr_l1b geometry
* [Issue 2703](https://github.com/pytroll/satpy/issues/2703) - read swath in loop
* [Issue 2680](https://github.com/pytroll/satpy/issues/2680) - satpy_cf_nc reader cannot read FCI file written with cf writer
* [Issue 2672](https://github.com/pytroll/satpy/issues/2672) - Changes in NWC SAF GEO v2021 data ([PR 2673](https://github.com/pytroll/satpy/pull/2673) by [@pnuu](https://github.com/pnuu))
* [Issue 2630](https://github.com/pytroll/satpy/issues/2630) - wrong start_time with BackgroundCompositor ([PR 2737](https://github.com/pytroll/satpy/pull/2737) by [@pnuu](https://github.com/pnuu))
* [Issue 2447](https://github.com/pytroll/satpy/issues/2447) - add more options to time handling in combine_metadata ([PR 2737](https://github.com/pytroll/satpy/pull/2737) by [@pnuu](https://github.com/pnuu))
* [Issue 2446](https://github.com/pytroll/satpy/issues/2446) - combine metadata in `MultiFiller` ([PR 2737](https://github.com/pytroll/satpy/pull/2737) by [@pnuu](https://github.com/pnuu))
* [Issue 2427](https://github.com/pytroll/satpy/issues/2427) - Wrong start_time, end_time attributes after MultiScene.blend(blend_function=timeseries) ([PR 2737](https://github.com/pytroll/satpy/pull/2737) by [@pnuu](https://github.com/pnuu))
* [Issue 2319](https://github.com/pytroll/satpy/issues/2319) - slstr_l2.yaml points to deleted slstr_l2.py ([PR 2731](https://github.com/pytroll/satpy/pull/2731) by [@djhoese](https://github.com/djhoese))
* [Issue 1921](https://github.com/pytroll/satpy/issues/1921) - Standardize dataset information for SEVIRI and FCI L2 products
* [Issue 1174](https://github.com/pytroll/satpy/issues/1174) - combine_metadata only supports the average of time attrs ([PR 2737](https://github.com/pytroll/satpy/pull/2737) by [@pnuu](https://github.com/pnuu))

In this release 17 issues were closed.

### Pull Requests Merged

#### Bugs fixed

* [PR 2743](https://github.com/pytroll/satpy/pull/2743) - Fix nominal time attributes in SEVIRI HRIT ([](https://github.com/`nominal_start/issues/))
* [PR 2742](https://github.com/pytroll/satpy/pull/2742) - Fix nominal end time in AHI HSD
* [PR 2737](https://github.com/pytroll/satpy/pull/2737) - Change `start_time` and `end_time` handling in `combine_metadata` ([2734](https://github.com/pytroll/satpy/issues/2734), [2630](https://github.com/pytroll/satpy/issues/2630), [2447](https://github.com/pytroll/satpy/issues/2447), [2446](https://github.com/pytroll/satpy/issues/2446), [2427](https://github.com/pytroll/satpy/issues/2427), [1174](https://github.com/pytroll/satpy/issues/1174))
* [PR 2731](https://github.com/pytroll/satpy/pull/2731) - Remove slstr_l2 reader in favor of ghrsst_l2 ([2319](https://github.com/pytroll/satpy/issues/2319))
* [PR 2730](https://github.com/pytroll/satpy/pull/2730) - Pin pytest to fix CI
* [PR 2726](https://github.com/pytroll/satpy/pull/2726) - Fix AGRI L1 C07 having a valid LUT value for its fill value ([565](https://github.com/ssec/polar2grid/issues/565))
* [PR 2713](https://github.com/pytroll/satpy/pull/2713) - Add kwargs config option to turn off mitiff corner correction ([2712](https://github.com/pytroll/satpy/issues/2712))
* [PR 2711](https://github.com/pytroll/satpy/pull/2711) - Add support for NOAA-21 in MiRS limb correction
* [PR 2707](https://github.com/pytroll/satpy/pull/2707) - Fix 'viirs_edr' renaming two sets of dimensions to the same names
* [PR 2700](https://github.com/pytroll/satpy/pull/2700) - Fix eps_l1b reader Delayed usage causing docs failures

#### Features added

* [PR 2746](https://github.com/pytroll/satpy/pull/2746) - Fix concurrency group in ci
* [PR 2745](https://github.com/pytroll/satpy/pull/2745) - Sort reader table by name + diverse fixes
* [PR 2744](https://github.com/pytroll/satpy/pull/2744) - Fix cutoffs for night_ir_alpha and bump up trollimage version
* [PR 2737](https://github.com/pytroll/satpy/pull/2737) - Change `start_time` and `end_time` handling in `combine_metadata` ([2734](https://github.com/pytroll/satpy/issues/2734), [2630](https://github.com/pytroll/satpy/issues/2630), [2447](https://github.com/pytroll/satpy/issues/2447), [2446](https://github.com/pytroll/satpy/issues/2446), [2427](https://github.com/pytroll/satpy/issues/2427), [1174](https://github.com/pytroll/satpy/issues/1174))
* [PR 2728](https://github.com/pytroll/satpy/pull/2728) - Update asv dependencies
* [PR 2720](https://github.com/pytroll/satpy/pull/2720) - Add support for the MERSI-RM instrument on FY-3G
* [PR 2714](https://github.com/pytroll/satpy/pull/2714) - Add QC-based filtering to the VIIRS EDR AOD550 product
* [PR 2675](https://github.com/pytroll/satpy/pull/2675) - Make CF encoding of dataset attributes public
* [PR 2673](https://github.com/pytroll/satpy/pull/2673) - Add NWC SAF GEO v2021 ASIIF-TF and ASII-GW dataset names ([2672](https://github.com/pytroll/satpy/issues/2672))
* [PR 2534](https://github.com/pytroll/satpy/pull/2534) - Add fsspec functionality to `viirs_sdr` reader
* [PR 2441](https://github.com/pytroll/satpy/pull/2441) - Add channel aliases to the CLAVRx reader to facilitate composites

#### Documentation changes

* [PR 2700](https://github.com/pytroll/satpy/pull/2700) - Fix eps_l1b reader Delayed usage causing docs failures

#### Backward incompatible changes

* [PR 2731](https://github.com/pytroll/satpy/pull/2731) - Remove slstr_l2 reader in favor of ghrsst_l2 ([2319](https://github.com/pytroll/satpy/issues/2319))

#### Refactoring

* [PR 2699](https://github.com/pytroll/satpy/pull/2699) - Move Scene.to_hvplot internals to _scene_converters

#### Clean ups

* [PR 2711](https://github.com/pytroll/satpy/pull/2711) - Add support for NOAA-21 in MiRS limb correction
* [PR 2700](https://github.com/pytroll/satpy/pull/2700) - Fix eps_l1b reader Delayed usage causing docs failures
* [PR 2689](https://github.com/pytroll/satpy/pull/2689) - Fix/supress warnings in reader tests ([](https://github.com/and/issues/))
* [PR 2665](https://github.com/pytroll/satpy/pull/2665) - FCI L2 CF harmonization
* [PR 2597](https://github.com/pytroll/satpy/pull/2597) - Update CI to test Python 3.12

In this release 29 pull requests were closed.


## Version 0.46.0 (2023/12/18)

### Issues Closed
Expand Down
20 changes: 10 additions & 10 deletions asv.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
// determined by looking for tools on the PATH environment
// variable.
//"environment_type": "virtualenv",
"environment_type": "conda",
"environment_type": "mamba",

// timeout in seconds for installing any dependencies in environment
// defaults to 10 min
Expand All @@ -58,7 +58,7 @@
// The Pythons you'd like to test against. If not provided, defaults
// to the current version of Python used to run `asv`.
// "pythons": ["2.7", "3.6"],
"pythons": ["3.9", "3.10"],
"pythons": ["3.11", "3.12"],

// The list of conda channel names to be searched for benchmark
// dependency packages in the specified order
Expand All @@ -80,14 +80,14 @@
// "pip+emcee": [""], // emcee is only available for install with pip.
// },
"matrix": {
"pyresample": ["1.22.3"],
"trollimage": ["1.17.0"],
"pyorbital": ["1.7.1"],
"pyspectral": ["0.10.6"],
"rasterio": ["1.2.10"],
"dask": ["2021.12.0"],
"xarray": ["0.20.2"],
"numpy": ["1.22.0"],
"pyresample": ["1.27.1"],
"trollimage": ["1.22.2"],
"pyorbital": ["1.8.1"],
"pyspectral": ["0.13.0"],
"rasterio": ["1.3.9"],
"dask": ["2024.1.1"],
"xarray": ["2024.1.1"],
"numpy": ["1.26.0"],
"s3fs": [],
"h5py": [],
"netCDF4": [],
Expand Down
4 changes: 2 additions & 2 deletions continuous_integration/environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ dependencies:
- python-eccodes
# 2.19.1 seems to cause library linking issues
- eccodes>=2.20
- pytest
- pytest<8.0.0
- pytest-cov
- pytest-lazy-fixture
- fsspec
Expand All @@ -59,6 +59,6 @@ dependencies:
- bokeh
- pip:
- trollsift
- trollimage>=1.20
- trollimage>=1.23
- pyspectral
- pyorbital
7 changes: 6 additions & 1 deletion doc/source/_static/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
$(document).ready( function () {
$('table.datatable').DataTable( {
"paging": false,
"dom": 'lfitp'
"layout": {
'topStart': 'info',
'topEnd': 'search',
'bottomStart': null
},
"order": [[0, 'asc']]
} );
} );
4 changes: 2 additions & 2 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,11 @@ def __getattr__(cls, name):

html_css_files = [
"theme_overrides.css", # override wide tables in RTD theme
"https://cdn.datatables.net/1.10.23/css/jquery.dataTables.min.css",
"https://cdn.datatables.net/v/dt/dt-2.0.0/datatables.min.css",
]

html_js_files = [
"https://cdn.datatables.net/1.10.23/js/jquery.dataTables.min.js",
"https://cdn.datatables.net/v/dt/dt-2.0.0/datatables.min.js",
"main.js",
]

Expand Down
3 changes: 2 additions & 1 deletion doc/source/dev_guide/custom_reader.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ The parameters to provide in this section are:
file format. This can be multiline if formatted properly in YAML (see
example below).
status
The status of the reader (one of: Nominal, Beta, Alpha)
The status of the reader (one of: Nominal, Beta, Alpha, Defunct; see :ref:`Status Description <Status Description>`
for more details).
supports_fsspec
If the reader supports reading data via fsspec (either true or false).
sensors
Expand Down
24 changes: 24 additions & 0 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,30 @@ Documentation

.. include:: reader_table.rst

.. _Status Description:
.. note::

Status description:

Defunct
Most likely the reader is not functional. If it is there is a good chance of
bugs and/or performance problems (e.g. not ported to dask/xarray yet). Future
development is unclear. Users are encouraged to contribute (see section
:doc:`dev_guide/CONTRIBUTING` and/or get help on Slack or by opening a Github issue).

Alpha
This denotes early development status. Reader is functional and implements some
or all of the nominal features. There might be bugs. Exactness of results is
not be guaranteed. Use at your own risk.

Beta
This denotes final developement status. Reader is functional and implements all
nominal features. Results should be dependable but there might be bugs. Users
are actively encouraged to test and report bugs.

Nominal
This denotes a finished status. Reader is functional and most likely no new
features will be introduced. It has been tested and there are no known bugs.

Indices and tables
==================
Expand Down
10 changes: 6 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,21 @@ known_first_party = "satpy"
line_length = 120

[tool.ruff]
line-length = 120

[tool.ruff.lint]
# See https://docs.astral.sh/ruff/rules/
# In the future, add "B", "S", "N"
select = ["A", "D", "E", "W", "F", "I", "PT", "TID", "C90", "Q", "T10", "T20"]
line-length = 120

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"satpy/tests/*" = ["S101"] # assert allowed in tests
"utils/coord2area_def.py" = ["T201"] # allow print
"fetch_avhrr_calcoeffs.py" = ["T201"] # allow print

[tool.ruff.pydocstyle]
[tool.ruff.lint.pydocstyle]
convention = "google"

[tool.ruff.mccabe]
[tool.ruff.lint.mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 10
8 changes: 4 additions & 4 deletions satpy/cf/attrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ def _encode_to_cf(obj):
return _encode_python_objects(obj)


def _encode_nc_attrs(attrs):
"""Encode dataset attributes in a netcdf compatible datatype.
def encode_attrs_to_cf(attrs):
"""Encode dataset attributes as a netcdf compatible datatype.
Args:
attrs (dict):
Expand Down Expand Up @@ -161,7 +161,7 @@ def preprocess_attrs(
if flatten_attrs:
data_arr.attrs = flatten_dict(data_arr.attrs)

data_arr.attrs = _encode_nc_attrs(data_arr.attrs)
data_arr.attrs = encode_attrs_to_cf(data_arr.attrs)

return data_arr

Expand Down Expand Up @@ -224,7 +224,7 @@ def preprocess_header_attrs(header_attrs, flatten_attrs=False):
if header_attrs is not None:
if flatten_attrs:
header_attrs = flatten_dict(header_attrs)
header_attrs = _encode_nc_attrs(header_attrs) # OrderedDict
header_attrs = encode_attrs_to_cf(header_attrs) # OrderedDict
else:
header_attrs = {}
header_attrs = _add_history(header_attrs)
Expand Down
Loading

0 comments on commit ed37b0d

Please sign in to comment.