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

Improving logic and extensibility #9

Merged
merged 50 commits into from
Sep 18, 2023
Merged

Improving logic and extensibility #9

merged 50 commits into from
Sep 18, 2023

Conversation

Ariana-B
Copy link
Contributor

@Ariana-B Ariana-B commented Aug 1, 2023

Figuring out what belongs in eo3 vs eo-datasets, how logic can be improved and ensure extensibility with eo-datasets and datacube-core

  • Redesign DatasetDocBase as DatasetMetadata, a hybrid between eo-dataset's DatasetDoc and datacube-core's DocReader, without requiring an existing index
    • DatasetMetadata uses a metadata type file (base eo3 by default, can be updated) to parse a raw dataset dict, while also providing access to fields not defined by the metadata, such as the raw properties dict, locations, grids, geometry, measurements
    • without_lineage function allows DatasetMetadata to replace core's SimpleDocNav functionality
    • dataset by default validated against dataset schema and metadata type, can provide dictionaries for product and semantic validation
  • Remove files that should belong in eo-datasets
  • Clean up some duplications
  • Copy over fields.py from datacube-core
  • Simplify validation methods and rework warning/error handling

Kirill888 and others added 30 commits August 15, 2018 05:50
Allows extraction of search fields from dataset metadata without dependencies on
db driver.
To avoid circular dependency issues, `Field` is used as input to `MetadataType`
constructor, `Expression` is output of `Field` methods, but then Field needs
`Range` which is defined in `model`
- Test supplying credentials from outside for session creation
- Test failure to obtain credentials
This is needed for `s3_{dump|fetch}` running in "remote" mode, i.e. with dask
Change to import mock from unittest.mock, which has been available in
the standard library since Python 3.3, well below our minimum.
* Utility to function to obtain IAM auth token.

* Hook IAM auth into engine instantiation.

* Return last token if not getting a new one.

* Cleanup coding style.

* Cleanup coding style.

* Cleanup coding style - how deep an indent does it want?

* Pass region name in test.

* s/region/region_name/  oops.

* Pass region name when creating boto3 client.

* Fix obtain_new_iam_auth_token() function signature.

* Move iam config into config layer.

* Make options and env var names more consistent.

* Test environment parser.

* Removed hard-to-test and unnecessary exception conversion.

* Add documentation.

* Update whats_new.rst

Co-authored-by: phaesler <[email protected]>
SpacemanPaul and others added 4 commits June 6, 2022 15:04
…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 <[email protected]>
Co-authored-by: Robbi Bishop-Taylor <[email protected]>

* [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 <[email protected]>

* 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 <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Ariana Barzinpour <[email protected]>
Co-authored-by: Ariana-B <[email protected]>
Co-authored-by: Robbi Bishop-Taylor <[email protected]>
…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 <[email protected]>
Co-authored-by: Robbi Bishop-Taylor <[email protected]>

* [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 <[email protected]>

* 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 <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Ariana Barzinpour <[email protected]>
Co-authored-by: Ariana-B <[email protected]>
Co-authored-by: Robbi Bishop-Taylor <[email protected]>
@codecov
Copy link

codecov bot commented Aug 1, 2023

Codecov Report

Patch coverage: 89.90% and project coverage change: +11.70% 🎉

Comparison is base (11fe482) 68.14% compared to head (d8f8bce) 79.85%.
Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff              @@
##           develop       #9       +/-   ##
============================================
+ Coverage    68.14%   79.85%   +11.70%     
============================================
  Files           22       20        -2     
  Lines         2945     1931     -1014     
============================================
- Hits          2007     1542      -465     
+ Misses         938      389      -549     
Files Changed Coverage Δ
eo3/properties.py 46.72% <44.00%> (-30.56%) ⬇️
eo3/serialise.py 58.25% <83.33%> (-27.33%) ⬇️
eo3/fields.py 84.00% <84.00%> (ø)
eo3/schema/schema.py 85.71% <85.71%> (ø)
eo3/utils/utils.py 86.69% <92.85%> (ø)
eo3/model.py 93.88% <93.08%> (-6.12%) ⬇️
eo3/eo3_core.py 99.09% <96.96%> (+36.09%) ⬆️
eo3/validate.py 96.90% <96.96%> (+21.54%) ⬆️
eo3/__init__.py 100.00% <100.00%> (ø)
eo3/metadata/validate.py 100.00% <100.00%> (ø)
... and 8 more

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

Copy link
Contributor

@SpacemanPaul SpacemanPaul left a comment

Choose a reason for hiding this comment

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

Looking good so far.

eo3/fields.py Show resolved Hide resolved
eo3/metadata/default-eo3-type.yaml Outdated Show resolved Hide resolved
eo3/__init__.py Outdated Show resolved Hide resolved
eo3/properties.py Show resolved Hide resolved
@Ariana-B Ariana-B marked this pull request as ready for review August 31, 2023 04:40
@SpacemanPaul SpacemanPaul self-requested a review September 4, 2023 00:27
Copy link
Contributor

@SpacemanPaul SpacemanPaul left a comment

Choose a reason for hiding this comment

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

It's a beast of a PR and I've probably missed something, but it looks like it ticks all the boxes we discussed.

@Ariana-B Ariana-B requested a review from omad September 5, 2023 04:55
@Ariana-B Ariana-B merged commit fc62285 into develop Sep 18, 2023
7 checks passed
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.

6 participants