Skip to content

Commit ba3e72f

Browse files
authored
fix linker errors (#1012)
1 parent 1f6796e commit ba3e72f

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

pgml-extension/src/lib.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,17 @@ pub extern "C" fn _PG_init() {
2929
#[cfg(any(test, feature = "pg_test"))]
3030
#[pg_schema]
3131
mod tests {
32-
use super::*;
33-
3432
#[test]
3533
fn test_migration_file_exists() {
3634
let paths = std::fs::read_dir("./sql").unwrap();
3735
for path in paths {
3836
let path = path.unwrap().path().display().to_string();
39-
if path.contains(VERSION) {
37+
if path.contains(crate::VERSION) {
4038
return;
4139
}
4240
}
4341

44-
panic!("Migration file for version {} not found", VERSION);
42+
panic!("Migration file for version {} not found", crate::VERSION);
4543
}
4644
}
4745

pgml-extension/src/metrics.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,17 @@ impl ConfusionMatrix {
5252
y_hat: &ArrayView1<usize>,
5353
num_classes: usize,
5454
) -> ConfusionMatrix {
55-
if ground_truth.len() != y_hat.len() {
56-
error!("Can't compute metrics when the ground truth labels are a different size than the predicted labels. {} != {}", ground_truth.len(), y_hat.len())
57-
};
58-
5955
// Distinct classes.
6056
let mut classes = ground_truth.iter().collect::<BTreeSet<_>>();
6157
classes.extend(&mut y_hat.iter().collect::<BTreeSet<_>>().into_iter());
6258

59+
if ground_truth.len() != y_hat.len() {
60+
error!("Can't compute metrics when the ground truth labels are a different size than the predicted labels. {} != {}", ground_truth.len(), y_hat.len());
61+
}
62+
6363
if num_classes != classes.len() {
64-
error!("Can't compute metrics when the number of classes in the test set is different than the number of classes in the training set. {} != {}", num_classes, classes.len())
65-
};
64+
error!("Can't compute metrics when the number of classes in the test set is different than the number of classes in the training set. {} != {}", num_classes, classes.len());
65+
}
6666

6767
// Class value = index in the confusion matrix
6868
// e.g. class value 5 will be index 4 if there are classes 1, 2, 3 and 4 present.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy