Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
sparrowzz
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
sgool
sparrowzz
Commits
c36d4633
Commit
c36d4633
authored
Aug 07, 2024
by
dongshufeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor(all): remove some dependencies
parent
3b8346ee
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
8 行增加
和
422 行删除
+8
-422
Cargo.lock
+4
-303
eig-aoe/Cargo.toml
+2
-8
eig-aoe/src/aoe/mod.rs
+2
-100
eig-domain/Cargo.toml
+0
-11
没有找到文件。
Cargo.lock
查看文件 @
c36d4633
...
...
@@ -3,12 +3,6 @@
version = 3
[[package]]
name = "adler"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
[[package]]
name = "aho-corasick"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
...
...
@@ -48,15 +42,6 @@ dependencies = [
]
[[package]]
name = "arbitrary"
version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110"
dependencies = [
"derive_arbitrary",
]
[[package]]
name = "arrow-schema"
version = "52.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
...
...
@@ -78,17 +63,6 @@ dependencies = [
]
[[package]]
name = "async-trait"
version = "0.1.81"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "autocfg"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
...
...
@@ -131,21 +105,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50"
[[package]]
name = "calamine"
version = "0.25.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "58785077b99914cfa7aa07b7203b1d5eb91efcd7d5ffd0f51a98b95c36112ef4"
dependencies = [
"byteorder",
"codepage",
"encoding_rs",
"log",
"quick-xml",
"serde",
"zip 1.1.4",
]
[[package]]
name = "cc"
version = "1.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
...
...
@@ -165,9 +124,7 @@ checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401"
dependencies = [
"android-tzdata",
"iana-time-zone",
"js-sys",
"num-traits",
"wasm-bindgen",
"windows-targets",
]
...
...
@@ -199,15 +156,6 @@ dependencies = [
]
[[package]]
name = "codepage"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "48f68d061bc2828ae826206326e61251aca94c1e4a5305cf52d9138639c918b4"
dependencies = [
"encoding_rs",
]
[[package]]
name = "concurrent-queue"
version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
...
...
@@ -223,15 +171,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f"
[[package]]
name = "crc32fast"
version = "1.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3"
dependencies = [
"cfg-if",
]
[[package]]
name = "cron"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
...
...
@@ -295,28 +234,6 @@ dependencies = [
]
[[package]]
name = "derive_arbitrary"
version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "displaydoc"
version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "ds-3phase-pf"
version = "0.1.0"
dependencies = [
...
...
@@ -405,19 +322,11 @@ dependencies = [
name = "eig-aoe"
version = "0.1.0"
dependencies = [
"async-channel",
"async-trait",
"chrono",
"cron",
"csv",
"eig-domain",
"eig-expr",
"log",
"ndarray",
"num-complex",
"petgraph",
"protobuf",
"rayon",
"serde",
"serde_json",
]
...
...
@@ -426,21 +335,10 @@ dependencies = [
name = "eig-domain"
version = "0.1.0"
dependencies = [
"byteorder",
"bytes",
"calamine",
"csv",
"eig-expr",
"encoding_rs",
"lazy_static",
"log",
"protobuf",
"protobuf-codegen",
"serde",
"serde_json",
"tempfile",
"walkdir",
"zip 2.1.6",
]
[[package]]
...
...
@@ -464,15 +362,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0"
[[package]]
name = "encoding_rs"
version = "0.8.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59"
dependencies = [
"cfg-if",
]
[[package]]
name = "equivalent"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
...
...
@@ -485,7 +374,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba"
dependencies = [
"libc",
"windows-sys
0.52.0
",
"windows-sys",
]
[[package]]
...
...
@@ -522,16 +411,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80"
[[package]]
name = "flate2"
version = "1.0.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f211bbe8e69bbd0cfdea405084f128ae8b4aaa6b0b522fc8f2b009084797920"
dependencies = [
"crc32fast",
"miniz_oxide",
]
[[package]]
name = "fnv"
version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
...
...
@@ -565,7 +444,7 @@ version = "0.5.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5"
dependencies = [
"windows-sys
0.52.0
",
"windows-sys",
]
[[package]]
...
...
@@ -617,12 +496,6 @@ dependencies = [
]
[[package]]
name = "lazy_static"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
[[package]]
name = "libc"
version = "0.2.155"
source = "registry+https://github.com/rust-lang/crates.io-index"
...
...
@@ -635,12 +508,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89"
[[package]]
name = "lockfree-object-pool"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9374ef4228402d4b7e403e5838cb880d9ee663314b0a900d5a6aabf0c213552e"
[[package]]
name = "log"
version = "0.4.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
...
...
@@ -693,15 +560,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
[[package]]
name = "miniz_oxide"
version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08"
dependencies = [
"adler",
]
[[package]]
name = "nalgebra"
version = "0.33.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
...
...
@@ -739,7 +597,6 @@ dependencies = [
"num-integer",
"num-traits",
"rawpointer",
"serde",
]
[[package]]
...
...
@@ -801,27 +658,6 @@ dependencies = [
]
[[package]]
name = "num_enum"
version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179"
dependencies = [
"num_enum_derive",
]
[[package]]
name = "num_enum_derive"
version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56"
dependencies = [
"proc-macro-crate",
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "once_cell"
version = "1.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
...
...
@@ -856,15 +692,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02"
[[package]]
name = "proc-macro-crate"
version = "3.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284"
dependencies = [
"toml_edit",
]
[[package]]
name = "proc-macro2"
version = "1.0.86"
source = "registry+https://github.com/rust-lang/crates.io-index"
...
...
@@ -926,16 +753,6 @@ dependencies = [
]
[[package]]
name = "quick-xml"
version = "0.31.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33"
dependencies = [
"encoding_rs",
"memchr",
]
[[package]]
name = "quote"
version = "1.0.36"
source = "registry+https://github.com/rust-lang/crates.io-index"
...
...
@@ -1015,7 +832,7 @@ dependencies = [
"errno",
"libc",
"linux-raw-sys",
"windows-sys
0.52.0
",
"windows-sys",
]
[[package]]
...
...
@@ -1034,15 +851,6 @@ dependencies = [
]
[[package]]
name = "same-file"
version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
dependencies = [
"winapi-util",
]
[[package]]
name = "serde"
version = "1.0.204"
source = "registry+https://github.com/rust-lang/crates.io-index"
...
...
@@ -1088,12 +896,6 @@ dependencies = [
]
[[package]]
name = "simd-adler32"
version = "0.3.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe"
[[package]]
name = "syn"
version = "2.0.72"
source = "registry+https://github.com/rust-lang/crates.io-index"
...
...
@@ -1114,7 +916,7 @@ dependencies = [
"fastrand",
"once_cell",
"rustix",
"windows-sys
0.52.0
",
"windows-sys",
]
[[package]]
...
...
@@ -1138,23 +940,6 @@ dependencies = [
]
[[package]]
name = "toml_datetime"
version = "0.6.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41"
[[package]]
name = "toml_edit"
version = "0.21.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1"
dependencies = [
"indexmap",
"toml_datetime",
"winnow",
]
[[package]]
name = "typenum"
version = "1.17.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
...
...
@@ -1167,16 +952,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
[[package]]
name = "walkdir"
version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b"
dependencies = [
"same-file",
"winapi-util",
]
[[package]]
name = "wasm-bindgen"
version = "0.2.92"
source = "registry+https://github.com/rust-lang/crates.io-index"
...
...
@@ -1253,15 +1028,6 @@ dependencies = [
]
[[package]]
name = "winapi-util"
version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb"
dependencies = [
"windows-sys 0.59.0",
]
[[package]]
name = "windows-core"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
...
...
@@ -1280,15 +1046,6 @@ dependencies = [
]
[[package]]
name = "windows-sys"
version = "0.59.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b"
dependencies = [
"windows-targets",
]
[[package]]
name = "windows-targets"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
...
...
@@ -1351,59 +1108,3 @@ name = "windows_x86_64_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
[[package]]
name = "winnow"
version = "0.5.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876"
dependencies = [
"memchr",
]
[[package]]
name = "zip"
version = "1.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9cc23c04387f4da0374be4533ad1208cbb091d5c11d070dfef13676ad6497164"
dependencies = [
"arbitrary",
"crc32fast",
"crossbeam-utils",
"displaydoc",
"flate2",
"indexmap",
"num_enum",
"thiserror",
]
[[package]]
name = "zip"
version = "2.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "40dd8c92efc296286ce1fbd16657c5dbefff44f1b4ca01cc5f517d8b7b3d3e2e"
dependencies = [
"arbitrary",
"crc32fast",
"crossbeam-utils",
"displaydoc",
"flate2",
"indexmap",
"memchr",
"thiserror",
"zopfli",
]
[[package]]
name = "zopfli"
version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5019f391bac5cf252e93bbcc53d039ffd62c7bfb7c150414d61369afe57e946"
dependencies = [
"bumpalo",
"crc32fast",
"lockfree-object-pool",
"log",
"once_cell",
"simd-adler32",
]
eig-aoe/Cargo.toml
查看文件 @
c36d4633
...
...
@@ -7,18 +7,11 @@ rust-version.workspace = true
[dependencies]
log
=
"^0.4"
async-trait
=
"0.1"
async-channel
=
"2.3"
csv
=
"1.3"
cron
=
"0.12"
rayon
=
"1.10"
chrono
=
"0.4"
serde
=
{
version
=
"1"
,
features
=
["derive"]
}
serde_json
=
"1.0"
petgraph
=
"0.6"
protobuf
=
"3.5"
ndarray
=
{
version
=
"0.15"
,
features
=
["serde"]
}
num-complex
=
"0.4"
# this repo
eig-domain
=
{
path
=
"../eig-domain"
}
eig-expr
=
{
path
=
"../eig-expr"
}
\ No newline at end of file
eig-aoe/src/aoe/mod.rs
查看文件 @
c36d4633
// flowing should as same as in sparrowzz
use
std
::
collections
::
HashMap
;
use
std
::
fmt
;
use
std
::
fmt
::
Display
;
use
std
::
str
::
FromStr
;
use
std
::
time
::
Duration
;
use
async_channel
::
Receiver
;
use
async_channel
::
RecvError
;
use
async_channel
::
Sender
;
use
async_trait
::
async_trait
;
use
ndarray
::{
Array
,
IxDyn
};
use
petgraph
::
prelude
::
*
;
use
serde
::{
Deserialize
,
Serialize
};
use
eig_domain
::{
SetFloatValue
,
SetIntValue
};
use
eig_expr
::{
Expr
,
MyF
};
use
crate
::{
ExprGraph
,
MeasureBuf
};
const
AOE_MEAS_BUF_NUM
:
usize
=
100
;
#[async_trait]
pub
trait
Action
:
Sync
{
/// 执行
async
fn
do_action
(
&
self
,
aoe
:
&
Aoe
)
->
ActionResult
;
}
#[derive(Serialize,
Deserialize,
Debug,
Clone)]
pub
enum
ActionExeResult
{
NotRun
,
Success
,
Failed
(
u32
),
}
#[derive(Serialize,
Deserialize,
Debug,
Clone)]
pub
enum
EventEvalResult
{
Happen
,
NotHappen
,
Canceled
,
Error
,
}
#[derive(Serialize,
Deserialize,
Debug,
Clone)]
pub
struct
ActionResult
{
pub
start_time
:
u64
,
pub
end_time
:
u64
,
pub
yk_ids
:
Option
<
Vec
<
(
u64
,
i64
)
>>
,
pub
yt_ids
:
Option
<
Vec
<
(
u64
,
f64
)
>>
,
pub
num_result
:
HashMap
<
String
,
f64
>
,
#[serde(skip)]
pub
tensor_result
:
HashMap
<
String
,
Array
<
f64
,
IxDyn
>>
,
pub
final_result
:
ActionExeResult
,
}
#[derive(Serialize,
Deserialize,
Debug,
Clone)]
pub
struct
EventResult
{
pub
start_time
:
u64
,
pub
end_time
:
u64
,
pub
final_result
:
EventEvalResult
,
}
#[derive(Serialize,
Deserialize,
Debug,
Clone)]
pub
struct
AoeResult
{
pub
aoe_id
:
u64
,
pub
start_time
:
u64
,
pub
end_time
:
u64
,
pub
action_result
:
Vec
<
(
u64
,
u64
,
ActionResult
)
>
,
pub
event_result
:
Vec
<
(
u64
,
EventResult
)
>
,
}
pub
enum
OuterMsg
{
Cancel
,
VarOrMeasure
(
VarOrMeasures
),
QueueError
(
RecvError
),
}
use
crate
::
MeasureBuf
;
/**
* @api {时间对象} /Duration Duration
...
...
@@ -360,36 +296,3 @@ impl PartialEq for AoeModel {
b
}
}
#[derive(Debug,
Clone)]
pub
struct
Aoe
{
/// 接收更新的测点值
pub
(
crate
)
measure_rx
:
Receiver
<
VarOrMeasures
>
,
/// 提供给外部的发送端
measure_tx
:
Sender
<
VarOrMeasures
>
,
/// 接收取消指令
pub
(
crate
)
cancel_rx
:
Receiver
<
()
>
,
/// 提供给外部的控制端
cancel_tx
:
Sender
<
()
>
,
/// 发送控点指令的队列
control_rx
:
Receiver
<
(
Vec
<
SetIntValue
>
,
Vec
<
SetFloatValue
>
)
>
,
pub
control_tx
:
Sender
<
(
Vec
<
SetIntValue
>
,
Vec
<
SetFloatValue
>
)
>
,
pub
model
:
AoeModel
,
/// 存储Aoe网络, 节点表示事件,边表示action实体的id
pub
(
crate
)
graph
:
DiGraph
<
usize
,
(
usize
,
usize
)
>
,
/// 拓扑排序的结果
pub
(
crate
)
toposort_nodes
:
Vec
<
u64
>
,
/// 存储node的map
pub
(
crate
)
nodes
:
HashMap
<
u64
,
NodeIndex
>
,
/// 存储aoe对应的测点的值
pub
measure_buf
:
MeasureBuf
,
/// 上下文,用于存储变量计算结果
pub
context
:
HashMap
<
String
,
MyF
>
,
// 用户自定义变量的编号,其中包括上面对应公式的,也包括计算产生的
// 对应公式的index从1开始,方便找到它在variables中的位置
// 要求用户0-1000不能用于测点号,否则会有问题
pub
(
crate
)
var_index
:
HashMap
<
String
,
u64
>
,
// 上面定义变量相互之间的关系
pub
(
crate
)
expr_graph
:
Option
<
ExprGraph
>
,
}
// above should as same as in sparrowzz
\ No newline at end of file
eig-domain/Cargo.toml
查看文件 @
c36d4633
...
...
@@ -7,19 +7,8 @@ rust-version.workspace = true
build
=
"build.rs"
[dependencies]
log
=
"0.4"
bytes
=
"1.6"
byteorder
=
"1.5"
lazy_static
=
"1.5"
csv
=
"1.3"
calamine
=
{
version
=
"0.25"
}
serde
=
{
version
=
"1.0"
,
features
=
["derive"]
}
serde_json
=
"1.0"
protobuf
=
{
version
=
"3.5"
,
features
=
["with-bytes"]
}
encoding_rs
=
"0.8"
zip
=
{
version
=
"2.1"
,
default-features
=
false
,
features
=
["deflate"]
}
tempfile
=
{
version
=
"3.10"
}
walkdir
=
{
version
=
"2.5"
}
# this project
eig-expr
=
{
path
=
"../eig-expr"
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论