Add citation argument to get_x_projects()#518
Conversation
This reverts commit 1759edc.
… : add multiple project code support
…ing role or orderNr return objects
|
I made all requested changes. You can merge if you don't feel a second review is necessary. I also messed with the logic on how to select the contact person a bit, handling more edge cases. |
citations argument to get_acoustic_projects() and get_animal_projects()citation argument to get_x_projects()
peterdesmet
left a comment
There was a problem hiding this comment.
I have the impression something seems to be going wrong with the citation. It's empty more often than before. E.g. it's empty for 2014_demer.
Added some extra tests, and fixed the bug in the string building. |
|
Tests are dependent on the specific IMIS datasets not changing (adding or removing dois would break things). I see 2 solutions, both adding complexity to the tests:
|
peterdesmet
left a comment
There was a problem hiding this comment.
Looks great, @PieterjanVerhelst should be happy with this new functionality.
@PieterjanVerhelst, you can try this out with:
get_animal_projects(citation = TRUE)
In this PR I've added a helper
cite_imis_dataset()that handles parallel requests to MarineInfo/IMIS and parses the output to a rectangular format. This is actually quite a hassle because there are a lot of exceptions in the data.This helper is called by
get_acoustic_projects()andget_animal_projects()to add a few columns with citation information when the user sets the argumentcitation = TRUE.In the end I decided to keep all functionality together in one big helper. I could split off the parsing and the request logic. That's not too much hassle but I didn't see much short term benefit.
Tests use cached HTTP responses by default because MarineInfo/IMIS takes a while to respond. This is also why I don't add citation information by default.
I'm very open to all feedback!
Todo
Solve encoding issue:   is probably the causeEncoding issue for JSON download from marineinfo #521Re enable encoding testsMove IMIS/Marineinfo query code to helper? Add flexiblity to make adding/changing columns easier in the future.-> Out of scopeReview comments
get_animal_projects(animal_project_code = "ADST-Shark", citation = TRUE)Encoding issue
The encoding issue is probably due to an interpretation difference in non breaking spaces between ISO-8859-1 and UTF-8. This stackoverflow thread might hold the solution: https://stackoverflow.com/questions/1461907/html-encoding-issues-%C3%82-character-showing-up-instead-of-nbsp