daedalus.api

[UNDER DEVELOPMENT] API server for the DAEDALUS model via the R package {daedalus}

https://github.com/jameel-institute/daedalus.api

Science Score: 62.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    2 of 6 committers (33.3%) from academic institutions
  • Institutional organization owner
    Organization jameel-institute has institutional domain (www.imperial.ac.uk)
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.8%) to scientific vocabulary
Last synced: 7 months ago · JSON representation ·

Repository

[UNDER DEVELOPMENT] API server for the DAEDALUS model via the R package {daedalus}

Basic Info
  • Host: GitHub
  • Owner: jameel-institute
  • License: other
  • Language: R
  • Default Branch: main
  • Homepage:
  • Size: 2.12 MB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • Open Issues: 2
  • Releases: 0
Created over 1 year ago · Last pushed 8 months ago
Metadata Files
Readme Changelog License Citation

README.md

daedalus.api

Project Status: Concept -- Minimal or no implementation has been done yet, or the repository is only intended to be a limited example, demo, or proof-of-concept. CRAN status Codecov test coverage R-CMD-check Build status

daedalus.api is an API package for the daedalus package and is primarily intended for internal use.

Installation

You can install the development version of daedalus.api from GitHub with:

``` r

install.packages("devtools")

devtools::install_github("jameel-institute/daedalus.api") ```

Quick start

```sh

run the api container with queue worker

This pulls and runs image for current SHA. If none is pushed to registry you can build and push

locally using ./docker/build

./docker/run_containers

check root endpoint GET/

curl -s http://localhost:8001 | jq

stop the containers

./docker/clear_containers ```

Development

To add an endpoint, implement a method in api.R with @porcelain comment, then run roxygen2::roxygenize() to generate the porcelain code in porcelain.R. See the porcelain docs for more details.

Testing

Redis needs to be running for the e2e tests to pass. Use ./scripts/redis start, and tear down with ./scripts/redis kill.

Testing integration with the dashboard

To test the integration of this package within the entire system including the dashboard, use the daedalus-deploy tool to install and run all images locally, following the README. You should alter the common config file (daedalus.yml) so that the API image tag value points to the feature branch of this package that you want to test, e.g.:

```yml

daedalus.yml

api: image: repo: mrcide name: daedalus.api tag: jidea-297 ```

Ensure that your start-up command uses the --pull option so that the deploy tool requests the latest versions of the images. Then visit https://localhost/ in your browser to do your manual testing (ignoring warnings from your browser that the site is not secure).

Model versions

The API should be backwards compatible and support running older versions of the model. Some endpoints support providing modelVersion as part of the body, e.g. to run or get metadata for a particular version of the model.

Metadata is stored in the inst/json folder, in files named metadata_[VERSION].json where [VERSION] is the first model version where that metadata applied. Requesting metadata for a model version will return the metadata which applies to that version, (which may have been first introduced in an earlier version). The metadata response includes a modelVersion property - this value will be the modelVersion requested in the query string, if provided. If modelVersion was not provided in the query string, the returned model version will be the most recent metadata's [VERSION].

Related projects

See the daedalus package which implements the DAEDALUS integrated model of economic, social, and health costs of a pandemic.

Owner

  • Name: Jameel Institute
  • Login: jameel-institute
  • Kind: organization
  • Location: Imperial College London

Jameel Institute

Citation (CITATION.cff)

# --------------------------------------------
# CITATION file created with {cffr} R package
# See also: https://docs.ropensci.org/cffr/
# --------------------------------------------
 
cff-version: 1.2.0
message: 'To cite package "daedalus.api" in publications use:'
type: software
license: MIT
title: 'daedalus.api: Serve the ''daedalus'' model via an API'
version: 0.0.1
abstract: API server for the 'daedalus' model, using 'porcelain' and 'plumber'.
authors:
- family-names: Gupte
  given-names: Pratik
  email: p.gupte24@imperial.ac.uk
  orcid: https://orcid.org/0000-0001-5294-7819
repository-code: https://github.com/jameel-institute/daedalus.api
url: https://github.com/jameel-institute/daedalus.api
contact:
- family-names: Gupte
  given-names: Pratik
  email: p.gupte24@imperial.ac.uk
  orcid: https://orcid.org/0000-0001-5294-7819
references:
- type: software
  title: daedalus
  abstract: 'daedalus: Optimise economic, social and health trade-offs in a pandemic'
  notes: Imports
  url: https://github.com/j-idea/daedalus
  authors:
  - family-names: Gupte
    given-names: Pratik
    email: p.gupte24@imperial.ac.uk
    orcid: https://orcid.org/0000-0001-5294-7819
  year: '2024'
  doi: 10.32614/CRAN.package.daedalus
- type: software
  title: docopt
  abstract: 'docopt: Command-Line Interface Specification Language'
  notes: Imports
  url: https://github.com/docopt/docopt.R
  repository: https://CRAN.R-project.org/package=docopt
  authors:
  - family-names: Jonge
    given-names: Edwin
    name-particle: de
  year: '2024'
  doi: 10.32614/CRAN.package.docopt
- type: software
  title: jsonlite
  abstract: 'jsonlite: A Simple and Robust JSON Parser and Generator for R'
  notes: Imports
  url: https://jeroen.r-universe.dev/jsonlite
  repository: https://CRAN.R-project.org/package=jsonlite
  authors:
  - family-names: Ooms
    given-names: Jeroen
    email: jeroen@berkeley.edu
    orcid: https://orcid.org/0000-0002-4035-0289
  year: '2024'
  doi: 10.32614/CRAN.package.jsonlite
