Skip to content

Commit

Permalink
Merge pull request #168 from apriha/develop
Browse files Browse the repository at this point in the history
v2.7.2
  • Loading branch information
apriha authored Apr 20, 2023
2 parents c29785b + 17bc3bf commit f5df993
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
17 changes: 10 additions & 7 deletions tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,13 +545,16 @@ def generic_snps(self):

def generic_snps_vcf(self):
df = self.generic_snps()
return df.append(
self.create_snp_df(
rsid=["rs" + str(i) for i in range(12, 18)],
chrom=["1"] * 6,
pos=list(range(112, 118)),
genotype=[np.nan] * 6,
)
return pd.concat(
[
df,
self.create_snp_df(
rsid=["rs" + str(i) for i in range(12, 18)],
chrom=["1"] * 6,
pos=list(range(112, 118)),
genotype=[np.nan] * 6,
),
]
)

def run_parsing_tests(
Expand Down
25 changes: 12 additions & 13 deletions tests/test_snps.py
Original file line number Diff line number Diff line change
Expand Up @@ -731,12 +731,8 @@ def assert_results(self, results, expected_results):
check_names=True,
)
else:
pd.testing.assert_index_equal(
result[key],
pd.Index([], name="rsid"),
check_exact=True,
check_names=True,
)
self.assertTrue(result[key].empty)
self.assertEqual(result[key].name, "rsid")

def test_source_snps(self):
with tempfile.TemporaryDirectory() as tmpdir:
Expand Down Expand Up @@ -1029,13 +1025,16 @@ def test_appending_dfs(self):

def test_merge_chrom(self):
s1 = SNPs("tests/input/generic.csv")
df = s1.snps.append(
self.create_snp_df(
rsid=["rs100", "rs101", "rs102", "rs103"],
chrom=["Y", "Y", "Y", "Y"],
pos=[100, 101, 102, 103],
genotype=["A", np.nan, "A", "A"],
)
df = pd.concat(
[
s1.snps,
self.create_snp_df(
rsid=["rs100", "rs101", "rs102", "rs103"],
chrom=["Y", "Y", "Y", "Y"],
pos=[100, 101, 102, 103],
genotype=["A", np.nan, "A", "A"],
),
]
)
s1._snps = df.copy()
s2 = SNPs()
Expand Down

0 comments on commit f5df993

Please sign in to comment.