diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml new file mode 100644 index 0000000..bfc9f4d --- /dev/null +++ b/.github/workflows/pkgdown.yaml @@ -0,0 +1,49 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + branches: [main, master] + pull_request: + release: + types: [published] + workflow_dispatch: + +name: pkgdown.yaml + +permissions: read-all + +jobs: + pkgdown: + runs-on: ubuntu-latest + # Only restrict concurrency for non-PR jobs + concurrency: + group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::pkgdown, local::. + needs: website + + - name: Build site + run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) + shell: Rscript {0} + + - name: Deploy to GitHub pages πŸš€ + if: github.event_name != 'pull_request' + uses: JamesIves/github-pages-deploy-action@v4.5.0 + with: + clean: false + branch: gh-pages + folder: docs diff --git a/.gitignore b/.gitignore index 62f737d..05db589 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ src/*.dll *.o *.a inst/doc +docs diff --git a/DESCRIPTION b/DESCRIPTION index 4ae6dac..e5b1f31 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,14 +1,14 @@ Package: sundialr Type: Package Title: An Interface to 'SUNDIALS' Ordinary Differential Equation (ODE) Solvers -Version: 0.1.4.2 +Version: 0.1.5 Authors@R: c( person("Satyaprakash", "Nayak", "", "satyaprakash.nayak@gmail.com", c("aut", "cre","cph"), comment = c(ORCID = "0000-0001-7225-1317")), person("Lawrence Livermore National Security", role = c("cph")), person("Southern Methodist University", role = c("cph")) ) Maintainer: Satyaprakash Nayak -URL: https://github.com/sn248/sundialr +URL: https://github.com/sn248/sundialr, http://sn248.github.io/sundialr/ BugReports: https://github.com/sn248/sundialr/issues Description: Provides a way to call the functions in 'SUNDIALS' C ODE solving library (). Currently the serial version of ODE solver, 'CVODE', sensitivity calculator 'CVODES' and differential algebraic solver 'IDA' from the 'SUNDIALS' library are implemented. The package requires ODE to be written as an 'R' or 'Rcpp' function and does not require the 'SUNDIALS' library to be installed on the local machine. License: BSD_3_clause + file LICENSE diff --git a/README.md b/README.md index 87bc143..d8fd146 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,12 @@ to simulate the effect of multiple bolus doses of a drug in clinical pharmacokin vignette for more details. ## What's new? + +### Release 0.1.5 ++ Updated the upstream `SUNDIALS` to version 7.1.1. ++ Fixed the `pkgdown` website ++ There was a bug is assigning absolute tolerance in equations. Fixed now. + ### Release 0.1.4.1 + Fixed the linking bug due to multiple defined symbols. No other change. diff --git a/_pkgdown.yml b/_pkgdown.yml index 6ef5f5a..b05f9bd 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -1 +1,5 @@ -destination: docs +url: http://sn248.github.io/sundialr/ +template: + bootstrap: 5 + bootswatch: cerulean + diff --git a/docs/404.html b/docs/404.html index 58ac873..1e8d50e 100644 --- a/docs/404.html +++ b/docs/404.html @@ -4,109 +4,77 @@ - + Page not found (404) β€’ sundialr - - - - - - - + + + + + - - - -
-
-
- Content not found. Please use links in the navbar. -
- - - +
- -
- diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 8efe383..fe675ef 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -1,56 +1,38 @@ -License β€’ sundialr - - -
-
+
+
+
-
-
YEAR: 2020
@@ -59,26 +41,18 @@ 

License

-
- - - -
+
- -
- +
diff --git a/docs/articles/index.html b/docs/articles/index.html index 42c9198..467714a 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -1,79 +1,58 @@ -Articles β€’ sundialr - - -
-
+
+
+
+
-
- +
diff --git a/docs/articles/my-vignette.html b/docs/articles/my-vignette.html index 79d0ab5..7c2ca53 100644 --- a/docs/articles/my-vignette.html +++ b/docs/articles/my-vignette.html @@ -4,86 +4,65 @@ - + sundialr - An Interface to 'SUNDIALS' Ordinary Differential Equation (ODE) Solvers β€’ sundialr - - - - - - - + + + + + - + + Skip to contents -
-
-
- @@ -624,33 +603,26 @@

