Skip to content

Commit

Permalink
Version 0.10.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jrm5100 committed Jul 16, 2021
1 parent 553ce10 commit 13c28d5
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 1 deletion.
5 changes: 5 additions & 0 deletions docs/release-history.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
Release History
===============

v0.10.1 (2021-07-16)
--------------------

Fixed an issue reporting the size of GenotypeDtype in memory

v0.10.0 (2021-07-16)
--------------------

Expand Down
1 change: 1 addition & 0 deletions pandas_genomics/arrays/genotype_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ def __init__(self, variant: Optional[Variant] = None):
("gt_score", np.uint8),
]
)
self.itemsize = self._record_type.itemsize

# ExtensionDtype Methods
# -------------------------
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pandas-genomics"
version = "0.10.0"
version = "0.10.1"
description = "Pandas ExtensionDtypes and ExtensionArray for working with genomics data"
license = "BSD-3-Clause"
authors = ["John McGuigan <[email protected]>"]
Expand Down
7 changes: 7 additions & 0 deletions tests/genotype_array/test_GenotypeArrayInfo.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""
Test various calculations performed by GenotypeArray
"""
import sys

import numpy as np
import pandas as pd

Expand Down Expand Up @@ -132,3 +134,8 @@ def test_HWE(ga_inhwe, ga_nothwe):
* 50,
)
assert ga_triploid.hwe_pval is np.nan


def test_size(ga_AA_Aa_aa_BB_Bb_bb):
# gts and scores (6*3 = 18)
assert ga_AA_Aa_aa_BB_Bb_bb._data.nbytes == 18
12 changes: 12 additions & 0 deletions tests/genotype_array/test_GenotypeDtype.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,15 @@ def test_from_str(input_str, variant):
"""Test creating GenotypeDtype from str"""
gtdtype = GenotypeDtype.construct_from_string(input_str)
assert gtdtype.variant == variant


@pytest.mark.parametrize(
"input_str,size",
[
("genotype(2n)[12; 112161652; rs12462; T; C]", 3),
("genotype(3n)[12; 112161652; rs12462; T; C]", 4),
],
)
def test_size(input_str, size):
gtdtype = GenotypeDtype.construct_from_string(input_str)
assert gtdtype.itemsize == size

0 comments on commit 13c28d5

Please sign in to comment.