Skip to content

Commit

Permalink
Merge branch 'main' into fix-datetime-imports
Browse files Browse the repository at this point in the history
  • Loading branch information
pnuu committed Apr 29, 2024
2 parents 3730117 + 4c28f9c commit 72c2f33
Show file tree
Hide file tree
Showing 13 changed files with 781 additions and 495 deletions.
46 changes: 46 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,49 @@
## Version 0.48.0 (2024/04/22)

### Issues Closed

* [Issue 2782](https://github.com/pytroll/satpy/issues/2782) - Documentation points to missing setup.py ([PR 2786](https://github.com/pytroll/satpy/pull/2786) by [@mraspaud](https://github.com/mraspaud))
* [Issue 2771](https://github.com/pytroll/satpy/issues/2771) - Load data in another datatype rather than float64
* [Issue 2759](https://github.com/pytroll/satpy/issues/2759) - 'defusedxml' missing in "msi_safe" extras ([PR 2761](https://github.com/pytroll/satpy/pull/2761) by [@fwfichtner](https://github.com/fwfichtner))
* [Issue 2749](https://github.com/pytroll/satpy/issues/2749) - [Question] Resample of mesoscale data gives blank data
* [Issue 2747](https://github.com/pytroll/satpy/issues/2747) - Cannot load from MTG FCI L1C data
* [Issue 2729](https://github.com/pytroll/satpy/issues/2729) - Add Viirs L2 Reader + Enhancments ([PR 2740](https://github.com/pytroll/satpy/pull/2740) by [@wjsharpe](https://github.com/wjsharpe))
* [Issue 2695](https://github.com/pytroll/satpy/issues/2695) - Improvements for BackgroundCompositor ([PR 2696](https://github.com/pytroll/satpy/pull/2696) by [@yukaribbba](https://github.com/yukaribbba))

In this release 7 issues were closed.

### Pull Requests Merged

#### Bugs fixed

* [PR 2786](https://github.com/pytroll/satpy/pull/2786) - Remove doc references to setup.py ([2782](https://github.com/pytroll/satpy/issues/2782))
* [PR 2779](https://github.com/pytroll/satpy/pull/2779) - Convert Sentinel-2 MSI sensor name to lowercase in the reader YAML config file and add support for "counts" calibration
* [PR 2774](https://github.com/pytroll/satpy/pull/2774) - Fix the viirs EDR tests for newer xarray
* [PR 2761](https://github.com/pytroll/satpy/pull/2761) - Add missing defusedxml ([2759](https://github.com/pytroll/satpy/issues/2759))
* [PR 2754](https://github.com/pytroll/satpy/pull/2754) - Bugfix vgac reader
* [PR 2701](https://github.com/pytroll/satpy/pull/2701) - Ici reader tiepoints bugfix
* [PR 2696](https://github.com/pytroll/satpy/pull/2696) - Add double alpha channel support and improve metadata behaviours for BackgroundCompositor ([2695](https://github.com/pytroll/satpy/issues/2695))

#### Features added

* [PR 2780](https://github.com/pytroll/satpy/pull/2780) - Add new (Eumetrain) FCI RGB composites
* [PR 2767](https://github.com/pytroll/satpy/pull/2767) - Use flags from file when available in OLCI NC reader
* [PR 2763](https://github.com/pytroll/satpy/pull/2763) - Replace setup with pyproject.toml
* [PR 2762](https://github.com/pytroll/satpy/pull/2762) - Add support for EO-SIP AVHRR LAC data
* [PR 2753](https://github.com/pytroll/satpy/pull/2753) - Add fsspec support to `li_l2_nc` reader
* [PR 2740](https://github.com/pytroll/satpy/pull/2740) - Add VIIRS L2 Reader ([2729](https://github.com/pytroll/satpy/issues/2729))
* [PR 2696](https://github.com/pytroll/satpy/pull/2696) - Add double alpha channel support and improve metadata behaviours for BackgroundCompositor ([2695](https://github.com/pytroll/satpy/issues/2695))
* [PR 2595](https://github.com/pytroll/satpy/pull/2595) - VGAC decode the time variable

#### Documentation changes

* [PR 2786](https://github.com/pytroll/satpy/pull/2786) - Remove doc references to setup.py ([2782](https://github.com/pytroll/satpy/issues/2782))
* [PR 2766](https://github.com/pytroll/satpy/pull/2766) - Add Data Store to EUMETSAT part
* [PR 2750](https://github.com/pytroll/satpy/pull/2750) - Add missing `h` docstring information to _geos_area.py

In this release 18 pull requests were closed.


## Version 0.47.0 (2024/02/21)

### Issues Closed
Expand Down
4 changes: 2 additions & 2 deletions doc/source/dev_guide/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ and all code should follow the
practices <http://pytroll.github.io/guidelines.html>`_.

Satpy is now Python 3 only and it is no longer needed to support Python 2.
Check ``setup.py`` for the current Python versions any new code needs
Check ``pyproject.toml`` for the current Python versions any new code needs
to support.

.. _devinstall:
Expand Down Expand Up @@ -63,7 +63,7 @@ clone your fork. The package can then be installed in development mode by doing:
The first command will install all dependencies needed by the Satpy
conda-forge package, but won't actually install Satpy. The second command
should be run from the root of the cloned Satpy repository (where the
``setup.py`` is) and will install the actual package.
``pyproject.toml`` is) and will install the actual package.

You can now edit the python files in your cloned repository and have them
immediately reflected in your conda environment.
Expand Down
13 changes: 0 additions & 13 deletions doc/source/dev_guide/plugins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -156,19 +156,6 @@ have a ``etc/`` directory in the root of the package structure. Even so,
for future compatibility, it is best to use the name of the package directory
on the right-hand side of the ``=``.

.. warning::

Due to some limitations in setuptools you must also define a ``setup.py``
file in addition to ``pyproject.toml`` if you'd like to use "editable"
installations (``pip install -e .``). Once
`this setuptools issue <https://github.com/pypa/setuptools/issues/2816>`_
is resolved this won't be needed. For now this minimal ``setup.py`` will
work:

.. code-block:: python
from setuptools import setup
setup()

**Alternative: setup.py**

Expand Down
2 changes: 1 addition & 1 deletion doc/source/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ To install the `satpy` package and the minimum amount of python dependencies:
Additional dependencies can be installed as "extras" and are grouped by
reader, writer, or feature added. Extras available can be found in the
`setup.py <https://github.com/pytroll/satpy/blob/main/setup.py>`_ file.
`pyproject.toml <https://github.com/pytroll/satpy/blob/main/pyproject.toml>`_ file.
They can be installed individually:

.. code-block:: bash
Expand Down
6 changes: 1 addition & 5 deletions satpy/etc/readers/sar-c_safe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ reader:
supports_fsspec: false
sensors: [sar-c]
default_channels: []
reader: !!python/name:satpy.readers.yaml_reader.FileYAMLReader
reader: !!python/name:satpy.readers.sar_c_safe.SAFESARReader
data_identification_keys:
name:
required: true
Expand Down Expand Up @@ -40,19 +40,15 @@ reader:

file_types:
safe_measurement:
file_reader: !!python/name:satpy.readers.sar_c_safe.SAFEGRD
file_patterns: ['{fmission_id:3s}_{fsar_mode:2s}_{fproduct_type:3s}{fresolution:1s}_{fprocessing_level:1s}{fproduct_class:1s}{fpolarization:2s}_{fstart_time:%Y%m%dT%H%M%S}_{fend_time:%Y%m%dT%H%M%S}_{forbit_number:6d}_{fmission_data_take_id:6s}_{fproduct_unique_id:4s}.SAFE/measurement/{mission_id:3s}-{swath_id:2s}-{product_type:3s}-{polarization:2s}-{start_time:%Y%m%dt%H%M%S}-{end_time:%Y%m%dt%H%M%S}-{orbit_number:6d}-{mission_data_take_id:6s}-{image_number:3s}.tiff']
requires: [safe_calibration, safe_noise, safe_annotation]
safe_calibration:
file_reader: !!python/name:satpy.readers.sar_c_safe.SAFEXMLCalibration
file_patterns: ['{fmission_id:3s}_{fsar_mode:2s}_{fproduct_type:3s}{fresolution:1s}_{fprocessing_level:1s}{fproduct_class:1s}{fpolarization:2s}_{fstart_time:%Y%m%dT%H%M%S}_{fend_time:%Y%m%dT%H%M%S}_{forbit_number:6d}_{fmission_data_take_id:6s}_{fproduct_unique_id:4s}.SAFE/annotation/calibration/calibration-{mission_id:3s}-{swath_id:2s}-{product_type:3s}-{polarization:2s}-{start_time:%Y%m%dt%H%M%S}-{end_time:%Y%m%dt%H%M%S}-{orbit_number:6d}-{mission_data_take_id:6s}-{image_number:3s}.xml']
requires: [safe_annotation]
safe_noise:
file_reader: !!python/name:satpy.readers.sar_c_safe.SAFEXMLNoise
file_patterns: ['{fmission_id:3s}_{fsar_mode:2s}_{fproduct_type:3s}{fresolution:1s}_{fprocessing_level:1s}{fproduct_class:1s}{fpolarization:2s}_{fstart_time:%Y%m%dT%H%M%S}_{fend_time:%Y%m%dT%H%M%S}_{forbit_number:6d}_{fmission_data_take_id:6s}_{fproduct_unique_id:4s}.SAFE/annotation/calibration/noise-{mission_id:3s}-{swath_id:2s}-{product_type:3s}-{polarization:2s}-{start_time:%Y%m%dt%H%M%S}-{end_time:%Y%m%dt%H%M%S}-{orbit_number:6d}-{mission_data_take_id:6s}-{image_number:3s}.xml']
requires: [safe_annotation]
safe_annotation:
file_reader: !!python/name:satpy.readers.sar_c_safe.SAFEXMLAnnotation
file_patterns: ['{fmission_id:3s}_{fsar_mode:2s}_{fproduct_type:3s}{fresolution:1s}_{fprocessing_level:1s}{fproduct_class:1s}{fpolarization:2s}_{fstart_time:%Y%m%dT%H%M%S}_{fend_time:%Y%m%dT%H%M%S}_{forbit_number:6d}_{fmission_data_take_id:6s}_{fproduct_unique_id:4s}.SAFE/annotation/{mission_id:3s}-{swath_id:2s}-{product_type:3s}-{polarization:2s}-{start_time:%Y%m%dt%H%M%S}-{end_time:%Y%m%dt%H%M%S}-{orbit_number:6d}-{mission_data_take_id:6s}-{image_number:3s}.xml']


Expand Down
2 changes: 1 addition & 1 deletion satpy/etc/readers/viirs_l1b.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ datasets:
resolution: 743
coordinates: [dnb_lon, dnb_lat]
file_type: vgeod
file_key: geolocation_data/solar_zenith
file_key: geolocation_data/sensor_zenith
DNB_LZA:
name: dnb_lunar_zenith_angle
standard_name: lunar_zenith_angle
Expand Down
9 changes: 6 additions & 3 deletions satpy/readers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ def load_readers(filenames=None, reader=None, reader_kwargs=None):
continue
loadables = reader_instance.select_files_from_pathnames(readers_files)
if loadables:
reader_instance.create_filehandlers(
reader_instance.create_storage_items(
loadables,
fh_kwargs=reader_kwargs_without_filter[None if reader is None else reader[idx]])
reader_instances[reader_instance.name] = reader_instance
Expand Down Expand Up @@ -782,7 +782,7 @@ def _get_compression(file):
return None


def open_file_or_filename(unknown_file_thing):
def open_file_or_filename(unknown_file_thing, mode=None):
"""Try to open the provided file "thing" if needed, otherwise return the filename or Path.
This wraps the logic of getting something like an fsspec OpenFile object
Expand All @@ -796,7 +796,10 @@ def open_file_or_filename(unknown_file_thing):
f_obj = unknown_file_thing
else:
try:
f_obj = unknown_file_thing.open()
if mode is None:
f_obj = unknown_file_thing.open()
else:
f_obj = unknown_file_thing.open(mode=mode)
except AttributeError:
f_obj = unknown_file_thing
return f_obj
2 changes: 1 addition & 1 deletion satpy/readers/abi_l2_nc.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def get_dataset(self, key, info):
self._remove_problem_attrs(variable)

# convert to satpy standard units
if variable.attrs["units"] == "1" and key["calibration"] == "reflectance":
if variable.attrs["units"] == "1" and key.get("calibration") == "reflectance":
variable *= 100.0
variable.attrs["units"] = "%"

Expand Down
Loading

0 comments on commit 72c2f33

Please sign in to comment.