Skip to content

Commit ede3ae6

Browse files
committed
Rename to _unpack_gff3_attributes, update uses
1 parent 1493ef0 commit ede3ae6

5 files changed

Lines changed: 9 additions & 9 deletions

File tree

malariagen_data/amin1.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
_read_gff3,
1818
_resolve_region,
1919
_simple_xarray_concat,
20-
unpack_gff3_attributes,
20+
_unpack_gff3_attributes,
2121
)
2222

2323
GENOME_FEATURES_GFF3_PATH = (
@@ -145,7 +145,7 @@ def genome_features(self, attributes=("ID", "Parent", "Name", "description")):
145145
with self._fs.open(path, mode="rb") as f:
146146
df = _read_gff3(f, compression="gzip")
147147
if attributes is not None:
148-
df = unpack_gff3_attributes(df, attributes=attributes)
148+
df = _unpack_gff3_attributes(df, attributes=attributes)
149149
self._cache_genome_features[attributes] = df
150150

151151
return df

malariagen_data/anoph/genome_features.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
_parse_multi_region,
1414
_parse_single_region,
1515
_read_gff3,
16-
unpack_gff3_attributes,
16+
_unpack_gff3_attributes,
1717
)
1818
from . import base_params, gplt_params
1919
from .genome_sequence import AnophelesGenomeSequenceData
@@ -66,7 +66,7 @@ def _genome_features(self, *, attributes: Tuple[str, ...]):
6666
with self._fs.open(path, mode="rb") as f:
6767
df = _read_gff3(f, compression=compression)
6868
if attributes:
69-
df = unpack_gff3_attributes(df, attributes=attributes)
69+
df = _unpack_gff3_attributes(df, attributes=attributes)
7070
self._cache_genome_features[attributes] = df
7171

7272
return df

malariagen_data/plasmodium.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
_init_zarr_store,
1717
_read_gff3,
1818
_resolve_region,
19-
unpack_gff3_attributes,
19+
_unpack_gff3_attributes,
2020
)
2121

2222

@@ -320,7 +320,7 @@ def genome_features(self, attributes=("ID", "Parent", "Name")):
320320
with self._fs.open(path, mode="rb") as f:
321321
df = _read_gff3(f, compression="gzip")
322322
if attributes is not None:
323-
df = unpack_gff3_attributes(df, attributes=attributes)
323+
df = _unpack_gff3_attributes(df, attributes=attributes)
324324
self._cache_genome_features[attributes] = df
325325

326326
return df

malariagen_data/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def _read_gff3(buf, compression="gzip"):
9191
return df
9292

9393

94-
def unpack_gff3_attributes(df: pd.DataFrame, attributes: Tuple[str, ...]):
94+
def _unpack_gff3_attributes(df: pd.DataFrame, attributes: Tuple[str, ...]):
9595
df = df.copy()
9696

9797
# discover all attribute keys

tests/test_plasmodium.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ def test_variant_calls_extended(self, mock_open_variant_calls_zarr):
424424
],
425425
)
426426

427-
@patch("malariagen_data.plasmodium.unpack_gff3_attributes")
427+
@patch("malariagen_data.plasmodium._unpack_gff3_attributes")
428428
@patch("malariagen_data.plasmodium._read_gff3")
429429
@patch("builtins.open", new_callable=mock_open)
430430
def test_genome_features(self, mock_open, mock_read_gff, mock_unpack):
@@ -469,7 +469,7 @@ def test_genome_features_wrong_attribute_not_in_df(self):
469469
TypeError, self.test_plasmodium_class.genome_features, "bad_attribute"
470470
)
471471

472-
@patch("malariagen_data.plasmodium.unpack_gff3_attributes")
472+
@patch("malariagen_data.plasmodium._unpack_gff3_attributes")
473473
@patch("malariagen_data.plasmodium._read_gff3")
474474
@patch("builtins.open", new_callable=mock_open)
475475
def test_genome_features_uses_cache(self, mock_open, mock_read_gff, mock_unpack):

0 commit comments

Comments
 (0)