globalgov / manydata

The portal for global governance data
https://manydata.ch
GNU Affero General Public License v3.0
9 stars 0 forks source link

Setup `dbcomp()` to be consistent with ploting function as well as with new dataset structure #224

Closed henriquesposito closed 2 years ago

henriquesposito commented 2 years ago

The code in the function not only needs to be made more concise but also, since dbplot() and dbcomp() are very similar, dbcomp() should be adapted so that it is called within dbplot() to avoid unnecessary code duplication across functions.

As well, with the new HUGGO and AIGOO structure, make sure the function does not return unnecessary hand-coded (already checked/worked on) obs in HUGGO to facilitate work on where it matters.

henriquesposito commented 2 years ago

A first attempt to make the functions more cohesive has been added.

henriquesposito commented 2 years ago

todo: add tests for functions

henriquesposito commented 2 years ago

Functions are a bit more concise and cohesive now and tests were added for both db functions.

For now I have left the messydates related portions to reduce precision for matching commented out, though they work for year only dates (might need to be expanded if we choose to do so). As I said elsewhere, the more I look into this the more I think reducing precision might actually defeat the purposes of messydates...