forked from campagnola/pycsf
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.py
67 lines (52 loc) · 1.8 KB
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import os, sys
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', '..'))
import faulthandler
faulthandler.enable()
from pyqtgraph import QtGui, QtCore
from pycsf.editor import SolutionEditorWindow
from pycsf.core import Solution, Recipe, RecipeSet, SolutionDatabase
app = QtGui.QApplication([])
#import pyqtgraph as pg
#pg.dbg()
db = SolutionDatabase()
solns = db.solutions
sol = Solution(name='Standard ACSF', group='ACSF', against='Standard Internal')
sol['sodium chloride'] = 123
sol['potassium chloride'] = 3
sol['potassium phosphate monobasic'] = 1.25
sol['sodium bicarbonate'] = 25
sol['glucose'] = 10
sol['magnesium sulfate'] = 2
sol['calcium chloride'] = 1.3
solns.add(sol)
sol = Solution('Diss. ACSF', group='ACSF', against='Standard Internal')
sol['n-methyl-d-glucamine'] = 123
sol['potassium chloride'] = 3
sol['potassium phosphate monobasic'] = 1.25
sol['sodium bicarbonate'] = 25
sol['glucose'] = 10
sol['magnesium sulfate'] = 4
sol['calcium chloride'] = 0.5
sol['hydrochloric acid'] = 123
solns.add(sol)
sol = Solution('Standard Internal', group='Internal', against='Standard ACSF')
sol['potassium gluconate'] = 130
sol['potassium chloride'] = 4
sol['HEPES'] = 10
sol['EGTA'] = 0.3
sol['phosphocreatine bg'] = 10
sol['magnesium ATP'] = 4
sol['GTP sodium hydrate'] = 0.3
solns.add(sol)
r1 = Recipe(solution=solns['Standard ACSF'], volumes=[1000, 500], notes="Here's how you make <i>this</i> recipe...")
r2 = Recipe(solution=solns['Diss. ACSF'], volumes=[1000, 500])
rs = RecipeSet(name='Standard recipes', recipes=[r1, r2])
rs.stocks['hydrochloric acid'] = 5.0
db.recipes.add(rs)
rs = RecipeSet(name='Recording ACSF', recipes=[r1])
db.recipes.add(rs)
w = SolutionEditorWindow(db=db)
w.show()
#w.solutionEditor.updateSolutionList()
w.tabs.setCurrentIndex(0)
QtGui.QApplication.instance().exec_()