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

Add classification extension #1093

Merged
merged 1 commit into from
May 31, 2023

Conversation

jpolchlo
Copy link
Contributor

@jpolchlo jpolchlo commented Apr 11, 2023

Related Issue(s):
Closes #788

Description:
This PR adds the Classification Extension to pystac.

PR Checklist:

  • pre-commit hooks pass locally
  • Tests pass (run scripts/test)
  • Documentation has been updated to reflect changes, if applicable
  • This PR maintains or improves overall codebase code coverage.
  • Changes are added to the CHANGELOG. See the docs for information about adding to the changelog.

@jpolchlo jpolchlo force-pushed the feature/classification-extension branch from c3aa8c6 to ad2d49e Compare April 11, 2023 15:49
@jsignell
Copy link
Member

In case it's helpful I have some pytest-style extension tests in #1088

@codecov-commenter
Copy link

codecov-commenter commented Apr 11, 2023

Codecov Report

Patch coverage: 95.61% and project coverage change: +0.39 🎉

Comparison is base (37dcf01) 90.52% compared to head (b07864b) 90.91%.

❗ Current head b07864b differs from pull request most recent head 9e7a1a7. Consider uploading reports for the commit 9e7a1a7 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1093      +/-   ##
==========================================
+ Coverage   90.52%   90.91%   +0.39%     
==========================================
  Files          48       49       +1     
  Lines        6355     6606     +251     
  Branches      944      970      +26     
==========================================
+ Hits         5753     6006     +253     
+ Misses        426      421       -5     
- Partials      176      179       +3     
Impacted Files Coverage Δ
pystac/extensions/classification.py 95.60% <95.60%> (ø)
pystac/__init__.py 94.54% <100.00%> (+0.10%) ⬆️

... and 2 files with indirect coverage changes

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

@jpolchlo
Copy link
Contributor Author

@jsignell I modeled my tests after the EO extension tests, are we saying that the pytest style is now preferred?

@jsignell
Copy link
Member

@jsignell I modeled my tests after the EO extension tests, are we saying that the pytest style is now preferred?

Yeah the plan is to move all the tests to pytest eventually #993

@gadomski gadomski added the extension Implement a STAC extension in PySTAC label Apr 12, 2023
@gadomski gadomski added this to the 1.8 milestone Apr 12, 2023
@jpolchlo jpolchlo force-pushed the feature/classification-extension branch 2 times, most recently from 84c0360 to 1cf260b Compare May 4, 2023 22:28
@jpolchlo
Copy link
Contributor Author

jpolchlo commented May 4, 2023

@gadomski You can flick your eyes over this. Tests need to get revamped, but the interface seems fine now.

@gadomski gadomski self-requested a review May 8, 2023 19:14
pystac/extensions/classification.py Outdated Show resolved Hide resolved
pystac/extensions/classification.py Outdated Show resolved Hide resolved
tests/extensions/test_classification.py Outdated Show resolved Hide resolved
tests/extensions/test_classification.py Outdated Show resolved Hide resolved
tests/extensions/test_classification.py Outdated Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
@jpolchlo jpolchlo marked this pull request as ready for review May 11, 2023 23:34
@jpolchlo jpolchlo force-pushed the feature/classification-extension branch 2 times, most recently from dd661f5 to 7f68a67 Compare May 23, 2023 13:28
@jpolchlo jpolchlo requested a review from gadomski May 23, 2023 14:47
Copy link
Member

@gadomski gadomski left a comment

Choose a reason for hiding this comment

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

Can you add a test to ensure we can open an object that has the older classification version, ala https://github.com/stac-utils/pystac/pull/1131/files#diff-89b2d9c743703076080598ace41425b7270c1c0dc767f431ff7cab1c2b396b70R428-R443

pystac/extensions/classification.py Outdated Show resolved Hide resolved
tests/extensions/test_classification.py Outdated Show resolved Hide resolved
@jpolchlo jpolchlo force-pushed the feature/classification-extension branch from 5b2216d to c3ef53d Compare May 25, 2023 18:07
@jpolchlo jpolchlo requested a review from gadomski May 25, 2023 18:44
gadomski
gadomski previously approved these changes May 25, 2023
@gadomski gadomski force-pushed the feature/classification-extension branch from c3ef53d to 84a1a3d Compare May 25, 2023 18:52
@gadomski gadomski enabled auto-merge May 25, 2023 18:52
@gadomski gadomski disabled auto-merge May 25, 2023 18:53
Copy link
Member

@gadomski gadomski left a comment

Choose a reason for hiding this comment

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

@jpolchlo sorry, I'm not seeing the test to ensure we can read v1.0.0...am I missing it?

@jpolchlo
Copy link
Contributor Author

@gadomski All of the examples in tests/data-files/classification use the 1.0.0 version. I'll update one to use 1.1.0 as well to be sure our bases are covered?

@jpolchlo jpolchlo force-pushed the feature/classification-extension branch from 84a1a3d to 255a077 Compare May 25, 2023 19:27
@gadomski
Copy link
Member

@gadomski All of the examples in tests/data-files/classification use the 1.0.0 version. I'll update one to use 1.1.0 as well to be sure our bases are covered?

Ah gotcha. Yeah, whatever version the test files are in, I'd like to make an explicit test that the other version works too (aka you can access the extension object and its properties). Thanks.

@jpolchlo
Copy link
Contributor Author

Are you proposing that each test be run twice for each version of the extension? Given how these extensions work, it feels like it should be enough to simply show that the different versions can be read by the extension, since all the functionality is otherwise identical. The code coverage report is showing that nearly all of the code pathways are exercised by the tests provided, and because in this case the 1.1.0 version is a superset of the 1.0.0 version, it feels like the work done here should be sound. Let me know if that's incorrect.

@gadomski
Copy link
Member

Are you proposing that each test be run twice for each version of the extension?

No, just a single test to ensure that we can read the version not in the fixtures, e.g. https://github.com/stac-utils/pystac/pull/1131/files#diff-89b2d9c743703076080598ace41425b7270c1c0dc767f431ff7cab1c2b396b70R428-R443

@gadomski gadomski dismissed their stale review May 26, 2023 13:39

Need one more test to ensure we can handle both versions

@jpolchlo jpolchlo force-pushed the feature/classification-extension branch from 255a077 to 7097b59 Compare May 30, 2023 16:12
@jpolchlo jpolchlo requested a review from gadomski May 30, 2023 17:03
@gadomski gadomski force-pushed the feature/classification-extension branch from b07864b to 9e7a1a7 Compare May 31, 2023 12:01
@gadomski gadomski enabled auto-merge May 31, 2023 12:01
@gadomski gadomski added this pull request to the merge queue May 31, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks May 31, 2023
@gadomski gadomski added this pull request to the merge queue May 31, 2023
Merged via the queue into stac-utils:main with commit 0829db8 May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension Implement a STAC extension in PySTAC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Classification Extension
4 participants