[chronojump] Avoids duplicates in the EncoderSignalCurve table.
- From: Carles Pina i Estany <carlespina src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Avoids duplicates in the EncoderSignalCurve table.
- Date: Thu, 6 Oct 2016 20:40:58 +0000 (UTC)
commit 8eb6f23e38838359dae726a9685055c61f1d28ba
Author: Carles Pina i Estany <carles pina cat>
Date: Thu Oct 6 22:40:10 2016 +0200
Avoids duplicates in the EncoderSignalCurve table.
The same rows could come from the signal or the curve so now it removes
the duplicates.
src/chronojump-importer/chronojump_importer.py | 7 ++++---
.../tests/generic-expected-a.sqlite | Bin 72704 -> 72704 bytes
.../tests/generic-expected-b.sqlite | Bin 72704 -> 72704 bytes
.../tests/generic-expected-c.sqlite | Bin 72704 -> 72704 bytes
src/chronojump-importer/tests/padu-expected.sqlite | Bin 68608 -> 68608 bytes
src/chronojump-importer/tests/yoyo-expected.sqlite | Bin 1408000 -> 1408000 bytes
6 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/chronojump-importer/chronojump_importer.py b/src/chronojump-importer/chronojump_importer.py
index b904165..64368c2 100755
--- a/src/chronojump-importer/chronojump_importer.py
+++ b/src/chronojump-importer/chronojump_importer.py
@@ -219,7 +219,7 @@ class Database:
Inserts the data and modifies table adding new_unique_id. This is the new uniqueID
if the row has been inserted or the old one if the row has been reused. This
- depends on avoid_duplicate_columns.
+ depends on avoids_duplicate_column.
For example, if matches_columns = ["Name"] it will insert a new row
in the table if the name didn't exist and will add new_unique_id
@@ -615,9 +615,10 @@ class ImportSession:
encoder_signal_curve = Table("encoderSignalCurve")
encoder_signal_curve.concatenate_table(encoder_signal_curve_signals)
encoder_signal_curve.concatenate_table(encoder_signal_curve_curves)
+ encoder_signal_curve.remove_duplicates()
- encoder_signal_curve.update_ids("signalID", encoder, "old_signalID", "new_signalID")
- encoder_signal_curve.update_ids("curveID", encoder, "old_curveID", "new_curveID")
+ encoder_signal_curve.update_ids("signalID", encoder, "old_uniqueID", "new_uniqueID")
+ encoder_signal_curve.update_ids("curveID", encoder, "old_uniqueID", "new_uniqueID")
self.destination_db.write(table=encoder_signal_curve,
avoids_duplicate_column=None,
diff --git a/src/chronojump-importer/tests/generic-expected-a.sqlite
b/src/chronojump-importer/tests/generic-expected-a.sqlite
index 529919c..9f1378e 100644
Binary files a/src/chronojump-importer/tests/generic-expected-a.sqlite and
b/src/chronojump-importer/tests/generic-expected-a.sqlite differ
diff --git a/src/chronojump-importer/tests/generic-expected-b.sqlite
b/src/chronojump-importer/tests/generic-expected-b.sqlite
index ae8a2da..7ba1aca 100644
Binary files a/src/chronojump-importer/tests/generic-expected-b.sqlite and
b/src/chronojump-importer/tests/generic-expected-b.sqlite differ
diff --git a/src/chronojump-importer/tests/generic-expected-c.sqlite
b/src/chronojump-importer/tests/generic-expected-c.sqlite
index 309cb70..121fd7f 100644
Binary files a/src/chronojump-importer/tests/generic-expected-c.sqlite and
b/src/chronojump-importer/tests/generic-expected-c.sqlite differ
diff --git a/src/chronojump-importer/tests/padu-expected.sqlite
b/src/chronojump-importer/tests/padu-expected.sqlite
index 8df5f5a..1828d4b 100644
Binary files a/src/chronojump-importer/tests/padu-expected.sqlite and
b/src/chronojump-importer/tests/padu-expected.sqlite differ
diff --git a/src/chronojump-importer/tests/yoyo-expected.sqlite
b/src/chronojump-importer/tests/yoyo-expected.sqlite
index ace1c0b..a8c956d 100644
Binary files a/src/chronojump-importer/tests/yoyo-expected.sqlite and
b/src/chronojump-importer/tests/yoyo-expected.sqlite differ
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]