Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add provenance writing for app_vertex #885

Open
wants to merge 55 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
c32394d
Add provenance writing for app_vertex
andrewgait Oct 27, 2021
3d682df
Use the correct type
andrewgait Oct 27, 2021
7b3b104
Merge branch 'master' into weight_scale
andrewgait Nov 5, 2021
55a6f3e
Merge branch 'master' into weight_scale
andrewgait Nov 5, 2021
f2d18fb
Merge branch 'master' into weight_scale
andrewgait Nov 10, 2021
2febcfd
Merge branch 'master' into weight_scale
andrewgait Nov 11, 2021
0ffb914
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Nov 25, 2021
e9a3286
Merge branch 'master' into weight_scale
andrewgait Jan 10, 2022
31aef2a
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Feb 25, 2022
fbba09b
Merge branch 'master' into weight_scale
andrewgait Mar 11, 2022
1c017c0
Merge branch 'master' into weight_scale
andrewgait Mar 28, 2022
37d8925
Merge branch 'master' into weight_scale
andrewgait Apr 14, 2022
31db8d0
Merge branch 'master' into weight_scale
andrewgait Apr 20, 2022
de856ca
Merge branch 'master' into weight_scale
andrewgait May 9, 2022
3438aa8
Merge branch 'master' into weight_scale
andrewgait May 19, 2022
3c0dbe2
Merge branch 'master' into weight_scale
andrewgait May 25, 2022
dcf968e
Merge branch 'master' into weight_scale
andrewgait Jun 16, 2022
1cecff0
Merge branch 'master' into weight_scale
andrewgait Jul 11, 2022
8be9e9f
Merge branch 'master' into weight_scale
andrewgait Jul 22, 2022
8ca2f04
Rename to label as that's what is being used
andrewgait Jul 22, 2022
1683e89
Merge branch 'master' into weight_scale
andrewgait Aug 3, 2022
a6f5ec6
Merge branch 'master' into weight_scale
andrewgait Aug 4, 2022
aa9bb8f
Merge branch 'master' into weight_scale
andrewgait Aug 22, 2022
c1ade29
Merge branch 'master' into weight_scale
andrewgait Sep 9, 2022
99ad84e
Merge branch 'master' into weight_scale
andrewgait Sep 14, 2022
e0a525c
Merge branch 'master' into weight_scale
andrewgait Sep 15, 2022
1827764
Merge branch 'master' into weight_scale
andrewgait Sep 15, 2022
48a50d1
Merge branch 'master' into weight_scale
andrewgait Sep 16, 2022
62afeb6
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Sep 26, 2022
cd1eaf4
Merge properly
andrewgait Sep 26, 2022
f5e8634
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Sep 27, 2022
41a906c
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Nov 18, 2022
741e691
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Nov 24, 2022
3a9f5c2
Merge branch 'master' into weight_scale
andrewgait Jan 11, 2023
b11a98f
Merge branch 'master' into weight_scale
andrewgait Jan 11, 2023
a3fb89f
Merge branch 'master' into weight_scale
andrewgait Jan 12, 2023
a8f3777
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Jan 24, 2023
b69d547
Merge branch 'master' into weight_scale
andrewgait Feb 10, 2023
a617bc7
Merge branch 'master' into weight_scale
andrewgait Feb 20, 2023
7d7a087
Merge branch 'master' into weight_scale
andrewgait Mar 1, 2023
2b9fd91
Merge branch 'master' into weight_scale
andrewgait Apr 11, 2023
2a45126
Merge branch 'master' into weight_scale
andrewgait Apr 21, 2023
8fd131e
Merge branch 'master' into weight_scale
andrewgait May 17, 2023
283a492
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Jun 23, 2023
58dc28a
Fix doc strings
andrewgait Jun 23, 2023
fc27dc6
Merge branch 'master' into weight_scale
andrewgait Jul 6, 2023
35d85ce
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Jul 7, 2023
baa87ed
Merge branch 'master' into weight_scale
andrewgait Jul 17, 2023
05e8187
Merge branch 'master' into weight_scale
andrewgait Jul 18, 2023
5a310d1
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Jul 21, 2023
510c0ab
Merge branch 'master' into weight_scale
andrewgait Aug 2, 2023
702f2e8
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Sep 12, 2023
8726858
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Sep 26, 2023
439ce85
Update test
andrewgait Sep 26, 2023
f35411a
Merge branch 'master' into weight_scale
andrewgait Sep 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions spinn_front_end_common/interface/provenance/db.sql
Original file line number Diff line number Diff line change
Expand Up @@ -193,4 +193,13 @@ CREATE TABLE IF NOT EXISTS connector_provenance(
description STRING NOT NULL,
the_value INTEGER NOT NULL);

-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-- A table app vertex provenance
CREATE TABLE IF NOT EXISTS app_vertex_provenance(
app_vertex_id INTEGER PRIMARY KEY AUTOINCREMENT,
population STRING NOT NULL,
the_type STRING NOT NULL,
description STRING NOT NULL,
the_value INTEGER NOT NULL);


19 changes: 19 additions & 0 deletions spinn_front_end_common/interface/provenance/provenance_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,3 +268,22 @@ def insert_connector(
""",
[pre_population, post_population, the_type, description,
the_value])

def insert_app_vertex(
self, population, the_type, description, the_value):
"""
Inserts population level data into the app_vertex_provenance

:param str population: Name of the post population / vertex
:param str the_type: Class of the app_vertex
:param str description: type of value
:param float the_value: data
"""
with self.transaction() as cur:
cur.execute(
"""
INSERT OR IGNORE INTO app_vertex_provenance(
population, the_type, description, the_value)
VALUES(?, ?, ?, ?)
""",
[population, the_type, description, the_value])
8 changes: 8 additions & 0 deletions unittests/interface/provenance/test_provenance_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,11 @@ def test_connector(self):
data = reader.run_query("Select * from connector_provenance")
expected = [(1, 'the pre', 'A post', 'OneToOne', 'foo', 12)]
self.assertListEqual(expected, data)

def test_app_vertex(self):
with ProvenanceWriter() as db:
db.insert_app_vertex("pop", "type", "description", 0.5)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type tested here does not match the CREATE TABLE.

While it works it is not the cleanest

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops - good spot, edited.

reader = ProvenanceReader()
data = reader.run_query("Select * from app_vertex_provenance")
expected = [(1, 'pop', 'type', 'description', 0.5)]
self.assertListEqual(expected, data)