{"id":23478116,"url":"https://github.com/rhaiscript/rhai-sci","last_synced_at":"2025-04-14T21:31:34.780Z","repository":{"id":44413431,"uuid":"511557912","full_name":"rhaiscript/rhai-sci","owner":"rhaiscript","description":"Scientific computing for Rhai.","archived":false,"fork":false,"pushed_at":"2023-11-24T15:54:23.000Z","size":349,"stargazers_count":15,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-01T02:12:33.937Z","etag":null,"topics":["lib","rhai","rhai-sci","scripting-language"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/rhai-sci","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rhaiscript.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-07-07T14:22:29.000Z","updated_at":"2024-08-01T16:29:16.000Z","dependencies_parsed_at":"2022-07-14T20:00:38.169Z","dependency_job_id":"338c2e35-3c9d-4d2a-8e09-2b3ebf82c8cd","html_url":"https://github.com/rhaiscript/rhai-sci","commit_stats":{"total_commits":272,"total_committers":2,"mean_commits":136.0,"dds":0.02941176470588236,"last_synced_commit":"d344ab3d68da934b60b8ed6b45532e26afcddf74"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhaiscript%2Frhai-sci","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhaiscript%2Frhai-sci/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhaiscript%2Frhai-sci/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhaiscript%2Frhai-sci/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rhaiscript","download_url":"https://codeload.github.com/rhaiscript/rhai-sci/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231142957,"owners_count":18334321,"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":["lib","rhai","rhai-sci","scripting-language"],"created_at":"2024-12-24T19:16:12.350Z","updated_at":"2025-04-14T21:31:34.770Z","avatar_url":"https://github.com/rhaiscript.png","language":"Rust","readme":"[![Github CI](https://github.com/rhaiscript/rhai-sci/actions/workflows/tests.yml/badge.svg)](https://github.com/rhaiscript/rhai-sci/actions)\n[![Crates.io](https://img.shields.io/crates/v/rhai-sci.svg)](https://crates.io/crates/rhai-sci)\n[![docs.rs](https://img.shields.io/docsrs/rhai-sci/latest?logo=rust)](https://docs.rs/rhai-sci)\n\n# About `rhai-sci`\n\nThis crate provides some basic scientific computing utilities for the [`Rhai`](https://rhai.rs/) scripting language,\ninspired by languages like MATLAB, Octave, and R. For a complete API reference,\ncheck [the docs](https://docs.rs/rhai-sci).\n\n# Install\n\nTo use the latest released version of `rhai-sci`, add this to your `Cargo.toml`:\n\n```toml\nrhai-sci = \"0.2.2\"\n```\n\n# Usage\n\nUsing this crate is pretty simple! If you just want to evaluate a single line of [`Rhai`](https://rhai.rs/), then you\nonly need:\n\n```rust\nuse rhai::INT;\nuse rhai_sci::eval;\nlet result = eval::\u003cINT\u003e(\"argmin([43, 42, -500])\").unwrap();\n```\n\nIf you need to use `rhai-sci` as part of a persistent [`Rhai`](https://rhai.rs/) scripting engine, then do this instead:\n\n```rust\nuse rhai::{Engine, packages::Package, INT};\nuse rhai_sci::SciPackage;\n\n// Create a new Rhai engine\nlet mut engine = Engine::new();\n\n// Add the rhai-sci package to the new engine\nengine.register_global_module(SciPackage::new().as_shared_module());\n\n// Now run your code\nlet value = engine.eval::\u003cINT\u003e(\"argmin([43, 42, -500])\").unwrap();\n```\n\n# Features\n\n| Feature    | Default  | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |\n|------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `metadata` | Disabled | Enables exporting function metadata and is ___necessary for running doc-tests on Rhai examples___.                                                                                                                                                                                                                                                                                                                                                                                                                    |\n| `io`       | Enabled  | Enables the [`read_matrix`](#read_matrixfile_path-string---array) function but pulls in several additional dependencies (`polars`, `url`, `temp-file`, `csv-sniffer`, `minreq`).                                                                                                                                                                                                                                                                                                                                      |\n| `nalgebra` | Enabled  | Enables several functions ([`regress`](#regressx-array-y-array---map), [`inv`](#invmatrix-array---array), [`mtimes`](#mtimesmatrix1-array-matrix2-array---array), [`horzcat`](#horzcatmatrix1-array-matrix2-array---array), [`vertcat`](#vertcatmatrix1-array-matrix2-array---array), [`repmat`](#repmatmatrix-array-nx-i64-ny-i64---array), [`svd`](#svdmatrix-array---map), [`hessenberg`](#hessenbergmatrix-array---map), and [`qr`](#qrmatrix-array---map)) but brings in the `nalgebra` and `linregress` crates. |\n| `rand`     | Enabled  | Enables the [`rand`](#rand) function for generating random FLOAT values and random matrices, but brings in the `rand` crate.                                                                                                                                                                                                                                                                                                                                                                                          |\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhaiscript%2Frhai-sci","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frhaiscript%2Frhai-sci","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhaiscript%2Frhai-sci/lists"}