File tree Expand file tree Collapse file tree 6 files changed +53
-1
lines changed
Expand file tree Collapse file tree 6 files changed +53
-1
lines changed Original file line number Diff line number Diff line change 66* .egg
77* .egg-info /
88* .pyc
9+ __pycache__
910.cache /
1011.coverage
1112.coverage. *
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -e
4+
5+ echo " Using python: $( which python3) "
6+ python --version
7+
8+ echo " >>> Bench pyais"
9+ python bench_pyais.py
10+
11+ echo " >>> Bench libais"
12+ python bench_libais.py
Original file line number Diff line number Diff line change 1+ from pyais .exceptions import UnknownMessageException
2+ from pyais import FileReaderStream
3+ from collections import defaultdict
4+ import time
5+ import pathlib
6+ import ais .stream
7+ import json
8+ import ais .compatibility .gpsd
9+
10+ file = pathlib .Path (__file__ ).parent .joinpath ('../tests/nmea-sample' )
11+ stats = defaultdict (lambda : 0 )
12+ start = time .time ()
13+
14+ with open (file ) as inf :
15+ for i , msg in enumerate (ais .stream .decode (inf )):
16+ stats [msg ['id' ]] += 1
17+
18+
19+ print (stats )
20+ print (f'Decoded { i } NMEA AIS messages in { time .time () - start : .2f} s' )
File renamed without changes.
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -e
4+
5+ echo " Using python: $( which python3) "
6+
7+ mkdir -p build
8+ cd build
9+
10+ if [ ! -d " libais" ]; then
11+ git clone git@github.com:schwehr/libais.git
12+ fi
13+
14+ cd libais
15+ uv pip install setuptools six
16+ python setup.py build
17+ python setup.py install
18+
19+ echo " Installed libais."
Original file line number Diff line number Diff line change @@ -33,4 +33,4 @@ def test_run_every_file(self):
3333 if csv_file .exists ():
3434 csv_file .unlink ()
3535
36- assert i == 24
36+ assert i == 23
You can’t perform that action at this time.
0 commit comments