Skip to content

Commit aa423c2

Browse files
authored
Fix serde support for linfa-pls algorithms (#380)
* Fix serde support for `linfa-pls` algorithms * Relax codecov checking * Bump MSRV 1.81 * Add derive for Debug, Clone and PartialEq traits
1 parent 1cf33f9 commit aa423c2

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

.github/codecov.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
coverage:
2+
status:
3+
project:
4+
default:
5+
threshold: 1%
6+
patch:
7+
default:
8+
informational: true

.github/workflows/testing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
fail-fast: false
3636
matrix:
3737
toolchain:
38-
- 1.71.1
38+
- 1.81.0
3939
- stable
4040
os:
4141
- ubuntu-latest

algorithms/linfa-pls/src/lib.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,17 @@ pub use errors::*;
5151
pub use hyperparams::*;
5252
pub use pls_svd::*;
5353

54+
#[cfg(feature = "serde")]
55+
use serde_crate::{Deserialize, Serialize};
56+
5457
macro_rules! pls_algo { ($name:ident) => {
5558
paste::item! {
59+
#[cfg_attr(
60+
feature = "serde",
61+
derive(Serialize, Deserialize),
62+
serde(crate = "serde_crate")
63+
)]
64+
#[derive(Debug, Clone, PartialEq)]
5665
pub struct [<Pls $name>]<F: Float>(Pls<F>);
5766
impl<F: Float> [<Pls $name>]<F> {
5867

0 commit comments

Comments
 (0)