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

Allow open date range in dc load and find_datasets #1443

Merged
merged 5 commits into from May 22, 2023
Merged

Conversation

Ariana-B
Copy link
Contributor

@Ariana-B Ariana-B commented May 17, 2023

Reason for this pull request

As raised by @robbibt, #183 was closed without having been resolved. The logic introduced in #1439 to support open-ended date ranges in datacube dataset search, can be used to allow them in dc.load() and dc.find_datasets() as well.

Proposed changes

  • Handle None dates in _time_to_search_dims rather than in a separate function

  • Closes Allow open-ended time ranges #183

  • Tests added / passed

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


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

@codecov
Copy link

codecov bot commented May 18, 2023

Codecov Report

Patch coverage: 71.42% and project coverage change: +0.05 🎉

Comparison is base (72ccd88) 91.77% compared to head (a62757c) 91.82%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1443      +/-   ##
===========================================
+ Coverage    91.77%   91.82%   +0.05%     
===========================================
  Files          132      132              
  Lines        14490    14485       -5     
===========================================
+ Hits         13298    13301       +3     
+ Misses        1192     1184       -8     
Impacted Files Coverage Δ
datacube/api/core.py 95.64% <ø> (ø)
datacube/ui/expression.py 74.07% <33.33%> (ø)
datacube/api/query.py 93.83% <100.00%> (+3.56%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@Ariana-B Ariana-B changed the title Allow open date range in dc search and find_datasets Allow open date range in dc load and find_datasets May 19, 2023
Even with open bounds, dates are still inclusive of the start and end dates. Minor update to wording to make this clearer
Copy link
Contributor

@robbibt robbibt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fantastic @Ariana-B - I've tested every edge case I can think of and it all seems to work as intended.

The date ranges do seem to still be inclusive (e.g. (None, '2000') includes data up to 2000-12-31), so I've made a small update to the documentation to make this clearer. Please let me know if this isn't the intention! (although I think being inclusive for open ranges works fine for consistency with existing inclusive time filtering).

@robbibt robbibt merged commit 3506cff into develop May 22, 2023
25 checks passed
@robbibt robbibt deleted the load_open_ranges branch May 22, 2023 02:44
SpacemanPaul added a commit that referenced this pull request Jun 21, 2023
…h. (#1459)

* GitHub actions fixes (#1433)

* Github action fixes, backported from develop-1.9

* Updates to whats_new.rst

* Capitalise "Dependabot" in whats_new.rst

* Remove duplicate GHA Workflow for docs

We used to deploy to netlify for docs previews, but now that's done to
Read The Docs. The old Workflow should be removed.

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

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

* Display error message instead of help message if a required argument isn't provided

* update whats_new

* print error message as well as usage info

* add license hook to pre-commit

* update license template and instructions, and whats_new

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add > and < to lark grammar

* refine logic

* use timestamp 0 as lowest bound instead of hardcoded date

* update whats_new

* update doco

* update whats_new

* Allow open date range in dc load and find_datasets (#1443)

* support open ended date range in query init

* allow open ended time ranges in load() and find_datasets(), also simplify logic for cli

* update doco and whats_new

* get end of datetime.now() to avoid failing tests due to second mismatches

* Minor update to documentation

Even with open bounds, dates are still inclusive of the start and end dates. Minor update to wording to make this clearer

---------

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

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

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

* add archive_less_mature option to add and update

* update whats_new

* add warning message in memory driver

* Pass X and Y Scale factors through to rasterio.warp.project. (#1450)

* Pass X and Y Scale factors through to rasterio.warp.project. Update whats_new

* Update PR number in whats_new.rst

* Remove unused import.

* Cleanup.

* Cleanup.

* Should probably just add it to the dictionary tbh.

* Respond to Kirill's comments.

* remove lineage from docs

* move archive_less_mature to abstract and allow for postgres

* move find dupes logic into a separate function

* update whats_new

* allow for a bit of leniency in datetime comparison when searching for less mature, add test case

* update whats_new

* properly add new files

* fix failing tests

* refactor doc_to_ds without adding dataset logic

* Add missing PR's to whats_new.rst and prepare for 1.8.13 release. (#1453)

* Fix gha pypi publishing condition (#1454)

* fix gha pypi publishing condition

* update whats_new

---------

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

* update ubntu installation instructions

* update wordlist

* update readme

* update wordlist again

* add a bit more info on db env variables; other misc improvements

* update barebones metadata type requirements

* fix typos, update wordlist

* fix some wording

* update integration db names

* rename agdcintegration.conf

* Always use XSCALE=1,YSCALE=1 in warp. (#1457)

* Use SCALEX=1,SCALEY=1 in both warp code-paths.

* remove data preparation page, add links to indexing guide

* fix typo, del data preparation scripts page

* increase buffer to 500ms

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: Damien Ayers <damien@omad.net>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Ariana Barzinpour <ariana.barzinpour@ga.gov.au>
Co-authored-by: Ariana-B <40238244+Ariana-B@users.noreply.github.com>
Co-authored-by: Robbi Bishop-Taylor <Robbi.BishopTaylor@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.

Allow open-ended time ranges
2 participants