Mercurial > hg > nsaunier > traffic-intelligence
comparison python/storage.py @ 753:3d48e34db846 dev
switched to subprocess.check_call
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Thu, 29 Oct 2015 14:29:31 -0400 |
| parents | 14963a9c3b09 |
| children | 782e8fd3672c |
comparison
equal
deleted
inserted
replaced
| 752:14963a9c3b09 | 753:3d48e34db846 |
|---|---|
| 741 "CREATE TABLE IF NOT EXISTS curvilinear_positions (t REAL, trajectory_id INTEGER, link_id INTEGER, lane_id INTEGER, s_coordinate REAL, y_coordinate REAL, speed REAL, PRIMARY KEY (t, trajectory_id));\n"+ | 741 "CREATE TABLE IF NOT EXISTS curvilinear_positions (t REAL, trajectory_id INTEGER, link_id INTEGER, lane_id INTEGER, s_coordinate REAL, y_coordinate REAL, speed REAL, PRIMARY KEY (t, trajectory_id));\n"+ |
| 742 ".import "+filename+" curvilinear_positions\n"+ | 742 ".import "+filename+" curvilinear_positions\n"+ |
| 743 "DELETE FROM curvilinear_positions WHERE trajectory_id IS NULL OR trajectory_id = \"NO\";\n") | 743 "DELETE FROM curvilinear_positions WHERE trajectory_id IS NULL OR trajectory_id = \"NO\";\n") |
| 744 out.close() | 744 out.close() |
| 745 # system call | 745 # system call |
| 746 from os import system, remove | 746 from subprocess import check_call |
| 747 system("sqlite3 "+utils.removeExtension(filename)+".sqlite < "+sqlScriptFilename) | 747 out = openCheck("err.log", "w") |
| 748 remove(sqlScriptFilename) | 748 check_call("sqlite3 "+utils.removeExtension(filename)+".sqlite < "+sqlScriptFilename, stderr = out, shell = True) |
| 749 out.close() | |
| 750 shutil.os.remove(sqlScriptFilename) | |
| 749 | 751 |
| 750 def loadTrajectoriesFromVissimFile(filename, simulationStepsPerTimeUnit, objectNumbers = None, warmUpLastInstant = None, usePandas = False, nDecimals = 2, lowMemory = True): | 752 def loadTrajectoriesFromVissimFile(filename, simulationStepsPerTimeUnit, objectNumbers = None, warmUpLastInstant = None, usePandas = False, nDecimals = 2, lowMemory = True): |
| 751 '''Reads data from VISSIM .fzp trajectory file | 753 '''Reads data from VISSIM .fzp trajectory file |
| 752 simulationStepsPerTimeUnit is the number of simulation steps per unit of time used by VISSIM | 754 simulationStepsPerTimeUnit is the number of simulation steps per unit of time used by VISSIM |
| 753 for example, there seems to be 5 simulation steps per simulated second in VISSIM, | 755 for example, there seems to be 5 simulation steps per simulated second in VISSIM, |
