MCPcopy Index your code
hub / github.com/pydata/xarray / __init__

Method __init__

xarray/structure/alignment.py:179–231  ·  view source on GitHub ↗
(
        self,
        objects: Iterable[T_Alignable],
        join: JoinOptions | CombineKwargDefault = "inner",
        indexes: Mapping[Any, Any] | None = None,
        exclude_dims: str | Iterable[Hashable] = frozenset(),
        exclude_vars: Iterable[Hashable] = frozenset(),
        method: str | None = None,
        tolerance: float | Iterable[float] | str | None = None,
        copy: bool = True,
        fill_value: Any = dtypes.NA,
        sparse: bool = False,
    )

Source from the content-addressed store, hash-verified

177 new_indexes: Indexes[Index]
178
179 def __init__(
180 self,
181 objects: Iterable[T_Alignable],
182 join: JoinOptions | CombineKwargDefault = "inner",
183 indexes: Mapping[Any, Any] | None = None,
184 exclude_dims: str | Iterable[Hashable] = frozenset(),
185 exclude_vars: Iterable[Hashable] = frozenset(),
186 method: str | None = None,
187 tolerance: float | Iterable[float] | str | None = None,
188 copy: bool = True,
189 fill_value: Any = dtypes.NA,
190 sparse: bool = False,
191 ):
192 self.objects = tuple(objects)
193 self.objects_matching_indexes: tuple[Any, ...] = ()
194 self.objects_matching_index_vars = ()
195
196 if not isinstance(join, CombineKwargDefault) and join not in get_args(
197 JoinOptions
198 ):
199 raise ValueError(f"invalid value for join: {join}")
200 self.join = join
201
202 self.copy = copy
203 self.fill_value = fill_value
204 self.sparse = sparse
205
206 if method is None and tolerance is None:
207 self.reindex_kwargs = {}
208 else:
209 self.reindex_kwargs = {"method": method, "tolerance": tolerance}
210
211 if isinstance(exclude_dims, str):
212 exclude_dims = [exclude_dims]
213 self.exclude_dims = frozenset(exclude_dims)
214 self.exclude_vars = frozenset(exclude_vars)
215
216 if indexes is None:
217 indexes = {}
218 self.indexes, self.index_vars = self._collect_indexes(
219 _normalize_indexes(indexes)
220 )
221
222 self.all_indexes = {}
223 self.all_index_vars = {}
224 self.unindexed_dim_sizes = {}
225
226 self.aligned_indexes = {}
227 self.aligned_index_vars = {}
228 self.reindex = {}
229 self.keep_original_indexes = set()
230
231 self.results = tuple()
232
233 def _collect_indexes(
234 self, indexes: Indexes

Callers

nothing calls this directly

Calls 2

_collect_indexesMethod · 0.95
_normalize_indexesFunction · 0.85

Tested by

no test coverage detected