NEOTOMA_TIMEOUT and NEOTOMA_RETRIES
still override both.limit and offset now describe the whole
answer when a long list of ids is split into several requests.
get_sites(1:1000, limit = 10) returned 100 sites, because
every batch of ids was given the limit; it returns 10, from
one request.limit and offset give the same records
whatever the page size. all_data = TRUE still requests 2000
records per page; set the environment variable NEOTOMA_PAGE
(for example Sys.setenv(NEOTOMA_PAGE = 500)) for smaller
pages. Older servers lose records when walked in small pages, so keep
the default there.datasettype takes several values
(datasettype = c("pollen", "diatom")) in
get_sites() and get_datasets().get_downloads():
collunit@collectors (a list of names) and, on each sample,
analysisunitnotes, analysisdate and
samplenotes. set_site() now records
area, and a collection unit’s gpslocation is a
one-row sf point, so sf::st_coordinates()
works on it. The fields are empty until the Neotoma database functions
that supply them are updated.Retry-After header on a 429 or
503 is honoured.neotoma2/<version> (R <version>). Set
options(neotoma2.contact = "you@example.org") or the
NEOTOMA_CONTACT environment variable to add a contact
address.get_table() keeps its answer for the rest of the
session (use refresh = TRUE to ask again), and
get_downloads() requests long vectors of dataset IDs in
batches of 25 and keeps the answers for the session.
options(neotoma2.cache = FALSE) turns the cache off.get_downloads() no longer repeats a failed request with
its arguments removed.data/taxa,
data/publications or other endpoints without a POST route
is now sent as several short GET requests, instead of a
POST the API answered with a redirect to its
documentation.get_downloads() request that used
all_data = TRUE sent a malformed list of dataset IDs, which
the API rejected with an HTTP 500.The API said: ...), in both the current response shape
(data: null, message) and the earlier one (the
error in data).https.
http://api-dev... redirects to https, and the
redirect turned a POST into a GET without its
body, so a spatial (loc) query sent with
set_server("dev") came back as the unfiltered first page of
records. A POST now also keeps its method and body through
any redirect.get_sites(),
get_datasets() and get_downloads() are sent as
POST requests in chunks of 100, as the API accepts them
there, and a long list of filter values (for example many taxon names)
is sent as a POST body instead of a URL too long to send.
An answer that does not match the IDs asked for raises an error instead
of being returned.get_taxa() was rewritten.
get_taxa(<id>) used to ask for datasets with no taxon
filter at all; get_taxa(taxa = ) passed a function in place
of the names; all_data, datasettype,
loc, limit and other arguments were dropped or
ignored. It now forwards them, never requests datasets without a taxon
filter, and warns before sending more than 25 taxon names in one
request.get_taxon(taxonname = "Pinus%") now returns every page
of matches (all_data defaults to TRUE, as
documented) instead of only the first, and a taxon record without a
taxagroupid no longer makes it fail.
get_taxon(numeric(0)) returns NULL.all_data is now honoured in get_datasets()
and get_downloads() when called on a sites
object; the argument was previously ignored.count() to tally sites, collection units, or
datasets in a record object.samples() gains a chronname argument to
report ages against a chosen chronology.filter() now handles multiple conditions together with
spatial (loc) filters.parseURL() and automatic retry when the API is
temporarily unavailable.all_data = TRUE stops as soon as a page comes back
short, rather than spending an extra request to confirm the end of the
results. Queries whose results fit in one page now cost one request
instead of two.loc) queries worse rather than better; other
transient failures still retry as before.get_*() call.chronologies() function to show a data frame
instead of the raw format of chronologies data.Updated description file to match CRAN’s comments. Now follows: comment = c(ORCID = …….)
Set examples to to avoid violating CRAN’s policy that allows access
to internet. Set vignettes to eval=FALSE as to avoid
calling APIs that require access to internet. Set all tests that require
API call to skip on CRAN.
Fixed tests to not be run on CRAN as API may be down. Changed vignette to not run when API is down - order of code was not correct for this chunk.
Fixed 2 neotoma2R package bugs:
samples.sites() was not binding properly all rows.all_data could cause a multiple argument error.get_downloads() - added a
second tryCatch for .sites objectsAdded function: * get_publications.sites()
Updated neotoma2R package documentation, simplifying the volume of
.Rd documents. I also included .mkdocs to generate
documentation with pkgdown package. The documentation HTML
files are now hosted at: https://open.neotomadb.org/neotoma2/
Implemented github actions to build and deploy the documentation to
the above URL whenever there is a push to the main
branch.
Created new speleothem S4 class and specific methods for
speleothem data, of particular interest:
get_speleothems()speleothems()speleothemdetails() They are still in beta stage, so
please report any issues you may find.Upgraded filter() so that it is no longer needed to
specify dplyr:: or neotoma2:: when using the
function. filter() also works on
recdatecreated and DOI fields.
Added new tests to improve code coverage.
Worked on improving get_taxa() and
get_taxon() functions. The first one works as
get_datasets(taxa=...) while the latter one retrieves taxon
details for a single taxon id or a vector of taxon ids.
When API is down for whichever reason, instead of stopping, any
get_() function will return NULL with a
warning message. This will prevent violating CRAN
policies when building vignettes or running examples if the API is not
available.
Maintainer’s email updated.
Started with parsing lists rather than sites objects. This helps handle better the site creation. and speeds things up. Removed temporarily functions such as specimens and speleothems to correct some potential bugs incoming from API parsing. Added tests to get_downloads / datasets / sites Increased the potential of POST statements to handle more complex queries from the package. Will correct speleothems and specimens for Neotoma 1.0.8
Fixed RMarkdown so that when the API is not available, it will render
a document with all eval=False and so, it will not fail. Fixed passing
loc so that a proper geojson is given to the API. At this
point, the API cannot handle POST statements with complicated
bodies.
Fixed errors in the API calls. Added tryCatch statements
in vignette Changed some minor API calls to eval=False
Fixed errors in the API calls.
Updated README.
Fixed errors in the API calls.
Fixed filter function for collection units and datasets. Changed for
Updated plotLeaflet to not add provider tiles.
Removed mapview to avoid sp conflicts.
Updated README to reflect milestones with JOSS.
Updated maintainer.
NEWS.md file to track changes to the
package.