5b2766aae94c0615aef2c8d6ac178428e6d28745,pymc/database/mysql.py,Trace,tally,#Trace#Any#,46
Before Change
if index + 1 == self.update_interval:
values = ""
for sample in self._trace:
valstring = ", ".join(sample.astype("c"))
values += "(NULL, %s, %s)," % (self.current_trace, valstring)
// Add trace to database
self.db.cur.execute("INSERT INTO %s values %s" % (self.obj.name, values[:-1]))
// Re-initialize trace
self._trace = zeros(shape(self._trace), self._trace.dtype)
After Change
except TypeError:
pass
try:
// I changed str(x) to "%f"%x to solve a bug appearing due to
// locale settings. In french for instance, str prints a comma
// instead of a colon to indicate the decimal, which confuses
// the database into thinking that there are more values than there
// is. A better solution would be to use another delimiter than the
// comma. -DH
valstring = ", ".join(["%f"%x for x in self._obj.value])
except:
valstring = str(self._obj.value)
// Add value to database
self.db.cur.execute("INSERT INTO %s (trace, %s) values (%s, %s)" % (self.name, " ,".join(["v%s" % (x+1) for x in range(size)]), self.current_trace, valstring))
class Database(pickle.Database):
In pattern: SUPERPATTERN
Frequency: 5
Non-data size: 7
Instances
Project Name: pymc-devs/pymc3
Commit Name: 5b2766aae94c0615aef2c8d6ac178428e6d28745
Time: 2008-07-20
Author: fonnesbeck@15d7aa0b-6f1a-0410-991a-d59f85d14984
File Name: pymc/database/mysql.py
Class Name: Trace
Method Name: tally
Project Name: matplotlib/matplotlib
Commit Name: d23bcea94a01a598de9619a1bf45b911120f7096
Time: 2019-01-08
Author: jklymak@gmail.com
File Name: lib/matplotlib/axis.py
Class Name: Axis
Method Name: _update_ticks
Project Name: catalyst-cooperative/pudl
Commit Name: eaeeabd54cf31330cad517771b477cf2fedef6c6
Time: 2019-06-29
Author: cgosnell@catalyst.coop
File Name: pudl/ETL_pkg.py
Class Name:
Method Name: _input_validate_ferc1
Project Name: hellohaptik/chatbot_ner
Commit Name: 538a32457740b46992ebc648f0e2aa54b7a4009a
Time: 2018-08-20
Author: pratik.jayarao@haptik.co
File Name: external_api/api.py
Class Name:
Method Name: transfer_entities
Project Name: ilastik/ilastik
Commit Name: 219459f15476426276e24329cdb6f091b5f7cf41
Time: 2019-06-26
Author: tomaz.vieira@embl.de
File Name: ilastik/applets/dataSelection/dataSelectionGui.py
Class Name: DataSelectionGui
Method Name: _createDatasetInfo