Skip to content

Commit

Permalink
restructure
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelDkhn committed Aug 11, 2024
1 parent 6137f22 commit f1b6961
Show file tree
Hide file tree
Showing 12 changed files with 42 additions and 8 deletions.
File renamed without changes.
8 changes: 6 additions & 2 deletions Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
[workspace]
members = ["packages/algo", "packages/ml", "packages/numbers"]
members = [
"packages/algo",
"packages/ml",
"packages/numbers",
"package/data_structures",
]
name = "orion"
version = "0.1.0"
description = "Cairo libraries to build the intelligence of verifiable agents"
Expand All @@ -15,4 +20,3 @@ definitions = "proto/orion.proto"

[cairo]
enable-gas = false

1 change: 1 addition & 0 deletions packages/algo/Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ cairo_test = "2.7.0"

[dependencies]
orion_numbers = { path = "../numbers" }
orion_data_structures = { path = "../data_structures" }

[cairo]
enable-gas=false
2 changes: 1 addition & 1 deletion packages/algo/src/algo/cdf.cairo
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use core::array::{SpanTrait, SpanIter};
use orion_algo::span_math::SpanMathTrait;
use orion_numbers::FixedTrait;
use orion_data_structures::SpanMathTrait;

/// Computes the cumulative distribution function (CDF) for a given set of values using the
/// standard normal distribution formula. This implementation allows for optional location (`loc`)
Expand Down
2 changes: 1 addition & 1 deletion packages/algo/src/algo/linear_fit.cairo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use orion_algo::span_math::SpanMathTrait;
use orion_data_structures::SpanMathTrait;
use orion_numbers::FixedTrait;

/// Performs a linear least squares fitting to provided data points. This function calculates
Expand Down
1 change: 0 additions & 1 deletion packages/algo/src/lib.cairo
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
pub mod span_math;
pub mod algo;
15 changes: 15 additions & 0 deletions packages/data_structures/Scarb.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[package]
name = "orion_data_structures"
version = "0.1.0"
edition = "2023_11"

# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html

[dev-dependencies]
cairo_test = "2.7.0"

[dependencies]
orion_numbers = { path = "../numbers" }

[cairo]
enable-gas=false
3 changes: 3 additions & 0 deletions packages/data_structures/src/lib.cairo
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pub mod span;

pub use {span::FixedSpanMath, span::SpanMathTrait};
14 changes: 14 additions & 0 deletions packages/data_structures/src/span.cairo
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
pub mod span_fixed;

use orion_numbers::FixedTrait;

pub use span_fixed::FixedSpanMath;

pub trait SpanMathTrait<T> {
fn arange(n: u32) -> Span<T>;
fn dot(self: Span<T>, other: Span<T>) -> T;
fn max(self: Span<T>) -> T;
fn min(self: Span<T>) -> T;
fn prod(self: Span<T>) -> T;
fn sum(self: Span<T>) -> T;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use core::ops::AddAssign;

use orion_numbers::{FixedTrait};

use orion_algo::span_math::SpanMathTrait;
use super::SpanMathTrait;


pub impl FixedSpanMath<
Expand Down
1 change: 0 additions & 1 deletion packages/ml/.tool-versions

This file was deleted.

1 change: 0 additions & 1 deletion packages/numbers/.tool-versions

This file was deleted.

0 comments on commit f1b6961

Please sign in to comment.