Skip to content

Commit

Permalink
add test for _remove_fill_values
Browse files Browse the repository at this point in the history
  • Loading branch information
callumrollo committed Jan 16, 2023
1 parent 4a7c830 commit 3098843
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/test_seaexplorer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import polars as pl
import numpy as np
import pytest
from pathlib import Path
import os
Expand Down Expand Up @@ -63,6 +64,14 @@ def test_merge_rawnc():
kind='sub')
assert result_default is False
assert result_sub is True


def test__remove_fill_values():
# This should convert values equallling 9999 in the original df to nan
df_in = pl.read_parquet('tests/data/realtime_rawnc/sea035.0012.pld1.sub.0036.parquet')
df_out = seaexplorer._remove_fill_values(df_in)
assert (df_in.select("GPCTD_DOF").to_numpy()[:, 0] == 9999).all()
assert np.isnan(df_out.select("GPCTD_DOF").to_numpy()[:, 0]).all()


def test__interp_gli_to_pld():
Expand Down

0 comments on commit 3098843

Please sign in to comment.