TIBHannover / BacDiveR

Inofficial R client for the DSMZ's Bacterial Diversity Metadatabase (former contact: @katrinleinweber). https://api.bacdive.dsmz.de/client_examples seems to be the official alternatives.
https://TIBHannover.GitHub.io/BacDiveR/
MIT License
10 stars 12 forks source link

Number before "Data download..." message & warn_slow_download() afterwards #84

Closed katrinleinweber closed 5 years ago

katrinleinweber commented 6 years ago

I noticed the following problem....

dataset_Bss <- retrieve_data(searchTerm = "Bacillus subtilis subtilis")
 2 Data download in progress for BacDive-IDs: 1156 1157 1158 [...] Warning message:
In warn_slow_download(payload$count) :
  131 BacDive datasets are being downloaded... Please note: Depending on your internet connection speed, and the BacDive server load right now, this might take some time and may cause R(Studio) to become temporarily unresponsive. Maybe go for a walk for a few (I'm guessing: 0.5 to 0.7) minutes ;-)

On: R version 3.5.0 (2018-04-23); Platform: x86_64-w64-mingw32/x64 (64-bit).

I have...
katrinleinweber commented 5 years ago

The number must be the number of pages.

Same reason why there is a space in front of Data download...: https://github.com/TIBHannover/BacDiveR/blob/b13a703f10c47798f4ae22606d386075732f744d/R/retrieve_data.R#L63

But I can't move this to https://github.com/TIBHannover/BacDiveR/blob/b13a703f10c47798f4ae22606d386075732f744d/R/aggregate_datasets.R#L14, because then it will not get executed for each dataset.

Maybe switch to a progress bar entirely, see #56?

katrinleinweber commented 5 years ago

Also, warn_slow_download() is only called from retrieve_data(), not from retrieve_search_results() :-/

=> Create 1 unified message regardless of download size.