Skip to content

Commit 55e458d

Browse files
authored
Merge pull request #17 from cmccomb/master
Removal of machine learning to prepare for rhai-ml
2 parents 6580d2f + 72a2c4a commit 55e458d

File tree

9 files changed

+100
-235
lines changed

9 files changed

+100
-235
lines changed

Cargo.toml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rhai-sci"
3-
version = "0.1.9"
3+
version = "0.2.0"
44
edition = "2021"
55
authors = ["Chris McComb <[email protected]>"]
66
description = "Scientific computing in the Rhai scripting language"
@@ -19,10 +19,9 @@ metadata = ["rhai/metadata"]
1919
io = ["polars", "url", "temp-file", "csv-sniffer", "minreq"]
2020
nalgebra = ["nalgebralib", "linregress"]
2121
rand = ["randlib"]
22-
smartcore = ["smartcorelib", "bincode"]
2322

2423
[dependencies]
25-
rhai = "1.8"
24+
rhai = ">=1.8.0"
2625
nalgebralib = {version = "0.32.1", optional = true, package = "nalgebra" }
2726
polars = {version = "0.27.2", optional = true }
2827
url = {version = "2.2.2", optional = true }
@@ -32,11 +31,9 @@ minreq = { version = "2.6.0", features = ["json-using-serde", "https"], optional
3231
randlib = { version = "0.8", optional = true, package = "rand" }
3332
smartstring = "1.0.1"
3433
linregress = { version = "0.5.0", optional = true }
35-
smartcorelib = {version = "0.3.0", optional = true, package = "smartcore", features=["serde"]}
36-
bincode = { version = "1.3.3", optional = true }
3734

3835
[build-dependencies]
39-
rhai = "1.8"
36+
rhai = ">=1.8.0"
4037
nalgebralib = {version = "0.32.1", optional = true, package = "nalgebra" }
4138
polars = {version = "0.27.2", optional = true }
4239
url = {version = "2.2.2", optional = true }
@@ -48,8 +45,6 @@ serde_json = "1.0.82"
4845
serde = "1.0.140"
4946
smartstring = "1.0.1"
5047
linregress = { version = "0.5.0", optional = true }
51-
smartcorelib = {version = "0.3.0", optional = true, package = "smartcore", features=["serde"]}
52-
bincode = { version = "1.3.3", optional = true }
5348

5449
[package.metadata.docs.rs]
5550
all-features = true

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,4 @@ let value = engine.eval::<INT>("argmin([43, 42, -500])").unwrap();
5454
| `metadata` | Disabled | Enables exporting function metadata and is ___necessary for running doc-tests on Rhai examples___. |
5555
| `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`). |
5656
| `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. |
57-
| `rand` | Enabled | Enables the [`rand`](#rand) function for generating random FLOAT values and random matrices, but brings in the `rand` crate. |
58-
| `smartcore` | Enabled | Enables the [`eigs`](#eigsmatrix-array---map), [`train`](#trainx-array-y-array-algorithm-string---model), and [`predict`](#predictx-array-model-model---array) functions, but brings in the `smartcore` and `bincode` crates. |
57+
| `rand` | Enabled | Enables the [`rand`](#rand) function for generating random FLOAT values and random matrices, but brings in the `rand` crate. |

build.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ fn main() {
66

77
// Make empty file for documentation and tests
88
std::fs::File::create(std::env::var("OUT_DIR").unwrap() + "/rhai-sci-docs.md").unwrap();
9-
std::fs::File::create("tests/rhai-sci-tests.rs").unwrap();
9+
std::fs::File::create(std::env::var("OUT_DIR").unwrap() + "/rhai-sci-tests.rs").unwrap();
1010
}
1111

1212
#[cfg(feature = "metadata")]
@@ -40,7 +40,7 @@ fn main() {
4040
std::fs::File::create(std::env::var("OUT_DIR").unwrap() + "/rhai-sci-docs.md").unwrap();
4141

4242
// Make a file for tests
43-
let mut test_file = std::fs::File::create("tests/rhai-sci-tests.rs").unwrap();
43+
let mut test_file = std::fs::File::create(std::env::var("OUT_DIR").unwrap() + "/rhai-sci-tests.rs").unwrap();
4444

4545
// Build an engine for doctests
4646
let mut engine = Engine::new();
@@ -57,7 +57,6 @@ fn main() {
5757
combine_with_exported_module!(&mut lib, "rhai_sci_sets", set_functions);
5858
combine_with_exported_module!(&mut lib, "rhai_sci_moving", moving_functions);
5959
combine_with_exported_module!(&mut lib, "rhai_sci_validate", validation_functions);
60-
combine_with_exported_module!(&mut lib, "rhai_sci_machine_learing", ml_functions);
6160
engine.register_global_module(rhai::Shared::new(lib));
6261

6362
// Extract metadata
@@ -214,7 +213,6 @@ mod functions {
214213
include!("src/moving.rs");
215214
include!("src/validate.rs");
216215
include!("src/patterns.rs");
217-
include!("src/machine_learning.rs");
218216
}
219217

220218
#[cfg(feature = "metadata")]

src/cumulative.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ pub mod cum_functions {
102102
/// ```
103103
#[rhai_fn(name = "cumtrapz", return_raw, pure)]
104104
pub fn cumtrapz_unit(y: &mut Array) -> Result<Array, Box<EvalAltResult>> {
105-
crate::if_list_convert_to_vec_float_and_do(y, |yf| {
105+
if_list_convert_to_vec_float_and_do(y, |yf| {
106106
let mut trapsum = 0.0 as FLOAT;
107107
let mut cumtrapsum = vec![Dynamic::FLOAT_ZERO];
108108
for i in 1..yf.len() {

src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ mod sets;
2828
use sets::set_functions;
2929
mod validate;
3030
use validate::validation_functions;
31-
mod machine_learning;
32-
use machine_learning::ml_functions;
3331

3432
def_package! {
3533
/// Package for scientific computing
@@ -45,7 +43,6 @@ def_package! {
4543
combine_with_exported_module!(lib, "rhai_sci_sets", set_functions);
4644
combine_with_exported_module!(lib, "rhai_sci_moving", moving_functions);
4745
combine_with_exported_module!(lib, "rhai_sci_validation", validation_functions);
48-
combine_with_exported_module!(lib, "rhai_sci_machine_learing", ml_functions);
4946
}
5047
}
5148

src/machine_learning.rs

Lines changed: 0 additions & 163 deletions
This file was deleted.

0 commit comments

Comments
 (0)