Skip to content

Commit

Permalink
Remove unused errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ravwojdyla committed Sep 23, 2020
1 parent 999f56b commit d99aa7e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion sgkit/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def display_genotypes(
ds_abbr = truncate(
ds_calls, max_sizes={"variants": max_variants, "samples": max_samples}
)
df = ds_abbr.to_dataframe().unstack(level="ploidy") # type: ignore[no-untyped-call]
df = ds_abbr.to_dataframe().unstack(level="ploidy")

# Convert each genotype to a string representation
def calls_to_str(r: pd.DataFrame) -> str:
Expand Down
2 changes: 1 addition & 1 deletion sgkit/stats/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def concat_2d(ds: Dataset, dims: Tuple[Hashable, Hashable]) -> DataArray:
# Add concatenation axis
arr = arr.expand_dims(dim=dims[1], axis=1)
arrs.append(arr)
return xr.concat(arrs, dim=dims[1]) # type: ignore[no-any-return,no-untyped-call]
return xr.concat(arrs, dim=dims[1])


def r2_score(YP: ArrayLike, YT: ArrayLike) -> ArrayLike:
Expand Down
6 changes: 3 additions & 3 deletions sgkit/tests/test_association.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def _get_statistics(
)
res = _sm_statistics(ds, i, add_intercept)
df_pred.append(
dsr.to_dataframe() # type: ignore[no-untyped-call]
dsr.to_dataframe()
.rename(columns=lambda c: c.replace("variant_", ""))
.iloc[i]
.to_dict()
Expand Down Expand Up @@ -183,9 +183,9 @@ def run(traits: Sequence[str]) -> Dataset:

traits = [f"trait_{i}" for i in range(ds.attrs["n_trait"])]
# Run regressions on individual traits and concatenate resulting statistics
dfr_single = xr.concat([run([t]) for t in traits], dim="traits").to_dataframe() # type: ignore[no-untyped-call]
dfr_single = xr.concat([run([t]) for t in traits], dim="traits").to_dataframe()
# Run regressions on all traits simulatenously
dfr_multi: DataFrame = run(traits).to_dataframe() # type: ignore[no-untyped-call]
dfr_multi: DataFrame = run(traits).to_dataframe()
pd.testing.assert_frame_equal(dfr_single, dfr_multi)


Expand Down
2 changes: 1 addition & 1 deletion sgkit/tests/test_hwe.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def test_hwep_dataset__precomputed_counts(ds_neq: Dataset) -> None:
ds = ds_neq
ac = ds["call_genotype"].sum(dim="ploidy")
cts = [1, 0, 2] # arg order: hets, hom1, hom2
gtc = xr.concat([(ac == ct).sum(dim="samples") for ct in cts], dim="counts").T # type: ignore[no-untyped-call]
gtc = xr.concat([(ac == ct).sum(dim="samples") for ct in cts], dim="counts").T
ds = ds.assign(**{"variant_genotype_counts": gtc})
p = hwep_test(ds, genotype_counts="variant_genotype_counts", merge=False)
assert np.all(p < 1e-8)
Expand Down
2 changes: 1 addition & 1 deletion sgkit/tests/test_regenie.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def prepare_stage_3_sgkit_results(
)
dsr = dsr.merge(ds[["variant_id"]])
dsr = dsr.assign(outcome=xr.DataArray(df_trait.columns, dims=("outcomes")))
df = dsr.to_dataframe().reset_index(drop=True) # type: ignore[no-untyped-call]
df = dsr.to_dataframe().reset_index(drop=True)
return df


Expand Down

0 comments on commit d99aa7e

Please sign in to comment.