{"id":29253794,"url":"https://github.com/quantalabs/epispot","last_synced_at":"2025-07-04T02:38:47.337Z","repository":{"id":240578432,"uuid":"695744895","full_name":"Quantalabs/epispot","owner":"Quantalabs","description":"A complex epidemiological modeling package for JavaScript.","archived":false,"fork":false,"pushed_at":"2025-06-29T19:54:33.000Z","size":1698,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-29T20:36:06.791Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Quantalabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-09-24T04:50:29.000Z","updated_at":"2025-06-29T19:53:03.000Z","dependencies_parsed_at":"2024-05-19T22:25:52.881Z","dependency_job_id":"17d46ca4-92de-4c70-a6e0-af21cd1d1615","html_url":"https://github.com/Quantalabs/epispot","commit_stats":null,"previous_names":["epispot/epispot-new","quantalabs/epispot"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Quantalabs/epispot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quantalabs%2Fepispot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quantalabs%2Fepispot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quantalabs%2Fepispot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quantalabs%2Fepispot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Quantalabs","download_url":"https://codeload.github.com/Quantalabs/epispot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quantalabs%2Fepispot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263435293,"owners_count":23466116,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-04T02:38:45.762Z","updated_at":"2025-07-04T02:38:47.318Z","avatar_url":"https://github.com/Quantalabs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# epispot\n\nThis repository aims to merge the [EpiJS](https://github.com/epispot/epijs) and [epispot](https://github.com/epispot/epispot) javascript and python packages into one, unified JS/TS package. It is currently in development, and will be released in the near future, at which point the current EpiJS and epispot packages will be deprecated in favor of this package.\n\n## Table of Contents\n\n1. [Features](#features)\n2. [Installation](#installation)\n3. [Roadmap](#roadmap)\n4. [Usage](#usage)\n\n## Features\n\n-   Create Custom Compartmental Models\n-   Plots model predictions interactively\n-   Solve models with custom time steps\n-   Custom-defined compartments\n\n## Installation\n\nepispot is currently not avaliable on npm. Install via git:\n\n```bash\n  git clone https://github.com/epispot/epispot-new.git epispot\n  cd epispot\n  yarn \u0026\u0026 yarn build\n```\n\nAfter cloning the package, go into the directory of the project you want to use epispot in, and run:\n\n```bash\n  yarn add /path/to/epispot\n```\n\n## Roadmap\n\n-   Additional browser support\n-   Built-in models\n-   Built-in compartments\n-   Fitting data to a model\n-   Stop using MathJS in favor of TheoremJS\n\n## Usage\n\nYou can create a model in epispot via a `.epi` file, formatted like so:\n\n```\n---\ntitle: SIR Model for COVID-19\nauthor: Lorem, et al.\ndate: 2023-01-31\nversion: v1\n---\n\n== c\nS, Susceptible, -(β * S * I)/N, I\nI, Infected, (β * S * I)/N - γ * I, R\nR, Recovered, γ * I, I\n\n== p\nβ = 3 + (-2 / (1 + e^(-t/10)))\n\n== i\nI = 0.1*N\nS = 0.9*N\nR = 0\n\n== v\nN = 100\nγ = 0.1\n```\n\nThe first section is for front matter, including title, author, and date. The version _must_ be specified. Currently v1 is the only valid version.\n\n`== c` specifes the compartments section. Each line is a new compartment, in the following format:\n\n```csv\nabbreviation, name, equation, connected compartments\n```\n\nThe equation is the right-hand side of the derivative for that compartment. For example, for the Susceptible compartment, the full equation is `dS/dt=-(β * S * I)/N` but the `dS/dt` is implied.\n\n`== p` specifies parameters. Parameters can change value after each timestep. For example, in the example, β changes with each step. Paremters can also specify other parameters, constants, or compartment populations. Compartment populations should be specified with their respective abbreviations.\n\n`== i` specifies the initial values of the compartments. Any constants can also be specified.\n\n`== v` specifies any constants. Other constants may be specified in a constants value, but compartment populations and paremters may not.\n\nNote that `t` is a reserved name for the current time and cannot and should not be used as a constant, parameter, or compartment name/abbrevation. Any common math terms like e or π are also reserved.\n\n---\n\nYou can parse a `.epi` file with the parse function:\n\n```\nimport { parse, model, solve, plot } from 'epispot'\n\nlet m = parse('./path/to/file')\n```\n\nTo solve the model for 100 days with a step size of 0.01, use:\n\n```\nlet data = solve(m, 100, 0.01)\n```\n\nIt will return an object in the format:\n\n```JSON\n{\n    \"S\": [S at 0, S at 0.01, at 0.02...]\n    \"I\": [I at 0, I at 0.01, at 0.02...]\n    \"R\": [R at 0, R at 0.01, at 0.02...]\n}\n```\n\nThe step size is optional, and will default to a step size of 0.1 if left unspecified.\n\nTo plot the model, for 100 days with a step size of 0.01, use:\n\n```\nlet plot = plot(m, 100, 0.01)\n```\n\nThis starts an http server (which is returned so you can manipulate it) with a plotly graph at [http://localhost:3000](http://localhost:3000).\n\nModels may also be created programatically, like so:\n\n```TypeScript\nlet S: model.Compartment = {\n    abbr: \"S\",\n    name: \"Susceptible\",\n    derivative: \"-(β * S * I)/N\",\n    connected: []\n}\nlet I: model.Compartment = {\n    abbr: \"I\",\n    name: \"Infected\",\n    derivative: \"(β * S * I)/N - γ * I\",\n    connected: []\n}\nlet R: model.Compartment = {\n    abbr: \"R\",\n    name: \"Recovered\",\n    derivative: \"γ * I\",\n    connected: []\n}\n\nS.connected = [I]\nI.connected = [R]\n\nlet m: model.Model = {\n    meta: {\n        title: \"SIR Model for COVID-19\",\n        author: \"Lorem, et al.\",\n        date: \"2023-01-31\",\n        version: \"v1\"\n    },\n    compartments: {\n        \"S\": S,\n        \"I\": I,\n        \"R\": R\n    },\n    parameters: {\n        \"β\": \"3 + (-2 / (1 + e^(-t/10)))\"\n    },\n    initialStates: {\n        \"S\": \"0.9*N\",\n        \"I\": \"0.1*N\",\n        \"R\": \"0\"\n    },\n    constants: {\n        \"N\": \"100\",\n        \"γ\": \"0.1\"\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquantalabs%2Fepispot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquantalabs%2Fepispot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquantalabs%2Fepispot/lists"}