GeoscienceAustralia / dea-notebooks

Repository for Digital Earth Australia Jupyter Notebooks: tools and workflows for geospatial analysis with Open Data Cube and Xarray
https://docs.dea.ga.gov.au/notebooks/
Apache License 2.0
448 stars 128 forks source link

Allow `subpixel_contours` time format to be customised #1065

Closed robbibt closed 1 year ago

robbibt commented 1 year ago

Proposed changes

A small PR, mainly to test whether our new tests allow us to successfully add features to dea-tools functions without breaking existing code. The new tests successfully caught several issues with the PR, and pass now that they were fixed!

The specific change allows users to customise how dates are formatted in a geopandas object returned by the subpixel_contours function, e.g.:

image

For example, a user may want dates to be formatted like "%Y-%m-%d" (the default), or like "%Y", "%Y-%m" etc. This change replaced the previous approach of crudely converting dates to a string then clipping them to the first 10 characters (str(i)[0:10]).

(This update will be required for any future updates to DEA Coastlines that require sub-annual shorelines)