{"id":37061443,"url":"https://github.com/uio-bmi/dagsim","last_synced_at":"2026-01-14T06:57:26.706Z","repository":{"id":43363595,"uuid":"360632716","full_name":"uio-bmi/dagsim","owner":"uio-bmi","description":"A framework and specification language for simulating data based on graphical models","archived":false,"fork":false,"pushed_at":"2025-05-02T07:43:20.000Z","size":6809,"stargazers_count":19,"open_issues_count":1,"forks_count":3,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-12-08T17:19:02.001Z","etag":null,"topics":["bayesian-network","causal-models","directed-acyclic-graph","python","simulation"],"latest_commit_sha":null,"homepage":"https://uio-bmi.github.io/dagsim/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/uio-bmi.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-22T17:42:52.000Z","updated_at":"2025-05-02T07:43:24.000Z","dependencies_parsed_at":"2024-08-30T20:00:09.738Z","dependency_job_id":null,"html_url":"https://github.com/uio-bmi/dagsim","commit_stats":{"total_commits":268,"total_committers":2,"mean_commits":134.0,"dds":"0.11940298507462688","last_synced_commit":"3eb2acb8b01f95ce69ac4693142543163bbdeaf2"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/uio-bmi/dagsim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uio-bmi%2Fdagsim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uio-bmi%2Fdagsim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uio-bmi%2Fdagsim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uio-bmi%2Fdagsim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uio-bmi","download_url":"https://codeload.github.com/uio-bmi/dagsim/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uio-bmi%2Fdagsim/sbom","scorecard":{"id":907574,"data":{"date":"2025-08-11","repo":{"name":"github.com/uio-bmi/dagsim","commit":"9a924608bef01ec89709b1a608ee5fa647daa75a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 1/28 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/publish_to_pypi.yml:1","Warn: no topLevel permission defined: .github/workflows/sphinx.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish_to_pypi.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/uio-bmi/dagsim/publish_to_pypi.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish_to_pypi.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/uio-bmi/dagsim/publish_to_pypi.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish_to_pypi.yml:51: update your workflow using https://app.stepsecurity.io/secureworkflow/uio-bmi/dagsim/publish_to_pypi.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/sphinx.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/uio-bmi/dagsim/sphinx.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/sphinx.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/uio-bmi/dagsim/sphinx.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/sphinx.yml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/uio-bmi/dagsim/sphinx.yml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/publish_to_pypi.yml:46","Warn: pipCommand not pinned by hash: .github/workflows/sphinx.yml:23","Warn: pipCommand not pinned by hash: .github/workflows/sphinx.yml:24","Warn: pipCommand not pinned by hash: .github/workflows/sphinx.yml:25","Warn: pipCommand not pinned by hash: .github/workflows/sphinx.yml:26","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned","Info:   0 out of   5 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU Affero General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/publish_to_pypi.yml:12"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 5 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"59 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-3c5c-7235-994j","Warn: Project is vulnerable to: GHSA-3f63-hfp8-52jq","Warn: Project is vulnerable to: PYSEC-2021-41 / GHSA-3wvg-mj6g-m9cv","Warn: Project is vulnerable to: PYSEC-2020-77 / GHSA-3xv8-3j54-hgrp","Warn: Project is vulnerable to: PYSEC-2020-80 / GHSA-43fq-w8qq-v88h","Warn: Project is vulnerable to: GHSA-44wm-f244-xhp3","Warn: Project is vulnerable to: GHSA-4fx9-vc88-q2xc","Warn: Project is vulnerable to: PYSEC-2021-35 / GHSA-57h3-9rgr-c24m","Warn: Project is vulnerable to: PYSEC-2020-172 / GHSA-5gm3-px64-rw72","Warn: Project is vulnerable to: PYSEC-2021-331 / GHSA-7534-mm45-c74v","Warn: Project is vulnerable to: PYSEC-2021-92 / GHSA-7r7m-5h27-29hp","Warn: Project is vulnerable to: PYSEC-2020-78 / GHSA-8843-m7mw-mxqm","Warn: Project is vulnerable to: PYSEC-2023-227 / GHSA-8ghj-p4vj-mr35","Warn: Project is vulnerable to: PYSEC-2014-87 / GHSA-8m9x-pxwq-j236","Warn: Project is vulnerable to: PYSEC-2022-10 / GHSA-8vj2-vxx3-667w","Warn: Project is vulnerable to: PYSEC-2021-36 / GHSA-8xjq-8fcg-g5hw","Warn: Project is vulnerable to: PYSEC-2016-6 / GHSA-8xjv-v9xq-m5h9","Warn: Project is vulnerable to: PYSEC-2021-42 / GHSA-95q3-8gr9-gm8w","Warn: Project is vulnerable to: PYSEC-2022-168 / GHSA-9j59-75qj-795w","Warn: Project is vulnerable to: PYSEC-2014-10 / GHSA-cfmr-38g9-f2h7","Warn: Project is vulnerable to: PYSEC-2020-76 / GHSA-cqhg-xjhh-p8hf","Warn: Project is vulnerable to: PYSEC-2021-40 / GHSA-f4w8-cv6p-x6r5","Warn: Project is vulnerable to: PYSEC-2021-69 / GHSA-f5g8-5qq7-938w","Warn: Project is vulnerable to: PYSEC-2021-139 / GHSA-g6rj-rv7j-xwp4","Warn: Project is vulnerable to: PYSEC-2015-16 / GHSA-h5rf-vgqx-wjv2","Warn: Project is vulnerable to: PYSEC-2016-5 / GHSA-hggx-3h72-49ww","Warn: Project is vulnerable to: PYSEC-2020-84 / GHSA-hj69-c76v-86wr","Warn: Project is vulnerable to: PYSEC-2016-7 / GHSA-hvr8-466p-75rh","Warn: Project is vulnerable to: PYSEC-2015-15 / GHSA-j6f7-g425-4gmx","Warn: Project is vulnerable to: GHSA-j7hp-h8jx-5ppr","Warn: Project is vulnerable to: PYSEC-2019-110 / GHSA-j7mj-748x-7p78","Warn: Project is vulnerable to: GHSA-jgpv-4h4c-xhw3","Warn: Project is vulnerable to: PYSEC-2022-42979 / GHSA-m2vv-5vj5-2hm7","Warn: Project is vulnerable to: PYSEC-2021-37 / GHSA-mvg9-xffr-p774","Warn: Project is vulnerable to: PYSEC-2020-83 / GHSA-p49h-hjvm-jg3h","Warn: Project is vulnerable to: PYSEC-2022-8 / GHSA-pw3c-h7wp-cvhx","Warn: Project is vulnerable to: PYSEC-2021-93 / GHSA-q5hq-fp76-qmrc","Warn: Project is vulnerable to: PYSEC-2020-82 / GHSA-r7rm-8j6h-r933","Warn: Project is vulnerable to: PYSEC-2014-23 / GHSA-r854-96gq-rfg3","Warn: Project is vulnerable to: PYSEC-2016-8 / GHSA-rwr3-c2q8-gm56","Warn: Project is vulnerable to: PYSEC-2020-81 / GHSA-vcqg-3p29-xw73","Warn: Project is vulnerable to: PYSEC-2020-79 / GHSA-vj42-xq3r-hr3r","Warn: Project is vulnerable to: PYSEC-2021-70 / GHSA-vqcj-wrf2-7v73","Warn: Project is vulnerable to: PYSEC-2016-9 / GHSA-w4vg-rf63-f3j3","Warn: Project is vulnerable to: PYSEC-2014-22 / GHSA-x895-2wrm-hvp7","Warn: Project is vulnerable to: PYSEC-2022-9 / GHSA-xrcv-f9gm-v42c","Warn: Project is vulnerable to: PYSEC-2021-137","Warn: Project is vulnerable to: PYSEC-2021-138","Warn: Project is vulnerable to: PYSEC-2021-317","Warn: Project is vulnerable to: PYSEC-2021-38","Warn: Project is vulnerable to: PYSEC-2021-39","Warn: Project is vulnerable to: PYSEC-2021-94","Warn: Project is vulnerable to: PYSEC-2023-175","Warn: Project is vulnerable to: PYSEC-2021-142 / GHSA-8q59-q68h-6hv4","Warn: Project is vulnerable to: PYSEC-2018-49 / GHSA-rprw-h62v-c2w7","Warn: Project is vulnerable to: GHSA-29gw-9793-fvw7","Warn: Project is vulnerable to: PYSEC-2022-12 / GHSA-pq7m-3gw7-gq5x","Warn: Project is vulnerable to: GHSA-6p56-wp2h-9hxr","Warn: Project is vulnerable to: GHSA-fpfv-jqm9-f5jm"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-24T17:52:57.656Z","repository_id":43363595,"created_at":"2025-08-24T17:52:57.656Z","updated_at":"2025-08-24T17:52:57.656Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28412478,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["bayesian-network","causal-models","directed-acyclic-graph","python","simulation"],"created_at":"2026-01-14T06:57:25.919Z","updated_at":"2026-01-14T06:57:26.701Z","avatar_url":"https://github.com/uio-bmi.png","language":"Python","readme":"# DagSim\n\n[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/uio-bmi/dagsim/main?labpath=tutorials%2Fhello_world.ipynb)\n\nDagSim is a Python-based framework and specification language for simulating data based on a Directed Acyclic Graph (\nDAG) structure, without any constraints on variable types or functional relations. A succinct YAML format for\ndefining the structure of the simulation model promotes transparency, while separate user-provided functions for\ngenerating each variable based on its parents ensure the modularization of the simulation code.\n\nLink to the paper: https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0284443\n\n## Installation\n\nDagSim can be easily installed using pip.\n\n### Installing DagSim using [pip](https://pypi.org/project/dagsim/)\n\nTo install the DagSim package using `pip`, run:\n\n```bash\npip install dagsim\n```\n\n#### Quickstart\n\nTo check that DagSim is installed properly, run the following command in the console/terminal:\n\n```bash\ndagsim-quickstart\n```\n\n#### Installing graphviz\n\nIf you use `pip`, you need to install graphviz on the system level in order to use the drawing functionality in DagSim.\nPlease follow the instrcutions [here](https://graphviz.org/download/) on how to install graphviz depending on the\noperating system.\n\n\n[//]: # (### Installing DagSim using conda)\n\n[//]: # (To install the DagSim package using `conda`, run:)\n\n[//]: # (```bash)\n\n[//]: # (conda install dagsim)\n\n[//]: # (```)\n\n[//]: # (With `conda`, graphviz is automatically installed, both, as a python package and at the system level.)\n\n## Simple example\n\n### Python code\n\nSuppose we are interested in simulating two variables, X and Y, where X follows a standard Gaussian distribution, and Y\nis the square of X.\n\nFor each node we need a function to simulate the node's values:\n\n- For X, we can use the `numpy.random.normal` function\n- For Y, we can use either `numpy.power` or define our own function. We will use the second to illustrate how one can\n  use\n  user-define functions.\n\n```python\n# needed imports\nimport dagsim.base as ds\nimport numpy as np\n```\n\nHere, we define our own `square` function:\n\n```python\ndef square(arg):\n    return arg * arg\n```\n\nThen, we define the nodes in our graph/model by giving each node a name, the function to use in order to evaluate its\nvalue, and the arguments of the function, if any:\n\n```python\nX = ds.Node(name=\"X\", function=np.random.normal)\nY = ds.Node(name=\"Y\", function=square, kwargs={\"arg\": X})\n```\n\nAfter that, we define the graph itself by giving it a name (optional) and a list of all the nodes to be included:\n\n```python\ngraph = ds.Graph(name=\"demo_graph\", list_nodes=[X, Y])\n```\n\nIf you wish, you can draw the graph by calling the `draw` method, as follows:\n\n```python\ngraph.draw()\n```\n\nFinally, we simulate data from this graph by calling the `simulate` method, and giving it the number of samples you\nwant to simulate, and a name for the csv_file (optional) where the data should be saved.\n\n```python\ndata = graph.simulate(num_samples=10, csv_name=\"demo_data\")\n```\n\nHere, `data` would be a dictionary with keys being the names of the nodes in the graph, and the corresponding values\nbeing the simulated values for each node returned as a Python `list`.\n\nFor more detailed instructions, check\nthis [page](https://uio-bmi.github.io/dagsim/specify_with_code.html#how-to-specify-a-simulation-using-python-code), and\nfor other simple examples, please refer to the `tutorials` folder.\n\n### YAML Specification\n\ndagsim also allows the specification of a simulation using a YAML file. You can run dagsim on a YAML file by running:\n\n```shell\ndagsim path/to/yaml/file [-v|--verbose] [-d|--draw] [-o output/path|--output_path=output/path]\n```\n\nFor a tutorial on using a YAMl file for simulation, check\nthis [page](https://uio-bmi.github.io/dagsim/specify_with_code.html#how-to-specify-a-simulation-using-yaml).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuio-bmi%2Fdagsim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuio-bmi%2Fdagsim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuio-bmi%2Fdagsim/lists"}