SummaryC library such asIDAS and ARKODE may also be added.

-
- - - +
- - diff --git a/docs/authors.html b/docs/authors.html index 4383a4a..682c9ec 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -1,59 +1,41 @@ -Authors and Citation β€’ sundialr - - -
-
+
-
-
- +
+
+
+
+ +
+

Authors

  • Satyaprakash Nayak. Author, maintainer, copyright holder. @@ -68,40 +50,35 @@

    Authors and Citation

-
-
-

Citation

- Source: inst/CITATION -
-
+
+

Citation

+

Source: inst/CITATION

-

Satyaprakash Nayak (2023) The sundialr package: An Interface to 'SUNDIALS' +

Satyaprakash Nayak (2023) The sundialr package: An Interface to 'SUNDIALS' Ordinary Differential Equation (ODE) Solvers. https://doi.org/10.5281/zenodo.5501631/

-
@Misc{,
+      
@Misc{,
   title = {The sundialr package: An Interface to 'SUNDIALS' Ordinary Differential Equation (ODE) Solvers},
   year = {2023},
   author = {Satyaprakash Nayak},
   doi = {10.5281/zenodo.5501631},
   url = {https://github.com/sn248/sundialr/},
 }
+
-
- -
- +
-
- +
diff --git a/docs/index.html b/docs/index.html index 53d00ff..8e98bd3 100644 --- a/docs/index.html +++ b/docs/index.html @@ -4,77 +4,54 @@ - + An Interface to SUNDIALS Ordinary Differential Equation (ODE) Solvers β€’ sundialr - - - - - - + + + + + + - - - - -
-
-
-
+
+
+
+
@@ -118,10 +95,7 @@

Release 0.1.3 -

+
-
- diff --git a/docs/pkgdown.js b/docs/pkgdown.js index 6f0eee4..1a99c65 100644 --- a/docs/pkgdown.js +++ b/docs/pkgdown.js @@ -2,83 +2,43 @@ (function($) { $(function() { - $('.navbar-fixed-top').headroom(); + $('nav.navbar').headroom(); - $('body').css('padding-top', $('.navbar').height() + 10); - $(window).resize(function(){ - $('body').css('padding-top', $('.navbar').height() + 10); + Toc.init({ + $nav: $("#toc"), + $scope: $("main h2, main h3, main h4, main h5, main h6") }); - $('[data-toggle="tooltip"]').tooltip(); - - var cur_path = paths(location.pathname); - var links = $("#navbar ul li a"); - var max_length = -1; - var pos = -1; - for (var i = 0; i < links.length; i++) { - if (links[i].getAttribute("href") === "#") - continue; - // Ignore external links - if (links[i].host !== location.host) - continue; - - var nav_path = paths(links[i].pathname); - - var length = prefix_length(nav_path, cur_path); - if (length > max_length) { - max_length = length; - pos = i; - } - } - - // Add class to parent
  • , and enclosing
  • if in dropdown - if (pos >= 0) { - var menu_anchor = $(links[pos]); - menu_anchor.parent().addClass("active"); - menu_anchor.closest("li.dropdown").addClass("active"); - } - }); - - function paths(pathname) { - var pieces = pathname.split("/"); - pieces.shift(); // always starts with / - - var end = pieces[pieces.length - 1]; - if (end === "index.html" || end === "") - pieces.pop(); - return(pieces); - } - - // Returns -1 if not found - function prefix_length(needle, haystack) { - if (needle.length > haystack.length) - return(-1); - - // Special case for length-0 haystack, since for loop won't run - if (haystack.length === 0) { - return(needle.length === 0 ? 0 : -1); + if ($('#toc').length) { + $('body').scrollspy({ + target: '#toc', + offset: $("nav.navbar").outerHeight() + 1 + }); } - for (var i = 0; i < haystack.length; i++) { - if (needle[i] != haystack[i]) - return(i); - } + // Activate popovers + $('[data-bs-toggle="popover"]').popover({ + container: 'body', + html: true, + trigger: 'focus', + placement: "top", + sanitize: false, + }); - return(haystack.length); - } + $('[data-bs-toggle="tooltip"]').tooltip(); /* Clipboard --------------------------*/ function changeTooltipMessage(element, msg) { - var tooltipOriginalTitle=element.getAttribute('data-original-title'); - element.setAttribute('data-original-title', msg); + var tooltipOriginalTitle=element.getAttribute('data-bs-original-title'); + element.setAttribute('data-bs-original-title', msg); $(element).tooltip('show'); - element.setAttribute('data-original-title', tooltipOriginalTitle); + element.setAttribute('data-bs-original-title', tooltipOriginalTitle); } if(ClipboardJS.isSupported()) { $(document).ready(function() { - var copyButton = ""; + var copyButton = ""; $("div.sourceCode").addClass("hasCopyButton"); @@ -89,20 +49,114 @@ $('.btn-copy-ex').tooltip({container: 'body'}); // Initialize clipboard: - var clipboardBtnCopies = new ClipboardJS('[data-clipboard-copy]', { + var clipboard = new ClipboardJS('[data-clipboard-copy]', { text: function(trigger) { return trigger.parentNode.textContent.replace(/\n#>[^\n]*/g, ""); } }); - clipboardBtnCopies.on('success', function(e) { + clipboard.on('success', function(e) { changeTooltipMessage(e.trigger, 'Copied!'); e.clearSelection(); }); - clipboardBtnCopies.on('error', function() { + clipboard.on('error', function(e) { changeTooltipMessage(e.trigger,'Press Ctrl+C or Command+C to copy'); }); + }); } + + /* Search marking --------------------------*/ + var url = new URL(window.location.href); + var toMark = url.searchParams.get("q"); + var mark = new Mark("main#main"); + if (toMark) { + mark.mark(toMark, { + accuracy: { + value: "complementary", + limiters: [",", ".", ":", "/"], + } + }); + } + + /* Search --------------------------*/ + /* Adapted from https://github.com/rstudio/bookdown/blob/2d692ba4b61f1e466c92e78fd712b0ab08c11d31/inst/resources/bs4_book/bs4_book.js#L25 */ + // Initialise search index on focus + var fuse; + $("#search-input").focus(async function(e) { + if (fuse) { + return; + } + + $(e.target).addClass("loading"); + var response = await fetch($("#search-input").data("search-index")); + var data = await response.json(); + + var options = { + keys: ["what", "text", "code"], + ignoreLocation: true, + threshold: 0.1, + includeMatches: true, + includeScore: true, + }; + fuse = new Fuse(data, options); + + $(e.target).removeClass("loading"); + }); + + // Use algolia autocomplete + var options = { + autoselect: true, + debug: true, + hint: false, + minLength: 2, + }; + var q; +async function searchFuse(query, callback) { + await fuse; + + var items; + if (!fuse) { + items = []; + } else { + q = query; + var results = fuse.search(query, { limit: 20 }); + items = results + .filter((x) => x.score <= 0.75) + .map((x) => x.item); + if (items.length === 0) { + items = [{dir:"Sorry 😿",previous_headings:"",title:"No results found.",what:"No results found.",path:window.location.href}]; + } + } + callback(items); +} + $("#search-input").autocomplete(options, [ + { + name: "content", + source: searchFuse, + templates: { + suggestion: (s) => { + if (s.title == s.what) { + return `${s.dir} >
    ${s.title}
    `; + } else if (s.previous_headings == "") { + return `${s.dir} >
    ${s.title}
    > ${s.what}`; + } else { + return `${s.dir} >
    ${s.title}
    > ${s.previous_headings} > ${s.what}`; + } + }, + }, + }, + ]).on('autocomplete:selected', function(event, s) { + window.location.href = s.path + "?q=" + q + "#" + s.id; + }); + }); })(window.jQuery || window.$) + +document.addEventListener('keydown', function(event) { + // Check if the pressed key is '/' + if (event.key === '/') { + event.preventDefault(); // Prevent any default action associated with the '/' key + document.getElementById('search-input').focus(); // Set focus to the search input + } +}); diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 6e32b98..dfb5f6d 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -3,4 +3,7 @@ pkgdown: 2.1.1 pkgdown_sha: ~ articles: my-vignette: my-vignette.html -last_built: 2024-11-10T21:17Z +last_built: 2024-11-10T21:46Z +urls: + reference: http://sn248.github.io/sundialr/reference + article: http://sn248.github.io/sundialr/articles diff --git a/docs/reference/cvode.html b/docs/reference/cvode.html index 99110cd..c6fe698 100644 --- a/docs/reference/cvode.html +++ b/docs/reference/cvode.html @@ -1,65 +1,47 @@ -cvode β€” cvode β€’ sundialr - - -
    -
    +
    +
    +
    -
    - -
    +

    CVODE solver to solve stiff ODEs

    -
    +
    +

    Usage

    cvode(
       time_vector,
       IC,
    @@ -70,8 +52,8 @@ 

    cvode

    )
    -
    -

    Arguments

    +
    +

    Arguments

    time_vector
    @@ -98,13 +80,13 @@

    Arguments

    Absolute Tolerance (a scalar or vector with length equal to ydot (dy/dx), default = 1e-04)

    -
    -

    Value

    +
    +

    Value

    A data frame. First column is the time-vector, the other columns are values of y in order they are provided.

    -
    -

    Examples

    +
    +

    Examples

    # Example of solving a set of ODEs with cvode function
     # ODEs described by an R function
     ODE_R <- function(t, y, p){
    @@ -163,23 +145,19 @@ 

    Examples

    # identical(df1, df2)
    -
    - -
    +
    -
    - +
    diff --git a/docs/reference/cvodes.html b/docs/reference/cvodes.html index 78ffc32..425277e 100644 --- a/docs/reference/cvodes.html +++ b/docs/reference/cvodes.html @@ -1,65 +1,47 @@ -cvodes β€” cvodes β€’ sundialr - - -
    -
    +
    +
    +
    -
    - -
    +

    CVODES solver to solve ODEs and calculate sensitivities

    -
    +
    +

    Usage

    cvodes(
       time_vector,
       IC,
    @@ -72,8 +54,8 @@ 

    cvodes

    )
    -
    -

    Arguments

    +
    +

    Arguments

    time_vector
    @@ -108,13 +90,13 @@

    Arguments

    Error Control - allowed values are TRUE or FALSE (default)

    -
    -

    Value

    +
    +

    Value

    A data frame. First column is the time-vector, the next y * p columns are sensitivities of y1 w.r.t all parameters, then y2 w.r.t all parameters etc. y is the state vector, p is the parameter vector

    -
    -

    Examples

    +
    +

    Examples

    # Example of solving a set sensitivity equations for ODEs with cvodes function
     # ODEs described by an R function
     ODE_R <- function(t, y, p){
    @@ -173,23 +155,19 @@ 

    Examples

    # identical(df1, df2)
    -
    - -
    +
    -
    - +
    diff --git a/docs/reference/cvsolve.html b/docs/reference/cvsolve.html index c9b9cc1..2ab7b14 100644 --- a/docs/reference/cvsolve.html +++ b/docs/reference/cvsolve.html @@ -1,65 +1,47 @@ -cvsolve β€” cvsolve β€’ sundialr - - -
    -
    +
    +
    +
    -
    - -
    +

    CVSOLVE solver to solve stiff ODEs with discontinuties

    -
    +
    +

    Usage

    cvsolve(
       time_vector,
       IC,
    @@ -71,8 +53,8 @@ 

    cvsolve

    )
    -
    -

    Arguments

    +
    +

    Arguments

    time_vector
    @@ -103,13 +85,13 @@

    Arguments

    Absolute Tolerance (a scalar or vector with length equal to ydot, default = 1e-04)

    -
    -

    Value

    +
    +

    Value

    A data frame. First column is the time-vector, the other columns are values of y in order they are provided.

    -
    -

    Examples

    +
    +

    Examples

    # Example of solving a set of ODEs with multiple discontinuities using cvsolve
     # A simple One dimensional equation, y = -0.1 * y
     # ODEs described by an R function
    @@ -138,23 +120,19 @@ 

    Examples

    df2 <- cvsolve(TSAMP, c(1), ODE_R, params, TDOSE) # solving with discontinuity
    -
    - -
    +
    -
    - +
    diff --git a/docs/reference/ida.html b/docs/reference/ida.html index 0f8dc7f..bbaf6c3 100644 --- a/docs/reference/ida.html +++ b/docs/reference/ida.html @@ -1,65 +1,47 @@ -ida β€” ida β€’ sundialr - - -
    -
    +
    +
    +
    -
    - -
    +

    IDA solver to solve stiff DAEs

    -
    +
    +

    Usage

    ida(
       time_vector,
       IC,
    @@ -71,8 +53,8 @@ 

    ida

    )
    -
    -

    Arguments

    +
    +

    Arguments

    time_vector
    @@ -103,28 +85,24 @@

    Arguments

    Absolute Tolerance (a scalar or vector with length equal to ydot, default = 1e-04)

    -
    -

    Value

    +
    +

    Value

    A data frame. First column is the time-vector, the other columns are values of y in order they are provided.

    -
    - -
    +
    -
    - +
    diff --git a/docs/reference/index.html b/docs/reference/index.html index 62701e0..ea391e3 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -1,96 +1,87 @@ -Package index β€’ sundialr - - -
    -
    +
    -
    - +
    +
    +
    - - - - - - - - - -
    -

    All functions

    -

    -
    -

    cvode()

    -

    cvode

    -

    cvodes()

    -

    cvodes

    -

    cvsolve()

    -

    cvsolve

    -

    ida()

    -

    ida

    - - -
    +
    +

    All functions

    -
    -
    -

    Site built with pkgdown 2.1.1.

    + +
    + + + + +
    + + cvode() + +
    +
    cvode
    +
    + + cvodes() + +
    +
    cvodes
    +
    + + cvsolve() + +
    +
    cvsolve
    +
    + + ida() + +
    +
    ida
    +
    +
    + + +
    -
    + +
    diff --git a/docs/sitemap.xml b/docs/sitemap.xml index 2c72a3f..e1461f4 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -1,14 +1,14 @@ -/404.html -/LICENSE-text.html -/articles/index.html -/articles/my-vignette.html -/authors.html -/index.html -/reference/cvode.html -/reference/cvodes.html -/reference/cvsolve.html -/reference/ida.html -/reference/index.html +http://sn248.github.io/sundialr/404.html +http://sn248.github.io/sundialr/LICENSE-text.html +http://sn248.github.io/sundialr/articles/index.html +http://sn248.github.io/sundialr/articles/my-vignette.html +http://sn248.github.io/sundialr/authors.html +http://sn248.github.io/sundialr/index.html +http://sn248.github.io/sundialr/reference/cvode.html +http://sn248.github.io/sundialr/reference/cvodes.html +http://sn248.github.io/sundialr/reference/cvsolve.html +http://sn248.github.io/sundialr/reference/ida.html +http://sn248.github.io/sundialr/reference/index.html