Skip to content

Commit

Permalink
chore: update examples with newer paths / data id
Browse files Browse the repository at this point in the history
  • Loading branch information
Jhsmit committed Feb 15, 2024
1 parent 4659f38 commit e895dde
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
4 changes: 2 additions & 2 deletions examples/load_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@

# %%
# Download a specific HDX dataset
vault.fetch_dataset("20221007_1530_SecA_Krishnamurthy")
vault.fetch_dataset("1665149400_SecA_Krishnamurthy")
vault.datasets

# %%
# Load the dataset
ds = vault.load_dataset("20221007_1530_SecA_Krishnamurthy")
ds = vault.load_dataset("1665149400_SecA_Krishnamurthy")

# Describe the dataset
print(ds.describe())
Expand Down
4 changes: 2 additions & 2 deletions examples/load_from_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import yaml


test_pth = Path("../tests").resolve()
test_pth = Path(__file__).parent.parent / "tests"
data_pth = test_pth / "datasets"
data_id = "20221007_1530_SecA_Krishnamurthy"
data_id = "1665149400_SecA_Krishnamurthy"

hdx_spec = yaml.safe_load((data_pth / data_id / "hdx_spec.yaml").read_text())
metadata = yaml.safe_load((data_pth / data_id / "metadata.yaml").read_text())
Expand Down
4 changes: 2 additions & 2 deletions examples/load_local_datasets.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from hdxms_datasets import DataVault
from pathlib import Path

test_pth = Path("../tests").resolve()
test_pth = Path(__file__).parent.parent / "tests"
data_pth = test_pth / "datasets"

# Creating a DataVault without giving a cache path name uses $home/.hdxms_datasets by default
vault = DataVault(data_pth)

# Load the dataset
ds = vault.load_dataset("20221007_1530_SecA_Krishnamurthy")
ds = vault.load_dataset("1665149400_SecA_Krishnamurthy")

# %%

Expand Down
7 changes: 3 additions & 4 deletions examples/load_to_pyhdx.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
from pathlib import Path


test_pth = Path("../tests").resolve()
test_pth = Path(__file__).parent.parent / "tests"
data_pth = test_pth / "datasets"

vault = DataVault(cache_dir=data_pth)
ds = vault.load_dataset("20221007_1530_SecB_Krishnamurthy")
ds = vault.load_dataset("1665149400_SecA_Krishnamurthy")

# not yet in latests release
hdxm = HDXMeasurement.from_dataset(ds)
hdxm = HDXMeasurement.from_dataset(ds, 0)

print(hdxm)
2 changes: 1 addition & 1 deletion tests/datasets/index.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# List of all available dataset id's
20221007_1530_SecA_Krishnamurthy
1665149400_SecA_Krishnamurthy

0 comments on commit e895dde

Please sign in to comment.