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

Strict option for cogeo validation #109

Merged
merged 3 commits into from Dec 2, 2019

Conversation

pierotofy
Copy link
Contributor

Hello ✋

I propose the addition of a "strict" flag to threat warnings as errors for the purposes of validation.

There are situations in which this might be desirable (eg. trying to determine whether a GeoTIFF is suited for streaming, overviews lacking are warnings, but affect performance significantly).

@vincentsarago
Copy link
Member

vincentsarago commented Nov 27, 2019

thanks for the pr @pierotofy
I'm glad I'm not the only one wanting overview in COG by default :-)
ref: #79

strict seems a bit odd because the specification says overviews are optional, maybe something like --force-overviews might make more sense ?

@pierotofy
Copy link
Contributor Author

pierotofy commented Nov 27, 2019

I borrowed the "strict" term from compilers, where warnings do not preclude a program from being compiled or running properly, but I can rename it to something else if you want.

I thought strict was more generic since it doesn't look just at overviews, but all warnings.

@vincentsarago
Copy link
Member

I thought strict was more generic since it doesn't look just at overviews, but all warnings.

@pierotofy good point. yeah --force-overviews doesn't really make sense then (except if we add the option per say into cog_validate). Still strict feels a bit strong because the warning here is more an opinion than a proper warning (from the specification POV)

@pierotofy
Copy link
Contributor Author

Mm, warnings_as_errors ? fail_on_warn?

@vincentsarago
Copy link
Member

@pierotofy sorry for being slow to catch up, I've changed my mind and --strict seems a reasonable option so let's move forward.

Could you please add a --strict option in the CLI and make sure to run black on the files you changed ?

@pierotofy
Copy link
Contributor Author

No worries, life keeps all of us busy.

I've made the changes as indicated, let me know if turher modifications are needed 👍

@vincentsarago
Copy link
Member

thanks @pierotofy
I'm sorry but could you please run black on the cli too ?
and if it's not too much to ask, could you add some tests too ?

@pierotofy
Copy link
Contributor Author

Not very familiar with black, but I did run it on all files in the project (including cli).

# black .
All done! ✨ 🍰 ✨
16 files left unchanged.
#

I can add a test; do you have a fixture already made that doesn't have overviews?

@vincentsarago
Copy link
Member

thanks @pierotofy I think I can take it from here ;-)

@vincentsarago vincentsarago mentioned this pull request Dec 2, 2019
@vincentsarago vincentsarago merged commit 7513f5c into cogeotiff:master Dec 2, 2019
@pierotofy
Copy link
Contributor Author

Thanks @vincentsarago !

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