- type: software
  title: lgr
  abstract: 'lgr: A Fully Featured Logging Framework'
  notes: Imports
  url: https://s-fleck.github.io/lgr/
  repository: https://CRAN.R-project.org/package=lgr
  authors:
  - family-names: Fleck
    given-names: Stefan
    email: stefan.b.fleck@gmail.com
    orcid: https://orcid.org/0000-0003-3344-9851
  year: '2024'
  doi: 10.32614/CRAN.package.lgr
- type: software
  title: porcelain
  abstract: 'porcelain: Turn a Package into an HTTP API'
  notes: Imports
  url: https://github.com/reside-ic/porcelain
  authors:
  - family-names: FitzJohn
    given-names: Rich
    email: rich.fitzjohn@gmail.com
  year: '2024'
  doi: 10.32614/CRAN.package.porcelain
- type: software
  title: httr
  abstract: 'httr: Tools for Working with URLs and HTTP'
  notes: Suggests
  url: https://httr.r-lib.org/
  repository: https://CRAN.R-project.org/package=httr
  authors:
  - family-names: Wickham
    given-names: Hadley
    email: hadley@posit.co
  year: '2024'
  doi: 10.32614/CRAN.package.httr
- type: software
  title: mockery
  abstract: 'mockery: Mocking Library for R'
  notes: Suggests
  url: https://github.com/r-lib/mockery
  repository: https://CRAN.R-project.org/package=mockery
  authors:
  - family-names: Finkelstein
    given-names: Noam
  - family-names: Bartnik
    given-names: Lukasz
  - family-names: Hester
    given-names: Jim
  - family-names: Wickham
    given-names: Hadley
    email: hadley@rstudio.com
  year: '2024'
  doi: 10.32614/CRAN.package.mockery
- type: software
  title: spelling
  abstract: 'spelling: Tools for Spell Checking in R'
  notes: Suggests
  url: https://ropensci.r-universe.dev/spelling
  repository: https://CRAN.R-project.org/package=spelling
  authors:
  - family-names: Ooms
    given-names: Jeroen
    email: jeroen@berkeley.edu
    orcid: https://orcid.org/0000-0002-4035-0289
  - family-names: Hester
    given-names: Jim
    email: james.hester@rstudio.com
  year: '2024'
  doi: 10.32614/CRAN.package.spelling
- type: software
  title: testthat
  abstract: 'testthat: Unit Testing for R'
  notes: Suggests
  url: https://testthat.r-lib.org
  repository: https://CRAN.R-project.org/package=testthat
  authors:
  - family-names: Wickham
    given-names: Hadley
    email: hadley@posit.co
  year: '2024'
  doi: 10.32614/CRAN.package.testthat
  version: '>= 3.0.0'

GitHub Events

Total
  • Delete event: 2
  • Issue comment event: 28
  • Push event: 77
  • Pull request event: 24
  • Pull request review event: 39
  • Pull request review comment event: 23
  • Fork event: 1
  • Create event: 15
Last Year
  • Delete event: 2
  • Issue comment event: 28
  • Push event: 77
  • Pull request event: 24
  • Pull request review event: 39
  • Pull request review comment event: 23
  • Fork event: 1
  • Create event: 15

Committers

Last synced: 11 months ago

All Time
  • Total Commits: 62
  • Total Committers: 6
  • Avg Commits per committer: 10.333
  • Development Distribution Score (DDS): 0.597
Past Year
  • Commits: 62
  • Committers: 6
  • Avg Commits per committer: 10.333
  • Development Distribution Score (DDS): 0.597
Top Committers
Name Email Commits
Emma Russell 4****l 25
Pratik Gupte p****6@g****m 22
Rich FitzJohn r****n@i****k 7
Paul Liétar p****3@i****k 4
David Mears 6****2 3
Anmol Thapar m****r@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 7 months ago

All Time
  • Total issues: 0
  • Total pull requests: 71
  • Average time to close issues: N/A
  • Average time to close pull requests: 3 days
  • Total issue authors: 0
  • Total pull request authors: 7
  • Average comments per issue: 0
  • Average comments per pull request: 1.75
  • Merged pull requests: 63
  • Bot issues: 0
  • Bot pull requests: 4
Past Year
  • Issues: 0
  • Pull requests: 71
  • Average time to close issues: N/A
  • Average time to close pull requests: 3 days
  • Issue authors: 0
  • Pull request authors: 7
  • Average comments per issue: 0
  • Average comments per pull request: 1.75
  • Merged pull requests: 63
  • Bot issues: 0
  • Bot pull requests: 4
Top Authors
Issue Authors
  • plietar (1)
Pull Request Authors
  • EmmaLRussell (44)
  • david-mears-2 (10)
  • pratikunterwegs (8)
  • richfitz (7)
  • github-actions[bot] (4)
  • absternator (2)
  • plietar (1)
Top Labels
Issue Labels
Pull Request Labels

Dependencies

.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v4 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pkgdown.yaml actions
  • JamesIves/github-pages-deploy-action v4.5.0 composite
  • actions/checkout v4 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/test-coverage.yaml actions
  • actions/checkout v4 composite
  • actions/upload-artifact v4 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
DESCRIPTION cran
  • testthat >= 3.0.0 suggests
.github/workflows/lint-changed-files.yaml actions
  • actions/checkout v4 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/update-citation-cff.yaml actions
  • actions/checkout v4 composite
  • peter-evans/create-pull-request v6 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
docker/Dockerfile docker
  • rocker/r-ver 4.4.1 build