Skip to content

Commit ce81717

Browse files
committed
attributes can be numbers
1 parent a6094f4 commit ce81717

File tree

4 files changed

+24
-6
lines changed

4 files changed

+24
-6
lines changed

results/amalgamateResults.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
setup=["create table if not exists RUNS"+runColList,#these default keys start at 1
1818
"create table if not exists STEPS(STEP INTEGER PRIMARY KEY, RUN int, OBJECTIVE real, TRAINACC real, TESTOBJECTIVE real, TESTACC REAL )",
1919
"create table if not exists TIMES(RUN INT, TIME real)", # stores the time of the tenth step of each run, allowing speed to be measured
20-
"create table if not exists ATTRIBS(RUN INT, NAME TEXT, ISRESULT INT, VALUE TEXT)"
20+
"create table if not exists ATTRIBS(RUN INT, NAME TEXT, ISRESULT INT, VALUE)"
2121
]
2222
for s in setup:
2323
c.execute(s)

results/removeTextAffinity.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import sqlite3, sys
2+
c = sqlite3.connect(sys.argv[1])
3+
sql="""alter table attribs rename to foo;
4+
create table if not exists ATTRIBS(RUN INT, NAME TEXT, ISRESULT INT, VALUE);
5+
insert into attribs select RUN,NAME,ISRESULT,VALUE from foo;
6+
drop table foo"""
7+
c.executescript(sql)
8+
9+
10+

results/results.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function results.startRun(continuation, attribs, architecture, solver, callerFil
7878
local setup="create table if not exists RUNS" .. runColList .. [[;
7979
create table if not exists STEPS(STEP INTEGER PRIMARY KEY, RUN int, OBJECTIVE real, TRAINACC real, TESTOBJECTIVE real, TESTACC REAL );
8080
create table if not exists TIMES(RUN INT, TIME real);
81-
create table if not exists ATTRIBS(RUN INT, NAME TEXT, ISRESULT INT, VALUE TEXT)
81+
create table if not exists ATTRIBS(RUN INT, NAME TEXT, ISRESULT INT, VALUE)
8282
]]
8383
check(con:exec(setup))
8484
local infoquery = "insert into RUNS (CONTINUATION, ARCHITECTURE, SOLVER, CODE) VALUES (?,?,?,?)"

results/results.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def getC(f):
5050
setup=["create table if not exists RUNS"+runColList,#these default keys start at 1
5151
"create table if not exists STEPS(STEP INTEGER PRIMARY KEY, RUN int, OBJECTIVE real, TRAINACC real, TESTOBJECTIVE real, TESTACC REAL )",
5252
"create table if not exists TIMES(RUN INT, TIME real)", # stores the time of the tenth step of each run, allowing speed to be measured
53-
"create table if not exists ATTRIBS(RUN INT, NAME TEXT, ISRESULT INT, VALUE TEXT)"
53+
"create table if not exists ATTRIBS(RUN INT, NAME TEXT, ISRESULT INT, VALUE)" #value deliberately has no affinity. some are numbers
5454
]
5555
infoquery = "insert into RUNS (CONTINUATION, ARCHITECTURE, SOLVER, CODE) VALUES (?,?,?,?)"
5656
info = (continuation, architecture, solver, filecontents)
@@ -185,10 +185,18 @@ def _getAttribAsStr(run,name):
185185
return ""
186186

187187
#architectureLike: if set to 5, only print info for runs with the same network as the one used in run 5
188-
#doAttribs: None means all attribs are included, a list means those attributes are included,
188+
#doAttribs: None means all attribs are included, a list of strings means those attributes are included,
189+
# a list containing a list of strings means those attributes are excluded
189190
# True or False mean only the result or nonresult ones.
190-
def runList2(avgLength=None, doPrint = True, runFrom=None, architectureLike=None, doAttribs=None): #with times
191-
attribs = doAttribs if type(doAttribs)==list else _listAttribs(doAttribs)
191+
defaultAttribs = None
192+
def runList2(avgLength=None, doPrint = True, runFrom=None, architectureLike=None, doAttribs=defaultAttribs): #with times
193+
if type(doAttribs)==list:
194+
if len(doAttribs)==1 and type(doAttribs[0]==list):
195+
attribs = [i for i in _listAttribs(None) if i not in doAttribs[0]]
196+
else:
197+
attribs = doAttribs
198+
else:
199+
attribs = _listAttribs(doAttribs)
192200
if avgLength == None:
193201
avgLength = movingAvgLength
194202
c=con.cursor()

0 commit comments

Comments
 (0)