|
9 | 9 | class TestLoadDataset:
|
10 | 10 | def test_download_from_github(self, tmp_path) -> None:
|
11 | 11 | cache_dir = tmp_path / tutorial._default_cache_dir_name
|
12 |
| - ds = tutorial.open_dataset("tiny", cache_dir=cache_dir).load() |
| 12 | + ds = tutorial.load_dataset("tiny", cache_dir=cache_dir) |
13 | 13 | tiny = DataArray(range(5), name="tiny").to_dataset()
|
14 | 14 | assert_identical(ds, tiny)
|
15 | 15 |
|
16 |
| - def test_download_from_github_load_without_cache( |
17 |
| - self, tmp_path, monkeypatch |
18 |
| - ) -> None: |
| 16 | + def test_download_from_github_load_without_cache(self, tmp_path) -> None: |
19 | 17 | cache_dir = tmp_path / tutorial._default_cache_dir_name
|
20 |
| - |
21 |
| - ds_nocache = tutorial.open_dataset( |
22 |
| - "tiny", cache=False, cache_dir=cache_dir |
23 |
| - ).load() |
24 |
| - ds_cache = tutorial.open_dataset("tiny", cache_dir=cache_dir).load() |
| 18 | + ds_nocache = tutorial.load_dataset("tiny", cache=False, cache_dir=cache_dir) |
| 19 | + ds_cache = tutorial.load_dataset("tiny", cache_dir=cache_dir) |
25 | 20 | assert_identical(ds_cache, ds_nocache)
|
26 | 21 |
|
27 | 22 |
|
28 | 23 | @network
|
29 | 24 | class TestLoadDataTree:
|
30 | 25 | def test_download_from_github(self, tmp_path) -> None:
|
31 | 26 | cache_dir = tmp_path / tutorial._default_cache_dir_name
|
32 |
| - ds = tutorial.open_datatree("tiny", cache_dir=cache_dir).load() |
| 27 | + ds = tutorial.load_datatree("tiny", cache_dir=cache_dir) |
33 | 28 | tiny = DataTree.from_dict({"/": DataArray(range(5), name="tiny").to_dataset()})
|
34 | 29 | assert_identical(ds, tiny)
|
35 | 30 |
|
36 |
| - def test_download_from_github_load_without_cache( |
37 |
| - self, tmp_path, monkeypatch |
38 |
| - ) -> None: |
| 31 | + def test_download_from_github_load_without_cache(self, tmp_path) -> None: |
39 | 32 | cache_dir = tmp_path / tutorial._default_cache_dir_name
|
40 |
| - |
41 |
| - ds_nocache = tutorial.open_datatree( |
42 |
| - "tiny", cache=False, cache_dir=cache_dir |
43 |
| - ).load() |
44 |
| - ds_cache = tutorial.open_datatree("tiny", cache_dir=cache_dir).load() |
| 33 | + ds_nocache = tutorial.load_datatree("tiny", cache=False, cache_dir=cache_dir) |
| 34 | + ds_cache = tutorial.load_datatree("tiny", cache_dir=cache_dir) |
45 | 35 | assert_identical(ds_cache, ds_nocache)
|
0 commit comments