File tree Expand file tree Collapse file tree 3 files changed +6
-13
lines changed
Expand file tree Collapse file tree 3 files changed +6
-13
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ dependencies = [
2222]
2323
2424[project .entry-points ."xarray .backends" ]
25- esgf = " xarray_esgf.engine_esgf :EsgfBackendEntrypoint"
25+ esgf = " xarray_esgf.engine :EsgfBackendEntrypoint"
2626
2727[project .urls ]
2828Homepage = " https://bopen.github.io/xarray-esgf/"
Original file line number Diff line number Diff line change 11import asyncio
22import dataclasses
3- import hashlib
43from collections import defaultdict
54from collections .abc import Callable , Iterable
65from functools import cached_property
98
109import xarray as xr
1110from esgpull import Esgpull , File , Query
11+ from esgpull .fs import FileCheck
1212from xarray import DataArray , Dataset
1313
1414DATASET_ID_KEYS = Literal [
@@ -68,20 +68,13 @@ def files(self) -> list[File]:
6868 )
6969
7070 def get_local_path (self , file : File ) -> Path :
71- return self ._client .fs . paths . data / file . local_path / file . filename
71+ return self ._client .fs [ file ]. drs
7272
7373 @property
7474 def missing_files (self ) -> list [File ]:
75- missing_files = []
76- for file in self .files :
77- path = self .get_local_path (file )
78- if path .exists ():
79- with path .open ("rb" ) as f :
80- digest = hashlib .file_digest (f , file .checksum_type )
81- if digest .hexdigest () == file .checksum :
82- continue
83- missing_files .append (file )
84- return missing_files
75+ return [
76+ file for file in self .files if self ._client .fs .check (file ) != FileCheck .Ok
77+ ]
8578
8679 @cached_property
8780 def local_paths (self ) -> dict [str , list [Path ]]:
File renamed without changes.
You can’t perform that action at this time.
0 commit comments