Skip to content

Commit 6649eca

Browse files
committed
Linting
1 parent 64eb5ea commit 6649eca

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

malariagen_data/anoph/karyotype.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,14 @@ def load_inversion_tags(self, inversion: inversion_param) -> pd.DataFrame:
3636
import importlib.resources
3737
from .. import resources
3838

39-
with importlib.resources.path(resources, self._inversion_tag_path) as path:
40-
df_tag_snps = pd.read_csv(path, sep=",")
41-
return df_tag_snps.query(f"inversion == '{inversion}'").reset_index()
39+
if not self._inversion_tag_path:
40+
raise FileNotFoundError(
41+
"The file containing the inversion tags is missing."
42+
)
43+
else:
44+
with importlib.resources.path(resources, self._inversion_tag_path) as path:
45+
df_tag_snps = pd.read_csv(path, sep=",")
46+
return df_tag_snps.query(f"inversion == '{inversion}'").reset_index()
4247

4348
@check_types
4449
@doc(

0 commit comments

Comments
 (0)