Skip to content

Commit

Permalink
Debug windows CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiggi committed Jun 1, 2024
1 parent ec78ed9 commit 1dd4bf7
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ omit =
gpm/cli/*
gpm/encoding/*
gpm/etc/*
gpm/retrieval/*
gpm/retrievals/*
gpm/visualization/animation.py
gpm/utils/pyresample.py
gpm/_version.py

[report]
Expand Down
4 changes: 4 additions & 0 deletions gpm/bucket/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,13 @@
"""This directory defines the GPM-API geographic binning toolbox."""
from gpm.bucket.partitioning import LonLatPartitioning, TilePartitioning
from gpm.bucket.readers import read_bucket as read
from gpm.bucket.routines import merge_granule_buckets, write_bucket, write_granules_bucket

__all__ = [
"LonLatPartitioning",
"TilePartitioning",
"read",
"merge_granule_buckets",
"write_granules_bucket",
"write_bucket",
]
2 changes: 1 addition & 1 deletion gpm/bucket/routines.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def merge_granule_buckets(
src_bucket_dir,
dst_bucket_dir,
row_group_size="400MB",
max_file_size="2GB",
max_file_size="1GB",
compression="snappy",
compression_level=None,
write_metadata=False,
Expand Down
6 changes: 4 additions & 2 deletions gpm/tests/test_bucket/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ def test_get_subdirectories(tmp_path):
results = get_subdirectories(base_dir=bucket_dir, path=False)
assert results == ["lon_bin=-5.0"]
results = get_subdirectories(base_dir=os.path.join(bucket_dir, "lon_bin=-5.0"), path=False)
assert results == ["lat_bin=5.0", "lat_bin=-5.0"]
expected_results = ["lat_bin=5.0", "lat_bin=-5.0"]
assert sorted(results) == sorted(expected_results)


def test_get_partitions_paths(tmp_path):
Expand All @@ -182,10 +183,11 @@ def test_get_partitions_paths(tmp_path):
create_test_bucket(bucket_dir=bucket_dir)
# Test results
results = get_partitions_paths(bucket_dir=bucket_dir)
assert results == [
expected_results = [
os.path.join(bucket_dir, "lon_bin=-5.0", "lat_bin=-5.0"),
os.path.join(bucket_dir, "lon_bin=-5.0", "lat_bin=5.0"),
]
assert sorted(results) == sorted(expected_results)


def test_search_leaf_files_in_parallel(tmp_path):
Expand Down
4 changes: 4 additions & 0 deletions gpm/tests/test_bucket/test_readers.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ def test_read_full_bucket(self, tmp_path):

# Test read full database
df_pl = read_bucket(bucket_dir)
assert df_pl.columns == [] # TODO WINDOW BUG
assert isinstance(df_pl, pl.DataFrame)
assert df_pl.shape == (150, NUM_COLUMNS)

def test_rows_columns_subsets(self, tmp_path):
Expand All @@ -106,10 +108,12 @@ def test_rows_columns_subsets(self, tmp_path):

# Test read row subset
df_pl = read_bucket(bucket_dir, n_rows=2)
assert isinstance(df_pl, pl.DataFrame)
assert df_pl.shape == (2, NUM_COLUMNS)

# Test read row, columns subset
df_pl = read_bucket(bucket_dir, n_rows=3, columns=["lon", "lat"])
assert df_pl.columns == [] # TODO WINDOW BUG
assert df_pl.shape == (3, 2)
assert "lon" in df_pl
assert "lat" in df_pl
Expand Down

0 comments on commit 1dd4bf7

Please sign in to comment.