-
-
Notifications
You must be signed in to change notification settings - Fork 327
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
temporal: update raster map metadata from file DB when overwrite is true #3374
Conversation
After digging a bit more, I see that the actual issue is that the creation time is not loaded from the GRASS map: However, that indicates that creation_time for e.g. a raster map in TGIS rather means registration_time ... Is it OK if I change the content of that attribute to represent what it actually says it represents? Or does it have to remain to mean registration_time. Are there any use cases for the latter? Or would that be considered API break? |
Anyone with an opinion or with capacity to review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've read through. I can only pronounce myself on the Python itself. I can't comment on the correct usage of the other functions (C and Python) of the project, on the correct kind of implementation, the correct location of the new code, if the tests test the good thing, or the need itself for these changes. Another one would need to approve these other aspects.
Co-authored-by: Edouard Choinière <[email protected]>
Co-authored-by: Edouard Choinière <[email protected]>
I am not sure I understand the use case right. Let's say for eg. last year you estimated annual anomalies using a long term mean and sd map. By the end of this year, you'll need to estimate new long term mean and sd maps and recalculate all annual anomalies. In that case all annual anomalies and long term maps would be different from those before even if they keep the same name, so I would expect they change the creation time indeed... for the registration time though, I'm not sure... it will be the same map name, but not the same map... Which is your use case? |
My use-case are satellite images. If I download all images ingested yesterday, I may get images with a sensing time up to a month back in time (or even more in case something is re-processed). |
I see, makes sense to me. |
Forgot to mention, once the map is registered, creation_time is never updated and I can no longer select maps that were updated that way... |
I now tested re-registering a map with and without this PR, and I see how the creation_time changes... It does not set the right date though, I hope that's something in my laptop only 😲
|
Co-authored-by: Veronica Andreo <[email protected]>
Can you post the output of |
Date remains unchanged there, should it change as well?
|
Thanks, @veroandreo Looks like creation_time for that map is set correctly. With this PR creation_date in the TGIS database reflects date (creation time) in the file database, and thus should be equal to that. And that seems to be the case in your test as well, no? |
Seems the latest commit dismissed your previous approving reviews... |
@ninsbl You are free to merge! |
Thanks, @nilason |
…rue (#3374) * update from file DB * add history functions * add history functions * linting and some reverts * add tests * use History from libraster * dbif and is_in_db * Update python/grass/temporal/testsuite/test_register_function.py Co-authored-by: Edouard Choinière <[email protected]> * Update python/grass/temporal/testsuite/test_register_function.py Co-authored-by: Edouard Choinière <[email protected]> * avoid duplicate function calls in loop * Update python/grass/temporal/testsuite/test_register_function.py Co-authored-by: Veronica Andreo <[email protected]> --------- Co-authored-by: Edouard Choinière <[email protected]> Co-authored-by: Veronica Andreo <[email protected]>
Currently, metadata like e.g. "creation_time" is not updated, when e.g. a raster map is re-created and then attempted to be re-registered. Metadata is loaded from the temporal DB (map_object.select()) and then written back to the temporal DB.
So, currently, metadata is not updated...
This PR forces reloading of map metadata from the file DB, when a map is in the temporal DB and registered again with overwrite true...
May require more documentation and a unit test...
Syntax is updated to be less Python2 like (replaced % string formating)...