Giter VIP home page Giter VIP logo

medrxivr's Issues

mx_api_content() fails if the last page doesn't contain any records

This seems to be due to the fact that the number of records given by the "total" metadata is more than the total number of records actually available.

As of 14.39pm on 04/01/2021, the number of records given by the "total" is 148231. However, if you set the counter to any record within 31 of this figure (e.g. https://api.biorxiv.org/details/biorxiv/2013-01-01/2021-01-04/148201), you get a "No posts found" message. As medrxivr uses the "total" metadata field to work out how many pages it needs to cycle through to download the whole database, this sometimes leads to an error when the last page, expected by medrxivr based on the "total" field, is empty.

Note as more records are added to the API, the hardcode figures above will no longer demonstrate the issue.

Release medrxivr 0.0.3

Prepare for release:

  • Check that description is informative
  • Check licensing of included files
  • devtools::build_readme()
  • usethis::use_cran_comments()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran(env_vars=c(R_COMPILE_AND_INSTALL_PACKAGES = "always"))
  • Update cran-comments.md
  • Review pkgdown reference index for, e.g., missing topics
  • Draft blog post

Submit to CRAN:

  • usethis::use_version('major')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted ๐ŸŽ‰
  • usethis::use_github_release()
  • usethis::use_dev_version()
  • Update install instructions in README
  • Finish blog post
  • Tweet
  • Add link to blog post in pkgdown news menu

Unable to resolve r-lib/actions@master in GitHub Actions

Description

While preparing the workflow directory and required actions in a GitHub Actions workflow, the following error is encountered:

Error: Unable to resolve action `r-lib/actions@master`, unable to find version `master`

Impact

This prevents the workflow from running.

Add function to report number of "hits" per individual search term.

It is often useful to be able to see the number of "hits" (records returned) by each individual element of the search, so that when designing the search strategy you can interogate which elements are influencing the returned records the most. So for example, if the search is:

topic1 <- c("dementia", "Alzheimer's")      # Combined with Boolean "OR"
topic2 <- c("lipids", "cholesterol")             # Combined with Boolean "OR"

query <- list(topic1,topic2)                        # Combined with Boolean "AND"

results <- mx_search(mx_snapshot(), query)

Then passing query to the proposed mx_reporter() function would return something like the below:

# Total number of records found by your search: XX

# Total topic 1 records: XX
# - dementia: XX
# - Alzheimer's: XX

# Total Topic 2 records: XX
# - lipids: XX
# - cholesterol: XX

Error in count/100 : non-numeric argument to binary operator

Session Info
 setting  value
 version  R version 4.2.2 (2022-10-31)
 os       macOS Ventura 13.2.1
 system   x86_64, darwin17.0
 ui       RStudio
 language (EN)
 collate  en_US.UTF-8
 ctype    en_US.UTF-8
 tz       America/Toronto
 date     2024-03-20
 rstudio  2023.09.1+494 Desert Sunflower (desktop)
 pandoc   NA
> mx_api_content(
+     from_date = "2013-01-01",
+     to_date = as.character(Sys.Date()),
+     clean = TRUE,
+     server = "medrxiv",
+     include_info = FALSE
+ )
Error in count/100 : non-numeric argument to binary operator
> mx_data <- mx_api_content(from_date = "2020-01-01",
+                           to_date = "2020-01-07")
Error in count/100 : non-numeric argument to binary operator
> if(interactive()){
+     mx_data <- mx_api_content(from_date = "2020-01-01",
+                               to_date = "2020-01-07")
+ }
Error in count/100 : non-numeric argument to binary operator

> preprint_data <- mx_api_content(server = "biorxiv")
Error in count/100 : non-numeric argument to binary operator
> preprint_data <- mx_api_content()
Error in count/100 : non-numeric argument to binary operator

Offhand, I can see that this is caused by a bad value of count, probably NA, null, or 0. I believe the same error has been included automatically in the docs.

I am guessing either something changed server-side or in a dependency that invalidated the lib's logic. I am writing a Python version now; will let you know if I find the problem and solution.

pkgdown is failing

The pkgdown GitHub action is failing, but the Jenkins version works fine. Gives error message:

-- Building function reference -------------------------------------------------
Error in check_missing_topics(rows, pkg) : 
  Topics missing from index: medrxivr
  • Remove the pkgdown.yml GitHub actions file.

Add support for plain text Boolean/common search functions

For example: if a users searches for "randomi*ation", convert this to "randomi([[:alpha:]])ation", where ([[:alpha:]]) element defines any single alphanumeric character - in this case, the regex will find both randomisation and randomization.

The idea is to prevent users from having to use unfamiliar regex terms, in favour of common MEDLINE/EMBASE/Ovid syntax.

Fix pkgdown configuration for reference

Some topics are missing from the configuration file.

 Error in check_missing_topics(rows, pkg) : 
  All topics must be included in reference index
โ€ข Missing topics: medrxivr, mx_caps

Note that for topics you do not want to include in the index you can create an "internal" section https://pkgdown.r-lib.org/reference/build_reference.html?q=internal#missing-topics

You can also use the @keywords internal tag and redocument for, say, the package manual page.

To check all topics are listed, after editing the configuration file you can run pkgdown::check_pkgdown().

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.