Initialize Layer object. Parameters ---------- annotations : Mapping[str, Any], optional By default, None. Annotations are metadata or soft constraints associated with tasks that dask schedulers may choose to respect: They sign
(
self,
annotations: Mapping[str, Any] | None = None,
collection_annotations: Mapping[str, Any] | None = None,
)
| 68 | collection_annotations: Mapping[str, Any] | None |
| 69 | |
| 70 | def __init__( |
| 71 | self, |
| 72 | annotations: Mapping[str, Any] | None = None, |
| 73 | collection_annotations: Mapping[str, Any] | None = None, |
| 74 | ): |
| 75 | """Initialize Layer object. |
| 76 | |
| 77 | Parameters |
| 78 | ---------- |
| 79 | annotations : Mapping[str, Any], optional |
| 80 | By default, None. |
| 81 | Annotations are metadata or soft constraints associated with tasks |
| 82 | that dask schedulers may choose to respect: |
| 83 | They signal intent without enforcing hard constraints. |
| 84 | As such, they are primarily designed for use with the distributed |
| 85 | scheduler. See the dask.annotate function for more information. |
| 86 | collection_annotations : Mapping[str, Any], optional. By default, None. |
| 87 | Experimental, intended to assist with visualizing the performance |
| 88 | characteristics of Dask computations. |
| 89 | These annotations are *not* passed to the distributed scheduler. |
| 90 | """ |
| 91 | self.annotations = annotations or dask.get_annotations().copy() or None |
| 92 | self.collection_annotations = collection_annotations or copy.copy( |
| 93 | config.get("collection_annotations", None) |
| 94 | ) |
| 95 | |
| 96 | @functools.cached_property |
| 97 | def has_legacy_tasks(self): |