Skip to content

Commit e4d24aa

Browse files
committed
More chores, and updated github action to hopefully work in a workspace
1 parent f0992eb commit e4d24aa

File tree

30 files changed

+604
-352
lines changed

30 files changed

+604
-352
lines changed

.github/workflows/release_rust.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ on:
33
push:
44
branches:
55
- release
6-
defaults:
7-
run:
8-
working-directory: ./apps/fluster
96
# This is the example from the readme.
107
# On each push to the `release` branch it will create or update a GitHub release, build your app, and upload the artifacts to the release.
118

@@ -53,6 +50,8 @@ jobs:
5350
env:
5451
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5552
with:
53+
projectPath: apps/fluster
54+
distPath: apps/fluster/dist
5655
tagName: app-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version.
5756
releaseName: "App v__VERSION__"
5857
releaseBody: "See the assets to download this version and install."

apps/fluster/src-tauri/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,6 @@ ollama-rs = { version = "0.3.1", features = ["stream"] }
7272
futures-util = "0.3.31"
7373
futures = "0.3.31"
7474
serde_arrow = { version = "0.13.3", features = ["arrow-54"] }
75-
# kalosm = { version = "0.4.0", features = [
76-
# "full",
77-
# ], git = "https://github.com/floneum/floneum" }
7875
fast_qr = { version = "0.13.0", features = ["svg"] }
7976
kalosm = { version = "0.4.0", features = ["full", "metal"] }
8077
async-trait = "0.1.88"

apps/fluster/src-tauri/src/core/types/errors/errors.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,9 @@ pub enum FlusterError {
164164
"We couldn't save some tags. If this occurs frequently, please file an issue on Github."
165165
)]
166166
FailToUpsertTags,
167+
// -- Python --
168+
#[error("Failed to execute python via rust.")]
169+
FailToExecutePython,
167170
}
168171

169172
pub type FlusterResult<T> = Result<T, FlusterError>;

apps/fluster/src-tauri/src/features/math/commands/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ pub mod delete_equation_by_id;
22
pub mod delete_equation_snippet;
33
pub mod get_equation_by_id;
44
pub mod get_equations;
5+
pub mod numpy;
56
pub mod read_mathjax_file;
67
pub mod save_equation;
78
pub mod save_equation_snippet;
8-
pub mod numpy;
Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
1-
// use numpy::{self, ndarray::NdFloat};
2-
3-
use std::num;
4-
51
#[tauri::command]
62
#[specta::specta]
73
pub async fn arange(from: f64, to: f64, step: f64) -> Vec<f64> {
8-
let items: Vec<f64> = Vec::new();
9-
// let gap = math.a(to - from) / step
10-
// numpy::ndarray::range(from, to, step).collect()
11-
items
4+
ndarray::range(from, to, step).collect()
125
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
use crate::features::math::data::props::number_props::ArrayGeneratorProps;
2+
3+
use super::linspace::linspace;
4+
5+
#[tauri::command]
6+
#[specta::specta]
7+
pub async fn axis_grid(axis: ArrayGeneratorProps) -> Vec<Vec<f64>> {
8+
let mut axis_data: Vec<Vec<f64>> = Vec::new();
9+
for _ in 0..axis.count {
10+
let j = linspace(axis.min, axis.max, axis.count).await;
11+
axis_data.push(j);
12+
}
13+
axis_data
14+
}
15+
16+
#[tauri::command]
17+
#[specta::specta]
18+
pub async fn grid_2d(x: ArrayGeneratorProps, y: ArrayGeneratorProps) -> Vec<Vec<Vec<f64>>> {
19+
let (_x, _y) = tokio::join!(axis_grid(x), axis_grid(y));
20+
vec![_x, _y]
21+
}
Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
use std::num;
2-
31
#[tauri::command]
42
#[specta::specta]
5-
pub async fn linspace(from: f64, to: f64, n_items: f64) -> Vec<f64> {
6-
let items: Vec<f64> = Vec::new();
7-
// let gap = math.a(to - from) / step
8-
// numpy::ndarray::range(from, to, step).collect()
9-
items
3+
pub async fn linspace(from: f64, to: f64, n_items: usize) -> Vec<f64> {
4+
ndarray::linspace(from, to, n_items).collect()
105
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#[tauri::command]
2+
#[specta::specta]
3+
pub async fn logspace(base: f64, a: f64, b: f64, n: usize) -> Vec<f64> {
4+
ndarray::logspace(base, a, b, n).collect()
5+
}

apps/fluster/src-tauri/src/features/math/commands/numpy/meshgrid.rs

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
pub mod arange;
2+
pub mod grid;
23
pub mod linspace;
3-
pub mod meshgrid;
4+
pub mod logspace;

0 commit comments

Comments
 (0)