Mercurial > hg > nsaunier > traffic-intelligence
annotate python/tests/utils.txt @ 33:4bd7cc69b6cd
added traffic engineering utilities with first version of LaneGroups
| author | Nicolas Saunier <nico@confins.net> |
|---|---|
| date | Sat, 10 Apr 2010 20:46:33 -0400 |
| parents | 48e56179c39e |
| children | 1a2ac2d4f53a |
| rev | line source |
|---|---|
|
31
c000f37c316d
moved tests to independent file, added chi2 computation
Nicolas Saunier <nico@confins.net>
parents:
diff
changeset
|
1 >>> from utils import * |
|
c000f37c316d
moved tests to independent file, added chi2 computation
Nicolas Saunier <nico@confins.net>
parents:
diff
changeset
|
2 >>> from moving import Point |
|
c000f37c316d
moved tests to independent file, added chi2 computation
Nicolas Saunier <nico@confins.net>
parents:
diff
changeset
|
3 |
|
c000f37c316d
moved tests to independent file, added chi2 computation
Nicolas Saunier <nico@confins.net>
parents:
diff
changeset
|
4 >>> computeChi2([],[]) |
|
c000f37c316d
moved tests to independent file, added chi2 computation
Nicolas Saunier <nico@confins.net>
parents:
diff
changeset
|
5 0.0 |
|
c000f37c316d
moved tests to independent file, added chi2 computation
Nicolas Saunier <nico@confins.net>
parents:
diff
changeset
|
6 >>> computeChi2(range(1,10),range(1,10)) |
|
c000f37c316d
moved tests to independent file, added chi2 computation
Nicolas Saunier <nico@confins.net>
parents:
diff
changeset
|
7 0.0 |
|
c000f37c316d
moved tests to independent file, added chi2 computation
Nicolas Saunier <nico@confins.net>
parents:
diff
changeset
|
8 >>> computeChi2(range(1,9),range(1,10)) |
|
c000f37c316d
moved tests to independent file, added chi2 computation
Nicolas Saunier <nico@confins.net>
parents:
diff
changeset
|
9 0.0 |
|
c000f37c316d
moved tests to independent file, added chi2 computation
Nicolas Saunier <nico@confins.net>
parents:
diff
changeset
|
10 |
| 32 | 11 >>> ceilDecimals(1.23, 0) |
| 12 2.0 | |
| 13 >>> ceilDecimals(1.23, 1) | |
| 14 1.3 | |
| 15 | |
|
31
c000f37c316d
moved tests to independent file, added chi2 computation
Nicolas Saunier <nico@confins.net>
parents:
diff
changeset
|
16 >>> segmentIntersection(Point(0,0),Point(1,1), Point(0,1), Point(1,2)) |
|
c000f37c316d
moved tests to independent file, added chi2 computation
Nicolas Saunier <nico@confins.net>
parents:
diff
changeset
|
17 >>> segmentIntersection(Point(0,1),Point(1,0), Point(0,2), Point(2,1)) |
|
c000f37c316d
moved tests to independent file, added chi2 computation
Nicolas Saunier <nico@confins.net>
parents:
diff
changeset
|
18 >>> segmentIntersection(Point(0,0),Point(2,0), Point(1,-1),Point(1,1)) |
|
c000f37c316d
moved tests to independent file, added chi2 computation
Nicolas Saunier <nico@confins.net>
parents:
diff
changeset
|
19 (1.000000,0.000000) |
|
c000f37c316d
moved tests to independent file, added chi2 computation
Nicolas Saunier <nico@confins.net>
parents:
diff
changeset
|
20 >>> segmentIntersection(Point(0,1),Point(2,0),Point(1,1),Point(1,2)) |
|
c000f37c316d
moved tests to independent file, added chi2 computation
Nicolas Saunier <nico@confins.net>
parents:
diff
changeset
|
21 |
|
c000f37c316d
moved tests to independent file, added chi2 computation
Nicolas Saunier <nico@confins.net>
parents:
diff
changeset
|
22 >>> f = openCheck('non_existant_file.txt') |
|
c000f37c316d
moved tests to independent file, added chi2 computation
Nicolas Saunier <nico@confins.net>
parents:
diff
changeset
|
23 File non_existant_file.txt could not be opened. |
|
c000f37c316d
moved tests to independent file, added chi2 computation
Nicolas Saunier <nico@confins.net>
parents:
diff
changeset
|
24 |
|
c000f37c316d
moved tests to independent file, added chi2 computation
Nicolas Saunier <nico@confins.net>
parents:
diff
changeset
|
25 >>> removeExtension('test-adfasdf.asdfa.txt') |
|
c000f37c316d
moved tests to independent file, added chi2 computation
Nicolas Saunier <nico@confins.net>
parents:
diff
changeset
|
26 'test-adfasdf.asdfa' |
|
c000f37c316d
moved tests to independent file, added chi2 computation
Nicolas Saunier <nico@confins.net>
parents:
diff
changeset
|
27 >>> removeExtension('test-adfasdf') |
|
c000f37c316d
moved tests to independent file, added chi2 computation
Nicolas Saunier <nico@confins.net>
parents:
diff
changeset
|
28 'test-adfasdf' |
