-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from cjneely10/development
Better error handling
- Loading branch information
Showing
9 changed files
with
168 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Changelog | ||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
|
||
## [Unreleased] | ||
|
||
### Python bindings | ||
- [PyO3](https://github.com/PyO3/pyo3)-derived bindings for use within Python | ||
|
||
## [0.2.0] - 2022-07-24 | ||
### Added | ||
- Better stderr messages on file-parsing errors | ||
- Line/col numbers and kind of error | ||
- Disallow `nan` values in input per Affinity Propagation algorithm requirements | ||
|
||
### Changed | ||
- Small edits to pass-by-value instead of by-reference | ||
|
||
### Fixed | ||
- `nan` values were accepted as valid input. | ||
- No valid similarity calculation is present for `nan` values | ||
|
||
## [0.1.1] - 2022-02-15 | ||
First release of `affinityprop` |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "affinityprop" | ||
version = "0.1.1" | ||
version = "0.2.0" | ||
edition = "2021" | ||
authors = ["Chris Neely <[email protected]>"] | ||
license = "GPL-3.0" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[![Rust](https://github.com/cjneely10/affinityprop/actions/workflows/rust.yml/badge.svg?branch=main)](https://github.com/cjneely10/affinityprop/actions/workflows/rust.yml) | ||
[![affinityprop crate](https://img.shields.io/crates/v/affinityprop?color=blue&style=flat)](https://crates.io/crates/affinityprop) | ||
[![affinityprop docs](https://img.shields.io/docsrs/affinityprop)](https://docs.rs/affinityprop/0.1.1/affinityprop/) | ||
[![affinityprop docs](https://img.shields.io/docsrs/affinityprop)](https://docs.rs/affinityprop/0.2.0/affinityprop/) | ||
[![GitHub](https://img.shields.io/github/license/cjneely10/affinityprop)](https://www.gnu.org/licenses/gpl-3.0.html) | ||
[![affinityprop: rustc 1.58](https://img.shields.io/badge/affinityprop-rustc__1.58-blue)](https://doc.rust-lang.org/rustc/what-is-rustc.html) | ||
![coverage](https://img.shields.io/badge/coverage-95%25-success) | ||
|
@@ -48,7 +48,7 @@ with `rustc >=1.58` | |
## In Rust code | ||
```toml | ||
[dependencies] | ||
affinityprop = "0.1.1" | ||
affinityprop = "0.2.0" | ||
ndarray = "0.15.4" | ||
``` | ||
|
||
|
@@ -146,7 +146,7 @@ IDs will automatically be assigned by zero-based index. | |
|
||
### Help Menu | ||
```text | ||
affinityprop 0.1.1 | ||
affinityprop 0.2.0 | ||
Chris N. <[email protected]> | ||
Vectorized and Parallelized Affinity Propagation | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ mod ops; | |
#[cfg(not(tarpaulin_include))] | ||
fn main() { | ||
let matches = clap_app!(affinityprop => | ||
(version: "0.1.1") | ||
(version: "0.2.0") | ||
(author: "Chris N. <[email protected]>") | ||
(about: "Vectorized and Parallelized Affinity Propagation") | ||
(@arg INPUT: -i --input +takes_value +required "Path to input file") | ||
|
@@ -166,20 +166,11 @@ fn predict<F>( | |
Some(pref) => Preference::Value(pref), | ||
None => Preference::Median, | ||
}; | ||
let a: (bool, HashMap<usize, Vec<usize>>); | ||
match similarity { | ||
1 => { | ||
a = ap.predict(&x, NegCosine::default(), preference); | ||
} | ||
2 => { | ||
a = ap.predict(&x, LogEuclidean::default(), preference); | ||
} | ||
3 => { | ||
a = ap.predict_precalculated(x, preference); | ||
} | ||
_ => { | ||
a = ap.predict(&x, NegEuclidean::default(), preference); | ||
} | ||
} | ||
let a: (bool, HashMap<usize, Vec<usize>>) = match similarity { | ||
1 => ap.predict(&x, NegCosine::default(), preference), | ||
2 => ap.predict(&x, LogEuclidean::default(), preference), | ||
3 => ap.predict_precalculated(x, preference), | ||
_ => ap.predict(&x, NegEuclidean::default(), preference), | ||
}; | ||
display_results(a.0, &a.1, y); | ||
} |
Oops, something went wrong.