Skip to content

Commit

Permalink
Merge pull request #192 from ImperialCollegeLondon/fix-export-readers
Browse files Browse the repository at this point in the history
Fix: A few missing re-exports from root module
  • Loading branch information
alexdewar authored Feb 7, 2025
2 parents 7428f83 + 5edb097 commit ff9e680
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions csvy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
read_metadata,
read_to_array,
read_to_dataframe,
read_to_dict,
read_to_list,
read_to_polars,
)
from .writers import Writer, write, write_header # noqa: F401
12 changes: 6 additions & 6 deletions tests/test_read.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def test_read_to_dataframe(data_path):
"""Test the read_to_dataframe function."""
import pandas as pd

from csvy.readers import read_to_dataframe
from csvy import read_to_dataframe

data, header = read_to_dataframe(data_path)
assert isinstance(data, pd.DataFrame)
Expand All @@ -100,7 +100,7 @@ def test_read_to_polars(data_path):
import polars as pl
from polars.testing import assert_frame_equal

from csvy.readers import read_to_polars
from csvy import read_to_polars

lazy_data, header = read_to_polars(data_path)
assert isinstance(lazy_data, pl.LazyFrame)
Expand All @@ -124,7 +124,7 @@ def test_read_to_polars(data_path):

def test_read_to_list(array_data_path):
"""Test the read_to_list function."""
from csvy.readers import read_to_list
from csvy import read_to_list

data, header = read_to_list(array_data_path, csv_options={"delimiter": ","})
assert isinstance(data, list)
Expand All @@ -136,7 +136,7 @@ def test_read_to_list(array_data_path):

def test_read_to_dict_with_default_column_names(array_data_path):
"""Test the read_to_list function."""
from csvy.readers import read_to_dict
from csvy import read_to_dict

data, header = read_to_dict(array_data_path, csv_options={"delimiter": ","})

Expand All @@ -149,7 +149,7 @@ def test_read_to_dict_with_default_column_names(array_data_path):

def test_read_to_dict_with_custom_column_names(array_data_path):
"""Test the read_to_list function."""
from csvy.readers import read_to_dict
from csvy import read_to_dict

column_names = ["A", "B", "C", "D"]
data, header = read_to_dict(
Expand All @@ -165,7 +165,7 @@ def test_read_to_dict_with_custom_column_names(array_data_path):

def test_read_to_dict_with_row_based_column_names(data_path):
"""Test the read_to_list function."""
from csvy.readers import read_to_dict
from csvy import read_to_dict

data, header = read_to_dict(
data_path, column_names=0, csv_options={"delimiter": ","}
Expand Down

0 comments on commit ff9e680

Please sign in to comment.