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

Cherry picks of recent PRs to 1.9 #1056

Merged
merged 2 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
rev: 7.1.1
hooks:
- id: flake8
args: ["--ignore=E501", "--select=F401,E201,E202,E203,E502,E241,E225,E306,E231,E226,E123,F811"]
Expand All @@ -15,7 +15,7 @@ repos:
# hooks:
# - id: bandit
- repo: https://github.com/PyCQA/pylint
rev: v3.2.3
rev: v3.2.6
hooks:
- id: pylint
args: ["--disable=C,R,W,E1136"]
8 changes: 4 additions & 4 deletions datacube_ows/wcs1_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,10 +450,10 @@ def get_tiff(req, data):
dst.write(data[band].values, idx)
dst.set_band_description(idx, req.layer.band_idx.band_label(band))
if cfg.wcs_tiff_statistics:
dst.update_tags(idx, STATISTICS_MINIMUM=data[band].values.min())
dst.update_tags(idx, STATISTICS_MAXIMUM=data[band].values.max())
dst.update_tags(idx, STATISTICS_MEAN=data[band].values.mean())
dst.update_tags(idx, STATISTICS_STDDEV=data[band].values.std())
dst.update_tags(idx, STATISTICS_MINIMUM=numpy.nanmin(data[band].values))
dst.update_tags(idx, STATISTICS_MAXIMUM=numpy.nanmax(data[band].values))
dst.update_tags(idx, STATISTICS_MEAN=numpy.nanmean(data[band].values))
dst.update_tags(idx, STATISTICS_STDDEV=numpy.nanstd(data[band].values))
return memfile.read()


Expand Down
9 changes: 5 additions & 4 deletions datacube_ows/wcs2_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import collections
import logging

import numpy
from dateutil.parser import parse
from odc.geo.geobox import GeoBox
from ows.wcs.v20 import ScaleAxis, ScaleExtent, ScaleSize, Slice, Trim
Expand Down Expand Up @@ -382,10 +383,10 @@ def get_tiff(request, data, crs, product, width, height, affine):
dst.write(data[band].values, idx)
dst.set_band_description(idx, product.band_idx.band_label(band))
if cfg.wcs_tiff_statistics:
dst.update_tags(idx, STATISTICS_MINIMUM=data[band].values.min())
dst.update_tags(idx, STATISTICS_MAXIMUM=data[band].values.max())
dst.update_tags(idx, STATISTICS_MEAN=data[band].values.mean())
dst.update_tags(idx, STATISTICS_STDDEV=data[band].values.std())
dst.update_tags(idx, STATISTICS_MINIMUM=numpy.nanmin(data[band].values))
dst.update_tags(idx, STATISTICS_MAXIMUM=numpy.nanmax(data[band].values))
dst.update_tags(idx, STATISTICS_MEAN=numpy.nanmean(data[band].values))
dst.update_tags(idx, STATISTICS_STDDEV=numpy.nanstd(data[band].values))
return memfile.read()


Expand Down
Loading