-
Notifications
You must be signed in to change notification settings - Fork 5
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
make cost surface data migration idempotent [MRXN23-478] #1540
base: develop
Are you sure you want to change the base?
make cost surface data migration idempotent [MRXN23-478] #1540
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
just an initial draft for now, right after running the data migration in my local dev env and on marxan23:
Both these things should maybe handled by using a function to pick a UUIDv4 as a sort of hash (sort of what can be done in Java with this library method: https://stackoverflow.com/a/29059595), but I don't think it's worth the effort (of finding a Python equivalent and using it) over "just" syncing the |
The other thing I added in this initial draft is to avoid deleting orphaned scenarios - yes, scenarios with cost data in such a bad shape (=likely not even existing, for whatever reason) are going to be useless in practice, but thinking about doing this in staging and production, I think that by keeping around any scenarios with messed-up data, we wouldn't make things worse than they are, and on the other hand we get a chance to inspect and see what's up. I've seen one such scenario when doing the data migration on m23 and that was a legacy project yadda yadda, plus there were 4 default cost surfaces for which we didn't have min/max data, which was likely because of some mess-up of the project grid (no PUs? some bug in some specific way of creating the grid so that no |
… cost surface Avoid automatically deleting the scenario: we log the anomalous situation and arbitrarily set the cost surface's range to [0,0]. In practice, the scenario that uses such cost surface may have contained invalid or incomplete data to start with, so setting an arbitrary range may not really matter here (as in, it should not make things worse).
fb78313
to
8111fd0
Compare
For context: https://vizzuality.atlassian.net/browse/MRXN23-478