MCPcopy Create free account
hub / github.com/pydata/xarray / attrs

Function attrs

xarray/testing/strategies.py:232–248  ·  view source on GitHub ↗

Generates arbitrary valid attributes dictionaries for xarray objects. The generated dictionaries can potentially be recursive. Requires the hypothesis package to be installed. See Also -------- :ref:`testing.hypothesis`_

()

Source from the content-addressed store, hash-verified

230
231
232def attrs() -> st.SearchStrategy[Mapping[Hashable, Any]]:
233 """
234 Generates arbitrary valid attributes dictionaries for xarray objects.
235
236 The generated dictionaries can potentially be recursive.
237
238 Requires the hypothesis package to be installed.
239
240 See Also
241 --------
242 :ref:`testing.hypothesis`_
243 """
244 return st.recursive(
245 st.dictionaries(_attr_keys, _attr_values),
246 lambda children: st.dictionaries(_attr_keys, children),
247 max_leaves=3,
248 )
249
250
251ATTRS = attrs()

Callers 1

strategies.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…