Skip to content
Snippets Groups Projects

Draft: Develop

Open Raphael Sturgis requested to merge develop into main
1 file
+ 34
0
Compare changes
  • Side-by-side
  • Inline
@@ -216,6 +216,40 @@ class TestAISPositions(unittest.TestCase):
@@ -216,6 +216,40 @@ class TestAISPositions(unittest.TestCase):
pd.testing.assert_frame_equal(expected.reset_index(drop=True), result.reset_index(drop=True),
pd.testing.assert_frame_equal(expected.reset_index(drop=True), result.reset_index(drop=True),
check_exact=False, rtol=0.05)
check_exact=False, rtol=0.05)
 
def test_normalize_wrong_arguments_1(self):
 
ais_points = AISPoints(pd.DataFrame(
 
{
 
"cog": [i for i in range(0, 359, 10)],
 
"heading": [180 for _ in range(0, 359, 10)]
 
}
 
)
 
)
 
 
with self.assertRaises(ValueError):
 
ais_points.normalize(normalization_dict=None)
 
 
def test_normalize_wrong_arguments_2(self):
 
ais_points = AISPoints(pd.DataFrame(
 
{
 
"cog": [i for i in range(0, 359, 10)],
 
"heading": [180 for _ in range(0, 359, 10)]
 
}
 
)
 
)
 
with self.assertRaises(ValueError):
 
ais_points.normalize(normalization_dict=10)
 
 
def test_normalize_wrong_arguments_3(self):
 
ais_points = AISPoints(pd.DataFrame(
 
{
 
"cog": [i for i in range(0, 359, 10)],
 
"heading": [180 for _ in range(0, 359, 10)]
 
}
 
)
 
)
 
with self.assertRaises(ValueError):
 
ais_points.normalize(normalization_dict=[0, 1, 2, 3, 4])
 
def test_compute_drift(self):
def test_compute_drift(self):
ais_points = AISPoints(pd.DataFrame(
ais_points = AISPoints(pd.DataFrame(
{
{
Loading