Skip to content

Commit 2d251d4

Browse files
Fix Windows path compatibility in cloud storage URLs
1 parent a8009a8 commit 2d251d4

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

malariagen_data/plasmodium.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import json
2-
import os
32

43
import dask.array as da
54
import pandas as pd
@@ -60,7 +59,7 @@ def sample_metadata(self):
6059
One row per sample.
6160
"""
6261
if self._cache_sample_metadata is None:
63-
path = os.path.join(self._path, self.CONF["metadata_path"])
62+
path = f"{self._path}/{self.CONF['metadata_path']}"
6463
with self._fs.open(path) as f:
6564
self._cache_sample_metadata = pd.read_csv(f, sep="\t", na_values="")
6665
return self._cache_sample_metadata
@@ -75,7 +74,7 @@ def _open_variant_calls_zarr(self):
7574
7675
"""
7776
if self._cache_variant_calls_zarr is None:
78-
path = os.path.join(self._path, self.CONF["variant_calls_zarr_path"])
77+
path = f"{self._path}/{self.CONF['variant_calls_zarr_path']}"
7978
store = init_zarr_store(fs=self._fs, path=path)
8079
self._cache_variant_calls_zarr = zarr.open_consolidated(store=store)
8180
return self._cache_variant_calls_zarr
@@ -205,7 +204,7 @@ def open_genome(self):
205204
206205
"""
207206
if self._cache_genome is None:
208-
path = os.path.join(self._path, self.CONF["reference_path"])
207+
path = f"{self._path}/{self.CONF['reference_path']}"
209208
store = init_zarr_store(fs=self._fs, path=path)
210209
self._cache_genome = zarr.open_consolidated(store=store)
211210
return self._cache_genome
@@ -317,7 +316,7 @@ def genome_features(self, attributes=("ID", "Parent", "Name")):
317316
try:
318317
df = self._cache_genome_features[attributes]
319318
except KeyError:
320-
path = os.path.join(self._path, self.CONF["annotations_path"])
319+
path = f"{self._path}/{self.CONF['annotations_path']}"
321320
with self._fs.open(path, mode="rb") as f:
322321
df = read_gff3(f, compression="gzip")
323322
if attributes is not None:

0 commit comments

Comments
 (0)