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

Use core's utilities in subpackages #112

Merged
merged 6 commits into from Jun 2, 2021
Merged

Use core's utilities in subpackages #112

merged 6 commits into from Jun 2, 2021

Conversation

gadomski
Copy link
Member

A couple of the dataset subpackages had defined their own call and/or cogify functions which do more or less the same thing. This pull request adds stactools.core.utils.convert.cogify and updates subpackages to use core's call and cogify instead of their own. The core cogify function has sensible defaults (right now just deflate compression).

When implementing, I discovered that cgls_lc100's cogify was broken due to a dangling '-co' option. As part of the fix, I updated cgls_lc100's test file to a subset of the original external file, since it was mondo and cogifying it was taking forever.

Also includes a small typo fix in README.

This fails due to a bad `cogify` call in cgls_lc100. Also, adds a
subsetted local file to make sure we don't run the tests forever when we
do fix `cogify`.
@gadomski gadomski added the enhancement New feature or request label May 12, 2021
@gadomski gadomski added this to the v0.1.6 milestone May 12, 2021
- Adds `stactools.core.utils.convert.cogify`
- Uses `cogify` and `call` from core when possible instead of defining
  custom calls in subpackages
@gadomski gadomski mentioned this pull request May 27, 2021
2 tasks
@gadomski gadomski requested a review from lossyrob May 27, 2021 19:12
@codecov-commenter
Copy link

codecov-commenter commented May 27, 2021

Codecov Report

Merging #112 (a9cfd43) into master (2c13ad7) will increase coverage by 0.25%.
The diff coverage is 88.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #112      +/-   ##
==========================================
+ Coverage   84.94%   85.20%   +0.25%     
==========================================
  Files          81       82       +1     
  Lines        2471     2453      -18     
==========================================
- Hits         2099     2090       -9     
+ Misses        372      363       -9     
Impacted Files Coverage Δ
stactools_sentinel2/stactools/sentinel2/cog.py 0.00% <0.00%> (ø)
stactools_aster/stactools/aster/cog.py 98.57% <100.00%> (-0.03%) ⬇️
stactools_cgls_lc100/stactools/cgls_lc100/cog.py 100.00% <100.00%> (ø)
stactools_core/stactools/core/utils/convert.py 100.00% <100.00%> (ø)
stactools_corine/stactools/corine/cog.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2c13ad7...a9cfd43. Read the comment docs.

@gadomski gadomski modified the milestones: v0.1.6, v0.2.0 May 28, 2021
Copy link
Member

@lossyrob lossyrob left a comment

Choose a reason for hiding this comment

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

LGTM, one question about the GDAL code but if copying in is the best route then 👍

# DEALINGS IN THE SOFTWARE.
# *****************************************************************************

import os.path
Copy link
Member

Choose a reason for hiding this comment

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

Is there not a way to bring this in as a dependency rather than copy the code in?

Copy link
Member Author

Choose a reason for hiding this comment

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

I didn't find a pip package for it, the Proper Ecosystem Thing™ would probably be to PR https://github.com/rouault/cog_validator w/ pip support. But for now this was the best way I could think of.

@gadomski gadomski merged commit d679cff into stac-utils:master Jun 2, 2021
@gadomski gadomski deleted the feature/use-core-utils branch June 2, 2021 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants