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

Make solar_date() timezone aware. #1521

Merged
merged 1 commit into from Dec 12, 2023
Merged

Make solar_date() timezone aware. #1521

merged 1 commit into from Dec 12, 2023

Conversation

SpacemanPaul
Copy link
Contributor

@SpacemanPaul SpacemanPaul commented Dec 12, 2023

Reason for this pull request

The datacube.api.query.solar_date() function takes a dataset object and calculates it's local solar date, based on center time and central longitude. However, it assumes that the dataset center_time is in UTC timezone. If the the center_time is in some other timezone, an incorrect date may be returned.

See also: opendatacube/datacube-ows#979

Proposed changes

  • Call .astimezone(utc) on the center time before doing solar date calculations.

  • Tests added / passed

  • Fully documented, including docs/about/whats_new.rst for all changes


📚 Documentation preview 📚: https://datacube-core--1521.org.readthedocs.build/en/1521/

Copy link

codecov bot commented Dec 12, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (9fb8c8c) 91.75% compared to head (e77ee0d) 91.79%.
Report is 3 commits behind head on develop.

Files Patch % Lines
datacube/index/memory/_datasets.py 80.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1521      +/-   ##
===========================================
+ Coverage    91.75%   91.79%   +0.03%     
===========================================
  Files          132      132              
  Lines        14552    14617      +65     
===========================================
+ Hits         13352    13417      +65     
  Misses        1200     1200              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@SpacemanPaul SpacemanPaul merged commit b872aff into develop Dec 12, 2023
31 checks passed
@SpacemanPaul SpacemanPaul deleted the fix-solar-day-tz branch December 12, 2023 03:10
SpacemanPaul added a commit that referenced this pull request Dec 19, 2023
SpacemanPaul added a commit that referenced this pull request Dec 20, 2023
* Update whats_new.rst for 1.8.17 release. (#1510)

* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/adrienverge/yamllint.git: v1.32.0 → v1.33.0](https://github.com/adrienverge/yamllint.git/compare/v1.32.0...v1.33.0)

* Bump conda-incubator/setup-miniconda from 2 to 3

Bumps [conda-incubator/setup-miniconda](https://github.com/conda-incubator/setup-miniconda) from 2 to 3.
- [Release notes](https://github.com/conda-incubator/setup-miniconda/releases)
- [Changelog](https://github.com/conda-incubator/setup-miniconda/blob/main/CHANGELOG.md)
- [Commits](conda-incubator/setup-miniconda@v2...v3)

---
updated-dependencies:
- dependency-name: conda-incubator/setup-miniconda
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Dataset CLI tool to find duplicates (#1517)

* add dataset cli tool to find duplicates

* convert timestamps to UTC

* update whats_new

* update memory driver search duplicates implementation

---------

Co-authored-by: Ariana Barzinpour <ariana.barzinpour@ga.gov.au>

* Make solar_date() timezone aware. (#1521)

* Warn if non-eo3 dataset has eo3 metadata type (#1523)

* warn if non-eo3 dataset has eo3 metadata type

* fix str contains

* add test

---------

Co-authored-by: Ariana Barzinpour <ariana.barzinpour@ga.gov.au>

* Fix merge oops

* Resolve some merge issues arising fromm differences between SQLAlchemy 1.4 and 2.0.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ariana-B <40238244+ariana-b@users.noreply.github.com>
Co-authored-by: Ariana Barzinpour <ariana.barzinpour@ga.gov.au>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants