Skip to content

Commit 13c28d5

Browse files
committed
Version 0.10.1
1 parent 553ce10 commit 13c28d5

File tree

5 files changed

+26
-1
lines changed

5 files changed

+26
-1
lines changed

docs/release-history.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
Release History
33
===============
44

5+
v0.10.1 (2021-07-16)
6+
--------------------
7+
8+
Fixed an issue reporting the size of GenotypeDtype in memory
9+
510
v0.10.0 (2021-07-16)
611
--------------------
712

pandas_genomics/arrays/genotype_array.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ def __init__(self, variant: Optional[Variant] = None):
8585
("gt_score", np.uint8),
8686
]
8787
)
88+
self.itemsize = self._record_type.itemsize
8889

8990
# ExtensionDtype Methods
9091
# -------------------------

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "pandas-genomics"
3-
version = "0.10.0"
3+
version = "0.10.1"
44
description = "Pandas ExtensionDtypes and ExtensionArray for working with genomics data"
55
license = "BSD-3-Clause"
66
authors = ["John McGuigan <jrm5100@psu.edu>"]

tests/genotype_array/test_GenotypeArrayInfo.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
"""
22
Test various calculations performed by GenotypeArray
33
"""
4+
import sys
5+
46
import numpy as np
57
import pandas as pd
68

@@ -132,3 +134,8 @@ def test_HWE(ga_inhwe, ga_nothwe):
132134
* 50,
133135
)
134136
assert ga_triploid.hwe_pval is np.nan
137+
138+
139+
def test_size(ga_AA_Aa_aa_BB_Bb_bb):
140+
# gts and scores (6*3 = 18)
141+
assert ga_AA_Aa_aa_BB_Bb_bb._data.nbytes == 18

tests/genotype_array/test_GenotypeDtype.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,15 @@ def test_from_str(input_str, variant):
6666
"""Test creating GenotypeDtype from str"""
6767
gtdtype = GenotypeDtype.construct_from_string(input_str)
6868
assert gtdtype.variant == variant
69+
70+
71+
@pytest.mark.parametrize(
72+
"input_str,size",
73+
[
74+
("genotype(2n)[12; 112161652; rs12462; T; C]", 3),
75+
("genotype(3n)[12; 112161652; rs12462; T; C]", 4),
76+
],
77+
)
78+
def test_size(input_str, size):
79+
gtdtype = GenotypeDtype.construct_from_string(input_str)
80+
assert gtdtype.itemsize == size

0 commit comments

Comments
 (0)