Closed denised closed 2 years ago
@johnpaulalex For some reason I can't select you as a reviewer, but I would appreciate it if you would take a look at this code.
Thank you @johnpaulalex for the very helpful review. I have included some lightweight pytest tests for the new code, but the more in-depth testing I did was a side-by-side comparison of the old and new implementations on all the recently imported solutions. (Which doesn't yet include any land models, so I will make a point of doing one of those soon.)
...And I just now spent a a few hours adding more testing of error/edge cases... which netted four bugs, so here's to testing :-)
While extracting a solution I had an issue with VMAs, and found myself getting lost in the vma extraction code (not for the first time). So this is a rewrite, aimed at readability. It has almost exactly the same functionality as the original, with some simplifications. Its a little slower, because it does multiple passes over the data. On the plus side, it doesn't have any hardwired dependencies on tab names, rows or columns. But mostly, I believe it is a lot easier to read, so when issues arise it should be much easier to understand what is causing them.
I also revised some functionality in util.py, and created a single "turn a string into a filename" function that is shared between both extraction modules.