Skip to content

Commit f411d1d

Browse files
Facade (#1)
* Codecov and other changes * Test workflow * Facade
1 parent 54aa0e4 commit f411d1d

36 files changed

+670
-553
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ It would be nice to have screenshot or result image uploaded
1515
Some minimal reproduce code is highly recommended
1616

1717
**Version Information**
18-
Please give us what version you are using. If you are pulling `Plotters` directly from git repo, please mention this as well
18+
Please give us what version you are using. If you are pulling `UX Indicators` directly from git repo, please mention this as well

.github/ISSUE_TEMPLATE/feature_request.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: Feature request
3-
about: Suggest an idea to Plotter maintainers
3+
about: Suggest an idea to UX Indicators maintainers
44
title: "[Feature Request]"
55
labels: feature request
66
assignees: ''

.github/codecov.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
comment:
2+
layout: "diff, flags, files"
3+
require_changes: true
4+
5+
coverage:
6+
status:
7+
project:
8+
default:
9+
informational: true

.github/workflows/audit.yaml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Security audit
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- master
7+
schedule:
8+
- cron: '0 0 * * 0'
9+
10+
jobs:
11+
security_audit:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- uses: actions-rs/audit-check@v1
16+
with:
17+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/coverage.yaml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Coverage
2+
3+
#on:
4+
# push:
5+
# branches:
6+
# - main
7+
# pull_request:
8+
9+
on: [push, pull_request]
10+
11+
env:
12+
CARGO_TERM_COLOR: always
13+
RUST_BACKTRACE: full
14+
15+
jobs:
16+
coverage:
17+
name: Coverage
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v2
22+
23+
- name: Install Rust
24+
uses: actions-rs/toolchain@v1
25+
with:
26+
toolchain: nightly
27+
profile: minimal
28+
default: true
29+
30+
- name: Restore cache
31+
uses: Swatinem/rust-cache@v1
32+
33+
- name: Run cargo-tarpaulin
34+
uses: actions-rs/[email protected]
35+
with:
36+
args: '--all-features --run-types Doctests,Tests'
37+
timeout: 120
38+
39+
- name: Upload to codecov.io
40+
uses: codecov/codecov-action@239febf655bba88b16ff5dea1d3135ea8663a1f9
41+
with:
42+
token: ${{ secrets.CODECOV_TOKEN }}
43+
44+
- name: Archive code coverage results
45+
uses: actions/upload-artifact@v2
46+
with:
47+
name: code-coverage-report
48+
path: cobertura.xml
49+
retention-days: 30

.github/workflows/tests.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Tests
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v1
12+
- name: Build
13+
run: cargo build --verbose
14+
- name: Run tests
15+
run: cargo test --verbose
16+
17+
clippy_check:
18+
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- uses: actions/checkout@v1
23+
- run: rustup component add clippy
24+
- uses: actions-rs/clippy-check@v1
25+
with:
26+
token: ${{ secrets.GITHUB_TOKEN }}
27+
args: --all-features

Cargo.toml

+5-5
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ maintenance = { status = "actively-developed" }
1919
name = "indicators"
2020

2121
[dependencies]
22-
serde = "1.0"
22+
serde = { version = "1.0", features = ["derive"] }
2323
serde_json = "1.0"
2424
serde_derive = "1.0"
2525
lazy_static = "1.4"
@@ -43,7 +43,7 @@ cucumber_rust = "0.6"
4343
# cucumber = "0.3.1"
4444

4545

46-
[[bench]]
47-
name = "indicators"
48-
path = "benches/indicators.rs"
49-
harness = false
46+
# [[bench]]
47+
# name = "indicators"
48+
# path = "benches/indicators.rs"
49+
# harness = false

README.md

+17-9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
# UX Indicators
2-
31
<div align="center">
42

3+
[![](https://dudochkin-victor.github.io/assets/ux-indicators/logo-wide.svg)](#top)
4+
# UX Indicators
5+
56
[![API Docs][docrs-badge]][docrs-url]
67
[![Crates.io][crates-badge]][crates-url]
8+
[![Code coverage][codecov-badge]][codecov-url]
9+
[![Tests][tests-badge]][tests-url]
710
[![MPL-2.0 licensed][license-badge]][license-url]
811
[![Gitter chat][gitter-badge]][gitter-url]
9-
[![Rustc Version 1.45+][rust-badge]][rust-url]
1012
[![loc][loc-badge]][loc-url]
1113
</div>
1214

@@ -16,17 +18,23 @@
1618
[crates-url]: https://crates.io/crates/ux-indicators
1719
[license-badge]: https://img.shields.io/badge/license-MPL--2.0-blue.svg?style=flat-square
1820
[license-url]: https://github.com/angular-rust/ux-indicators/blob/master/LICENSE
19-
[gitter-badge]: https://img.shields.io/gitter/room/angular_rust/angular_rust.svg?style=flat-square
21+
[gitter-badge]: https://img.shields.io/gitter/room/angular_rust/community.svg?style=flat-square
2022
[gitter-url]: https://gitter.im/angular_rust/community
21-
[rust-badge]: https://img.shields.io/badge/rustc-1.45-lightgrey.svg?style=flat-square
22-
[rust-url]: https://blog.rust-lang.org/2020/07/16/Rust-1.45.0.html
23-
[loc-badge]: https://tokei.rs/b1/github/angular-rust/ux-indicators?category=code
23+
[tests-badge]: https://img.shields.io/github/workflow/status/angular-rust/ux-indicators/Tests?label=tests&logo=github&style=flat-square
24+
[tests-url]: https://github.com/angular-rust/ux-indicators/actions/workflows/tests.yml
25+
[codecov-badge]: https://img.shields.io/codecov/c/github/angular-rust/ux-indicators?logo=codecov&style=flat-square&token=M517IMMA0L
26+
[codecov-url]: https://codecov.io/gh/angular-rust/ux-indicators
27+
[loc-badge]: https://img.shields.io/tokei/lines/github/angular-rust/ux-indicators?style=flat-square
2428
[loc-url]: https://github.com/angular-rust/ux-indicators
2529

26-
ux-indicators is a Centralized State Management And Design Patterns for Rust.
30+
**UX Indicators** is a Rust library for technical analysis in Angular Rust. It provides a range of technical indicators that can be used to build trading strategies for stock markets, futures, forex, cryptocurrencies, and more.
31+
32+
> **work in progress**
2733
2834
**Angular Rust** is a high productivity, `platform-agnostic` frontend framework for the [Rust language](https://www.rust-lang.org/). It now supports desktop and web development. Angular Rust currently uses GTK for desktop development and WebAssembly for web development. We are planning to add support for mobile development.
2935

36+
![Angular Rust structure](https://dudochkin-victor.github.io/assets/angular-rust/structure.svg)
37+
3038
## Features
3139

3240
- [x] Graphic abstraction for cairo and web canvas, implemented in [UX Animate](https://github.com/angular-rust/ux-animate)
@@ -58,7 +66,7 @@ Install UX Indicators:
5866

5967
We believe the wider community can create better code. The first tool for improving the community is to tell the developers about the project by giving it a star. More stars - more members.
6068

61-
![Star a repo](https://dudochkin-victor.github.io/assets/star-me-wide.svg)
69+
[![](https://dudochkin-victor.github.io/assets/star-me-wide.svg)](https://github.com/angular-rust/ux-indicators#top)
6270

6371
Angular Rust is a community effort and we welcome all kinds of contributions, big or small, from developers of all backgrounds. We want the Angular Rust community to be a fun and friendly place, so please review our [Code of Conduct](CODE_OF_CONDUCT.md) to learn what behavior will not be tolerated.
6472

File renamed without changes.

examples/ema.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
extern crate csv;
21
extern crate core;
2+
extern crate csv;
33

4-
use indicators::{
5-
indicators::ExponentialMovingAverage as Ema,
6-
DataItem,
7-
Next
8-
};
4+
use indicators::{indicators::ExponentialMovingAverage as Ema, DataItem, Next};
95

106
fn main() {
117
let mut ema = Ema::new(9).unwrap();

src/data_item.rs

+24-22
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,30 @@ use crate::traits::{Close, High, Low, Open, Volume};
55

66
/// Data item is used as an input for indicators.
77
///
8-
/// # Example
9-
///
10-
/// ```
11-
/// use core::DataItem;
12-
/// use core::{Open, High, Low, Close, Volume};
13-
///
14-
/// let item = DataItem::builder()
15-
/// .open(20.0)
16-
/// .high(25.0)
17-
/// .low(15.0)
18-
/// .close(21.0)
19-
/// .volume(7500.0)
20-
/// .build()
21-
/// .unwrap();
22-
///
23-
/// assert_eq!(item.open(), 20.0);
24-
/// assert_eq!(item.high(), 25.0);
25-
/// assert_eq!(item.low(), 15.0);
26-
/// assert_eq!(item.close(), 21.0);
27-
/// assert_eq!(item.volume(), 7500.0);
28-
/// ```
29-
///
8+
9+
// # Example
10+
//
11+
// ```
12+
// use core::DataItem;
13+
// use core::{Open, High, Low, Close, Volume};
14+
//
15+
// let item = DataItem::builder()
16+
// .open(20.0)
17+
// .high(25.0)
18+
// .low(15.0)
19+
// .close(21.0)
20+
// .volume(7500.0)
21+
// .build()
22+
// .unwrap();
23+
//
24+
// assert_eq!(item.open(), 20.0);
25+
// assert_eq!(item.high(), 25.0);
26+
// assert_eq!(item.low(), 15.0);
27+
// assert_eq!(item.close(), 21.0);
28+
// assert_eq!(item.volume(), 7500.0);
29+
// ```
30+
//
31+
3032
#[derive(Debug, Clone)]
3133
pub struct DataItem {
3234
open: f64,

0 commit comments

Comments
 (0)