-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests, fix displacement method, add notebook
- Loading branch information
1 parent
0c20ebf
commit 50e7202
Showing
9 changed files
with
711 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,4 @@ | |
from traja import models | ||
|
||
__author__ = "justinshenk" | ||
__version__ = "0.1.0" | ||
__version__ = "0.1.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import os | ||
|
||
import pandas as pd | ||
|
||
import traja | ||
|
||
from pandas.util.testing import ( | ||
assert_frame_equal, | ||
assert_index_equal, | ||
assert_series_equal, | ||
) | ||
|
||
df = traja.generate(n=20) | ||
|
||
|
||
def test_from_df(): | ||
df = pd.DataFrame({"x": [1, 2, 3], "y": [2, 3, 4]}) | ||
trj = traja.parsers.from_df(df) | ||
assert_frame_equal(df, trj) | ||
assert isinstance(trj, traja.TrajaDataFrame) | ||
|
||
|
||
def test_read_file(): | ||
datapath = os.path.join(traja.__path__[0], "tests", "data", "3527.csv") | ||
trj = traja.parsers.read_file(datapath) | ||
assert isinstance(trj, traja.TrajaDataFrame) | ||
assert "Frame" in trj | ||
assert "Time" in trj | ||
assert "TrackId" in trj | ||
assert "x" in trj | ||
assert "y" in trj | ||
assert "ValueChanged" in trj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.