Skip to content

Windmill APIs

examples.windmill._api

BladeAPI

Bases: NodeAPI[Blade, BladeWrite, BladeList, BladeWriteList]

Source code in examples/windmill/_api/blade.py
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
class BladeAPI(NodeAPI[Blade, BladeWrite, BladeList, BladeWriteList]):
    _view_id = dm.ViewId("power-models", "Blade", "1")
    _properties_by_field = _BLADE_PROPERTIES_BY_FIELD
    _class_type = Blade
    _class_list = BladeList
    _class_write_list = BladeWriteList

    def __init__(self, client: CogniteClient):
        super().__init__(client=client)

        self.sensor_positions_edge = BladeSensorPositionsAPI(client)

    def __call__(
        self,
        is_damaged: bool | None = None,
        name: str | list[str] | None = None,
        name_prefix: str | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_QUERY_LIMIT,
        filter: dm.Filter | None = None,
    ) -> BladeQueryAPI[BladeList]:
        """Query starting at blades.

        Args:
            is_damaged: The is damaged to filter on.
            name: The name to filter on.
            name_prefix: The prefix of the name to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of blades to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query API for blades.

        """
        has_data = dm.filters.HasData(views=[self._view_id])
        filter_ = _create_blade_filter(
            self._view_id,
            is_damaged,
            name,
            name_prefix,
            external_id_prefix,
            space,
            (filter and dm.filters.And(filter, has_data)) or has_data,
        )
        builder = QueryBuilder(BladeList)
        return BladeQueryAPI(self._client, builder, filter_, limit)

    def apply(
        self,
        blade: BladeWrite | Sequence[BladeWrite],
        replace: bool = False,
        write_none: bool = False,
    ) -> ResourcesWriteResult:
        """Add or update (upsert) blades.

        Note: This method iterates through all nodes and timeseries linked to blade and creates them including the edges
        between the nodes. For example, if any of `sensor_positions` are set, then these
        nodes as well as any nodes linked to them, and all the edges linking these nodes will be created.

        Args:
            blade: Blade or sequence of blades to upsert.
            replace (bool): How do we behave when a property value exists? Do we replace all matching and existing values with the supplied values (true)?
                Or should we merge in new values for properties together with the existing values (false)? Note: This setting applies for all nodes or edges specified in the ingestion call.
            write_none (bool): This method, will by default, skip properties that are set to None. However, if you want to set properties to None,
                you can set this parameter to True. Note this only applies to properties that are nullable.
        Returns:
            Created instance(s), i.e., nodes, edges, and time series.

        Examples:

            Create a new blade:

                >>> from windmill import WindmillClient
                >>> from windmill.data_classes import BladeWrite
                >>> client = WindmillClient()
                >>> blade = BladeWrite(external_id="my_blade", ...)
                >>> result = client.blade.apply(blade)

        """
        warnings.warn(
            "The .apply method is deprecated and will be removed in v1.0. "
            "Please use the .upsert method on the client instead. This means instead of "
            "`my_client.blade.apply(my_items)` please use `my_client.upsert(my_items)`."
            "The motivation is that all apply methods are the same, and having one apply method per API "
            " class encourages users to create items in small batches, which is inefficient."
            "In addition, .upsert method is more descriptive of what the method does.",
            UserWarning,
            stacklevel=2,
        )
        return self._apply(blade, replace, write_none)

    def delete(
        self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
    ) -> dm.InstancesDeleteResult:
        """Delete one or more blade.

        Args:
            external_id: External id of the blade to delete.
            space: The space where all the blade are located.

        Returns:
            The instance(s), i.e., nodes and edges which has been deleted. Empty list if nothing was deleted.

        Examples:

            Delete blade by id:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> client.blade.delete("my_blade")
        """
        warnings.warn(
            "The .delete method is deprecated and will be removed in v1.0. "
            "Please use the .delete method on the client instead. This means instead of "
            "`my_client.blade.delete(my_ids)` please use `my_client.delete(my_ids)`."
            "The motivation is that all delete methods are the same, and having one delete method per API "
            " class encourages users to delete items in small batches, which is inefficient.",
            UserWarning,
            stacklevel=2,
        )
        return self._delete(external_id, space)

    @overload
    def retrieve(self, external_id: str, space: str = DEFAULT_INSTANCE_SPACE) -> Blade | None: ...

    @overload
    def retrieve(self, external_id: SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE) -> BladeList: ...

    def retrieve(
        self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
    ) -> Blade | BladeList | None:
        """Retrieve one or more blades by id(s).

        Args:
            external_id: External id or list of external ids of the blades.
            space: The space where all the blades are located.

        Returns:
            The requested blades.

        Examples:

            Retrieve blade by id:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> blade = client.blade.retrieve("my_blade")

        """
        return self._retrieve(
            external_id,
            space,
            retrieve_edges=True,
            edge_api_name_type_direction_view_id_penta=[
                (
                    self.sensor_positions_edge,
                    "sensor_positions",
                    dm.DirectRelationReference("power-models", "Blade.sensor_positions"),
                    "outwards",
                    dm.ViewId("power-models", "SensorPosition", "1"),
                ),
            ],
        )

    def search(
        self,
        query: str,
        properties: BladeTextFields | SequenceNotStr[BladeTextFields] | None = None,
        is_damaged: bool | None = None,
        name: str | list[str] | None = None,
        name_prefix: str | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
        sort_by: BladeFields | SequenceNotStr[BladeFields] | None = None,
        direction: Literal["ascending", "descending"] = "ascending",
        sort: InstanceSort | list[InstanceSort] | None = None,
    ) -> BladeList:
        """Search blades

        Args:
            query: The search query,
            properties: The property to search, if nothing is passed all text fields will be searched.
            is_damaged: The is damaged to filter on.
            name: The name to filter on.
            name_prefix: The prefix of the name to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of blades to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
            sort_by: The property to sort by.
            direction: The direction to sort by, either 'ascending' or 'descending'.
            sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
                This will override the sort_by and direction. This allowos you to sort by multiple fields and
                specify the direction for each field as well as how to handle null values.

        Returns:
            Search results blades matching the query.

        Examples:

           Search for 'my_blade' in all text properties:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> blades = client.blade.search('my_blade')

        """
        filter_ = _create_blade_filter(
            self._view_id,
            is_damaged,
            name,
            name_prefix,
            external_id_prefix,
            space,
            filter,
        )
        return self._search(
            query=query,
            properties=properties,
            filter_=filter_,
            limit=limit,
            sort_by=sort_by,  # type: ignore[arg-type]
            direction=direction,
            sort=sort,
        )

    @overload
    def aggregate(
        self,
        aggregate: Aggregations | dm.aggregations.MetricAggregation,
        group_by: None = None,
        property: BladeFields | SequenceNotStr[BladeFields] | None = None,
        query: str | None = None,
        search_property: BladeTextFields | SequenceNotStr[BladeTextFields] | None = None,
        is_damaged: bool | None = None,
        name: str | list[str] | None = None,
        name_prefix: str | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> dm.aggregations.AggregatedNumberedValue: ...

    @overload
    def aggregate(
        self,
        aggregate: SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation],
        group_by: None = None,
        property: BladeFields | SequenceNotStr[BladeFields] | None = None,
        query: str | None = None,
        search_property: BladeTextFields | SequenceNotStr[BladeTextFields] | None = None,
        is_damaged: bool | None = None,
        name: str | list[str] | None = None,
        name_prefix: str | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> list[dm.aggregations.AggregatedNumberedValue]: ...

    @overload
    def aggregate(
        self,
        aggregate: (
            Aggregations
            | dm.aggregations.MetricAggregation
            | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation]
        ),
        group_by: BladeFields | SequenceNotStr[BladeFields],
        property: BladeFields | SequenceNotStr[BladeFields] | None = None,
        query: str | None = None,
        search_property: BladeTextFields | SequenceNotStr[BladeTextFields] | None = None,
        is_damaged: bool | None = None,
        name: str | list[str] | None = None,
        name_prefix: str | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> InstanceAggregationResultList: ...

    def aggregate(
        self,
        aggregate: (
            Aggregations
            | dm.aggregations.MetricAggregation
            | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation]
        ),
        group_by: BladeFields | SequenceNotStr[BladeFields] | None = None,
        property: BladeFields | SequenceNotStr[BladeFields] | None = None,
        query: str | None = None,
        search_property: BladeTextFields | SequenceNotStr[BladeTextFields] | None = None,
        is_damaged: bool | None = None,
        name: str | list[str] | None = None,
        name_prefix: str | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> (
        dm.aggregations.AggregatedNumberedValue
        | list[dm.aggregations.AggregatedNumberedValue]
        | InstanceAggregationResultList
    ):
        """Aggregate data across blades

        Args:
            aggregate: The aggregation to perform.
            group_by: The property to group by when doing the aggregation.
            property: The property to perform aggregation on.
            query: The query to search for in the text field.
            search_property: The text field to search in.
            is_damaged: The is damaged to filter on.
            name: The name to filter on.
            name_prefix: The prefix of the name to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of blades to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            Aggregation results.

        Examples:

            Count blades in space `my_space`:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> result = client.blade.aggregate("count", space="my_space")

        """

        filter_ = _create_blade_filter(
            self._view_id,
            is_damaged,
            name,
            name_prefix,
            external_id_prefix,
            space,
            filter,
        )
        return self._aggregate(
            aggregate=aggregate,
            group_by=group_by,  # type: ignore[arg-type]
            properties=property,  # type: ignore[arg-type]
            query=query,
            search_properties=search_property,  # type: ignore[arg-type]
            limit=limit,
            filter=filter_,
        )

    def histogram(
        self,
        property: BladeFields,
        interval: float,
        query: str | None = None,
        search_property: BladeTextFields | SequenceNotStr[BladeTextFields] | None = None,
        is_damaged: bool | None = None,
        name: str | list[str] | None = None,
        name_prefix: str | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> dm.aggregations.HistogramValue:
        """Produces histograms for blades

        Args:
            property: The property to use as the value in the histogram.
            interval: The interval to use for the histogram bins.
            query: The query to search for in the text field.
            search_property: The text field to search in.
            is_damaged: The is damaged to filter on.
            name: The name to filter on.
            name_prefix: The prefix of the name to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of blades to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            Bucketed histogram results.

        """
        filter_ = _create_blade_filter(
            self._view_id,
            is_damaged,
            name,
            name_prefix,
            external_id_prefix,
            space,
            filter,
        )
        return self._histogram(
            property,
            interval,
            query,
            search_property,  # type: ignore[arg-type]
            limit,
            filter_,
        )

    def query(self) -> BladeQuery:
        """Start a query for blades."""
        warnings.warn("The .query is in alpha and is subject to breaking changes without notice.")
        return BladeQuery(self._client)

    def list(
        self,
        is_damaged: bool | None = None,
        name: str | list[str] | None = None,
        name_prefix: str | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
        sort_by: BladeFields | Sequence[BladeFields] | None = None,
        direction: Literal["ascending", "descending"] = "ascending",
        sort: InstanceSort | list[InstanceSort] | None = None,
        retrieve_connections: Literal["skip", "identifier", "full"] = "skip",
    ) -> BladeList:
        """List/filter blades

        Args:
            is_damaged: The is damaged to filter on.
            name: The name to filter on.
            name_prefix: The prefix of the name to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of blades to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
            sort_by: The property to sort by.
            direction: The direction to sort by, either 'ascending' or 'descending'.
            sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
                This will override the sort_by and direction. This allowos you to sort by multiple fields and
                specify the direction for each field as well as how to handle null values.
            retrieve_connections: Whether to retrieve `sensor_positions` for the blades. Defaults to 'skip'.
                'skip' will not retrieve any connections, 'identifier' will only retrieve the identifier of the connected items, and 'full' will retrieve the full connected items.

        Returns:
            List of requested blades

        Examples:

            List blades and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> blades = client.blade.list(limit=5)

        """
        filter_ = _create_blade_filter(
            self._view_id,
            is_damaged,
            name,
            name_prefix,
            external_id_prefix,
            space,
            filter,
        )

        if retrieve_connections == "skip":
            return self._list(
                limit=limit,
                filter=filter_,
                sort_by=sort_by,  # type: ignore[arg-type]
                direction=direction,
                sort=sort,
            )

        builder = QueryBuilder(BladeList)
        has_data = dm.filters.HasData(views=[self._view_id])
        builder.append(
            NodeQueryStep(
                builder.create_name(None),
                dm.query.NodeResultSetExpression(
                    filter=dm.filters.And(filter_, has_data) if filter_ else has_data,
                    sort=self._create_sort(sort_by, direction, sort),  # type: ignore[arg-type]
                ),
                Blade,
                max_retrieve_limit=limit,
            )
        )
        from_root = builder.get_from()
        edge_sensor_positions = builder.create_name(from_root)
        builder.append(
            EdgeQueryStep(
                edge_sensor_positions,
                dm.query.EdgeResultSetExpression(
                    from_=from_root,
                    direction="outwards",
                    chain_to="destination",
                ),
            )
        )
        if retrieve_connections == "full":
            builder.append(
                NodeQueryStep(
                    builder.create_name(edge_sensor_positions),
                    dm.query.NodeResultSetExpression(
                        from_=edge_sensor_positions,
                        filter=dm.filters.HasData(views=[SensorPosition._view_id]),
                    ),
                    SensorPosition,
                )
            )

        return builder.execute(self._client)

__call__(is_damaged=None, name=None, name_prefix=None, external_id_prefix=None, space=None, limit=DEFAULT_QUERY_LIMIT, filter=None)

Query starting at blades.

Parameters:

Name Type Description Default
is_damaged bool | None

The is damaged to filter on.

None
name str | list[str] | None

The name to filter on.

None
name_prefix str | None

The prefix of the name to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of blades to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_QUERY_LIMIT
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
BladeQueryAPI[BladeList]

A query API for blades.

Source code in examples/windmill/_api/blade.py
def __call__(
    self,
    is_damaged: bool | None = None,
    name: str | list[str] | None = None,
    name_prefix: str | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_QUERY_LIMIT,
    filter: dm.Filter | None = None,
) -> BladeQueryAPI[BladeList]:
    """Query starting at blades.

    Args:
        is_damaged: The is damaged to filter on.
        name: The name to filter on.
        name_prefix: The prefix of the name to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of blades to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query API for blades.

    """
    has_data = dm.filters.HasData(views=[self._view_id])
    filter_ = _create_blade_filter(
        self._view_id,
        is_damaged,
        name,
        name_prefix,
        external_id_prefix,
        space,
        (filter and dm.filters.And(filter, has_data)) or has_data,
    )
    builder = QueryBuilder(BladeList)
    return BladeQueryAPI(self._client, builder, filter_, limit)

aggregate(aggregate, group_by=None, property=None, query=None, search_property=None, is_damaged=None, name=None, name_prefix=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

aggregate(aggregate: Aggregations | dm.aggregations.MetricAggregation, group_by: None = None, property: BladeFields | SequenceNotStr[BladeFields] | None = None, query: str | None = None, search_property: BladeTextFields | SequenceNotStr[BladeTextFields] | None = None, is_damaged: bool | None = None, name: str | list[str] | None = None, name_prefix: str | None = None, external_id_prefix: str | None = None, space: str | list[str] | None = None, limit: int = DEFAULT_LIMIT_READ, filter: dm.Filter | None = None) -> dm.aggregations.AggregatedNumberedValue
aggregate(aggregate: SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation], group_by: None = None, property: BladeFields | SequenceNotStr[BladeFields] | None = None, query: str | None = None, search_property: BladeTextFields | SequenceNotStr[BladeTextFields] | None = None, is_damaged: bool | None = None, name: str | list[str] | None = None, name_prefix: str | None = None, external_id_prefix: str | None = None, space: str | list[str] | None = None, limit: int = DEFAULT_LIMIT_READ, filter: dm.Filter | None = None) -> list[dm.aggregations.AggregatedNumberedValue]
aggregate(aggregate: Aggregations | dm.aggregations.MetricAggregation | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation], group_by: BladeFields | SequenceNotStr[BladeFields], property: BladeFields | SequenceNotStr[BladeFields] | None = None, query: str | None = None, search_property: BladeTextFields | SequenceNotStr[BladeTextFields] | None = None, is_damaged: bool | None = None, name: str | list[str] | None = None, name_prefix: str | None = None, external_id_prefix: str | None = None, space: str | list[str] | None = None, limit: int = DEFAULT_LIMIT_READ, filter: dm.Filter | None = None) -> InstanceAggregationResultList

Aggregate data across blades

Parameters:

Name Type Description Default
aggregate Aggregations | MetricAggregation | SequenceNotStr[Aggregations | MetricAggregation]

The aggregation to perform.

required
group_by BladeFields | SequenceNotStr[BladeFields] | None

The property to group by when doing the aggregation.

None
property BladeFields | SequenceNotStr[BladeFields] | None

The property to perform aggregation on.

None
query str | None

The query to search for in the text field.

None
search_property BladeTextFields | SequenceNotStr[BladeTextFields] | None

The text field to search in.

None
is_damaged bool | None

The is damaged to filter on.

None
name str | list[str] | None

The name to filter on.

None
name_prefix str | None

The prefix of the name to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of blades to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
AggregatedNumberedValue | list[AggregatedNumberedValue] | InstanceAggregationResultList

Aggregation results.

Examples:

Count blades in space `my_space`:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> result = client.blade.aggregate("count", space="my_space")
Source code in examples/windmill/_api/blade.py
def aggregate(
    self,
    aggregate: (
        Aggregations
        | dm.aggregations.MetricAggregation
        | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation]
    ),
    group_by: BladeFields | SequenceNotStr[BladeFields] | None = None,
    property: BladeFields | SequenceNotStr[BladeFields] | None = None,
    query: str | None = None,
    search_property: BladeTextFields | SequenceNotStr[BladeTextFields] | None = None,
    is_damaged: bool | None = None,
    name: str | list[str] | None = None,
    name_prefix: str | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> (
    dm.aggregations.AggregatedNumberedValue
    | list[dm.aggregations.AggregatedNumberedValue]
    | InstanceAggregationResultList
):
    """Aggregate data across blades

    Args:
        aggregate: The aggregation to perform.
        group_by: The property to group by when doing the aggregation.
        property: The property to perform aggregation on.
        query: The query to search for in the text field.
        search_property: The text field to search in.
        is_damaged: The is damaged to filter on.
        name: The name to filter on.
        name_prefix: The prefix of the name to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of blades to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        Aggregation results.

    Examples:

        Count blades in space `my_space`:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> result = client.blade.aggregate("count", space="my_space")

    """

    filter_ = _create_blade_filter(
        self._view_id,
        is_damaged,
        name,
        name_prefix,
        external_id_prefix,
        space,
        filter,
    )
    return self._aggregate(
        aggregate=aggregate,
        group_by=group_by,  # type: ignore[arg-type]
        properties=property,  # type: ignore[arg-type]
        query=query,
        search_properties=search_property,  # type: ignore[arg-type]
        limit=limit,
        filter=filter_,
    )

apply(blade, replace=False, write_none=False)

Add or update (upsert) blades.

Note: This method iterates through all nodes and timeseries linked to blade and creates them including the edges between the nodes. For example, if any of sensor_positions are set, then these nodes as well as any nodes linked to them, and all the edges linking these nodes will be created.

Parameters:

Name Type Description Default
blade BladeWrite | Sequence[BladeWrite]

Blade or sequence of blades to upsert.

required
replace bool

How do we behave when a property value exists? Do we replace all matching and existing values with the supplied values (true)? Or should we merge in new values for properties together with the existing values (false)? Note: This setting applies for all nodes or edges specified in the ingestion call.

False
write_none bool

This method, will by default, skip properties that are set to None. However, if you want to set properties to None, you can set this parameter to True. Note this only applies to properties that are nullable.

False

Returns: Created instance(s), i.e., nodes, edges, and time series.

Examples:

Create a new blade:

    >>> from windmill import WindmillClient
    >>> from windmill.data_classes import BladeWrite
    >>> client = WindmillClient()
    >>> blade = BladeWrite(external_id="my_blade", ...)
    >>> result = client.blade.apply(blade)
Source code in examples/windmill/_api/blade.py
def apply(
    self,
    blade: BladeWrite | Sequence[BladeWrite],
    replace: bool = False,
    write_none: bool = False,
) -> ResourcesWriteResult:
    """Add or update (upsert) blades.

    Note: This method iterates through all nodes and timeseries linked to blade and creates them including the edges
    between the nodes. For example, if any of `sensor_positions` are set, then these
    nodes as well as any nodes linked to them, and all the edges linking these nodes will be created.

    Args:
        blade: Blade or sequence of blades to upsert.
        replace (bool): How do we behave when a property value exists? Do we replace all matching and existing values with the supplied values (true)?
            Or should we merge in new values for properties together with the existing values (false)? Note: This setting applies for all nodes or edges specified in the ingestion call.
        write_none (bool): This method, will by default, skip properties that are set to None. However, if you want to set properties to None,
            you can set this parameter to True. Note this only applies to properties that are nullable.
    Returns:
        Created instance(s), i.e., nodes, edges, and time series.

    Examples:

        Create a new blade:

            >>> from windmill import WindmillClient
            >>> from windmill.data_classes import BladeWrite
            >>> client = WindmillClient()
            >>> blade = BladeWrite(external_id="my_blade", ...)
            >>> result = client.blade.apply(blade)

    """
    warnings.warn(
        "The .apply method is deprecated and will be removed in v1.0. "
        "Please use the .upsert method on the client instead. This means instead of "
        "`my_client.blade.apply(my_items)` please use `my_client.upsert(my_items)`."
        "The motivation is that all apply methods are the same, and having one apply method per API "
        " class encourages users to create items in small batches, which is inefficient."
        "In addition, .upsert method is more descriptive of what the method does.",
        UserWarning,
        stacklevel=2,
    )
    return self._apply(blade, replace, write_none)

delete(external_id, space=DEFAULT_INSTANCE_SPACE)

Delete one or more blade.

Parameters:

Name Type Description Default
external_id str | SequenceNotStr[str]

External id of the blade to delete.

required
space str

The space where all the blade are located.

DEFAULT_INSTANCE_SPACE

Returns:

Type Description
InstancesDeleteResult

The instance(s), i.e., nodes and edges which has been deleted. Empty list if nothing was deleted.

Examples:

Delete blade by id:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> client.blade.delete("my_blade")
Source code in examples/windmill/_api/blade.py
def delete(
    self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
) -> dm.InstancesDeleteResult:
    """Delete one or more blade.

    Args:
        external_id: External id of the blade to delete.
        space: The space where all the blade are located.

    Returns:
        The instance(s), i.e., nodes and edges which has been deleted. Empty list if nothing was deleted.

    Examples:

        Delete blade by id:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> client.blade.delete("my_blade")
    """
    warnings.warn(
        "The .delete method is deprecated and will be removed in v1.0. "
        "Please use the .delete method on the client instead. This means instead of "
        "`my_client.blade.delete(my_ids)` please use `my_client.delete(my_ids)`."
        "The motivation is that all delete methods are the same, and having one delete method per API "
        " class encourages users to delete items in small batches, which is inefficient.",
        UserWarning,
        stacklevel=2,
    )
    return self._delete(external_id, space)

histogram(property, interval, query=None, search_property=None, is_damaged=None, name=None, name_prefix=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Produces histograms for blades

Parameters:

Name Type Description Default
property BladeFields

The property to use as the value in the histogram.

required
interval float

The interval to use for the histogram bins.

required
query str | None

The query to search for in the text field.

None
search_property BladeTextFields | SequenceNotStr[BladeTextFields] | None

The text field to search in.

None
is_damaged bool | None

The is damaged to filter on.

None
name str | list[str] | None

The name to filter on.

None
name_prefix str | None

The prefix of the name to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of blades to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
HistogramValue

Bucketed histogram results.

Source code in examples/windmill/_api/blade.py
def histogram(
    self,
    property: BladeFields,
    interval: float,
    query: str | None = None,
    search_property: BladeTextFields | SequenceNotStr[BladeTextFields] | None = None,
    is_damaged: bool | None = None,
    name: str | list[str] | None = None,
    name_prefix: str | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> dm.aggregations.HistogramValue:
    """Produces histograms for blades

    Args:
        property: The property to use as the value in the histogram.
        interval: The interval to use for the histogram bins.
        query: The query to search for in the text field.
        search_property: The text field to search in.
        is_damaged: The is damaged to filter on.
        name: The name to filter on.
        name_prefix: The prefix of the name to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of blades to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        Bucketed histogram results.

    """
    filter_ = _create_blade_filter(
        self._view_id,
        is_damaged,
        name,
        name_prefix,
        external_id_prefix,
        space,
        filter,
    )
    return self._histogram(
        property,
        interval,
        query,
        search_property,  # type: ignore[arg-type]
        limit,
        filter_,
    )

list(is_damaged=None, name=None, name_prefix=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None, sort_by=None, direction='ascending', sort=None, retrieve_connections='skip')

List/filter blades

Parameters:

Name Type Description Default
is_damaged bool | None

The is damaged to filter on.

None
name str | list[str] | None

The name to filter on.

None
name_prefix str | None

The prefix of the name to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of blades to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None
sort_by BladeFields | Sequence[BladeFields] | None

The property to sort by.

None
direction Literal['ascending', 'descending']

The direction to sort by, either 'ascending' or 'descending'.

'ascending'
sort InstanceSort | list[InstanceSort] | None

(Advanced) If sort_by and direction are not sufficient, you can write your own sorting. This will override the sort_by and direction. This allowos you to sort by multiple fields and specify the direction for each field as well as how to handle null values.

None
retrieve_connections Literal['skip', 'identifier', 'full']

Whether to retrieve sensor_positions for the blades. Defaults to 'skip'. 'skip' will not retrieve any connections, 'identifier' will only retrieve the identifier of the connected items, and 'full' will retrieve the full connected items.

'skip'

Returns:

Type Description
BladeList

List of requested blades

Examples:

List blades and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> blades = client.blade.list(limit=5)
Source code in examples/windmill/_api/blade.py
def list(
    self,
    is_damaged: bool | None = None,
    name: str | list[str] | None = None,
    name_prefix: str | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
    sort_by: BladeFields | Sequence[BladeFields] | None = None,
    direction: Literal["ascending", "descending"] = "ascending",
    sort: InstanceSort | list[InstanceSort] | None = None,
    retrieve_connections: Literal["skip", "identifier", "full"] = "skip",
) -> BladeList:
    """List/filter blades

    Args:
        is_damaged: The is damaged to filter on.
        name: The name to filter on.
        name_prefix: The prefix of the name to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of blades to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
        sort_by: The property to sort by.
        direction: The direction to sort by, either 'ascending' or 'descending'.
        sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
            This will override the sort_by and direction. This allowos you to sort by multiple fields and
            specify the direction for each field as well as how to handle null values.
        retrieve_connections: Whether to retrieve `sensor_positions` for the blades. Defaults to 'skip'.
            'skip' will not retrieve any connections, 'identifier' will only retrieve the identifier of the connected items, and 'full' will retrieve the full connected items.

    Returns:
        List of requested blades

    Examples:

        List blades and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> blades = client.blade.list(limit=5)

    """
    filter_ = _create_blade_filter(
        self._view_id,
        is_damaged,
        name,
        name_prefix,
        external_id_prefix,
        space,
        filter,
    )

    if retrieve_connections == "skip":
        return self._list(
            limit=limit,
            filter=filter_,
            sort_by=sort_by,  # type: ignore[arg-type]
            direction=direction,
            sort=sort,
        )

    builder = QueryBuilder(BladeList)
    has_data = dm.filters.HasData(views=[self._view_id])
    builder.append(
        NodeQueryStep(
            builder.create_name(None),
            dm.query.NodeResultSetExpression(
                filter=dm.filters.And(filter_, has_data) if filter_ else has_data,
                sort=self._create_sort(sort_by, direction, sort),  # type: ignore[arg-type]
            ),
            Blade,
            max_retrieve_limit=limit,
        )
    )
    from_root = builder.get_from()
    edge_sensor_positions = builder.create_name(from_root)
    builder.append(
        EdgeQueryStep(
            edge_sensor_positions,
            dm.query.EdgeResultSetExpression(
                from_=from_root,
                direction="outwards",
                chain_to="destination",
            ),
        )
    )
    if retrieve_connections == "full":
        builder.append(
            NodeQueryStep(
                builder.create_name(edge_sensor_positions),
                dm.query.NodeResultSetExpression(
                    from_=edge_sensor_positions,
                    filter=dm.filters.HasData(views=[SensorPosition._view_id]),
                ),
                SensorPosition,
            )
        )

    return builder.execute(self._client)

query()

Start a query for blades.

Source code in examples/windmill/_api/blade.py
def query(self) -> BladeQuery:
    """Start a query for blades."""
    warnings.warn("The .query is in alpha and is subject to breaking changes without notice.")
    return BladeQuery(self._client)

retrieve(external_id, space=DEFAULT_INSTANCE_SPACE)

retrieve(external_id: str, space: str = DEFAULT_INSTANCE_SPACE) -> Blade | None
retrieve(external_id: SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE) -> BladeList

Retrieve one or more blades by id(s).

Parameters:

Name Type Description Default
external_id str | SequenceNotStr[str]

External id or list of external ids of the blades.

required
space str

The space where all the blades are located.

DEFAULT_INSTANCE_SPACE

Returns:

Type Description
Blade | BladeList | None

The requested blades.

Examples:

Retrieve blade by id:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> blade = client.blade.retrieve("my_blade")
Source code in examples/windmill/_api/blade.py
def retrieve(
    self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
) -> Blade | BladeList | None:
    """Retrieve one or more blades by id(s).

    Args:
        external_id: External id or list of external ids of the blades.
        space: The space where all the blades are located.

    Returns:
        The requested blades.

    Examples:

        Retrieve blade by id:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> blade = client.blade.retrieve("my_blade")

    """
    return self._retrieve(
        external_id,
        space,
        retrieve_edges=True,
        edge_api_name_type_direction_view_id_penta=[
            (
                self.sensor_positions_edge,
                "sensor_positions",
                dm.DirectRelationReference("power-models", "Blade.sensor_positions"),
                "outwards",
                dm.ViewId("power-models", "SensorPosition", "1"),
            ),
        ],
    )

search(query, properties=None, is_damaged=None, name=None, name_prefix=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None, sort_by=None, direction='ascending', sort=None)

Search blades

Parameters:

Name Type Description Default
query str

The search query,

required
properties BladeTextFields | SequenceNotStr[BladeTextFields] | None

The property to search, if nothing is passed all text fields will be searched.

None
is_damaged bool | None

The is damaged to filter on.

None
name str | list[str] | None

The name to filter on.

None
name_prefix str | None

The prefix of the name to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of blades to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None
sort_by BladeFields | SequenceNotStr[BladeFields] | None

The property to sort by.

None
direction Literal['ascending', 'descending']

The direction to sort by, either 'ascending' or 'descending'.

'ascending'
sort InstanceSort | list[InstanceSort] | None

(Advanced) If sort_by and direction are not sufficient, you can write your own sorting. This will override the sort_by and direction. This allowos you to sort by multiple fields and specify the direction for each field as well as how to handle null values.

None

Returns:

Type Description
BladeList

Search results blades matching the query.

Examples:

Search for 'my_blade' in all text properties:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> blades = client.blade.search('my_blade')
Source code in examples/windmill/_api/blade.py
def search(
    self,
    query: str,
    properties: BladeTextFields | SequenceNotStr[BladeTextFields] | None = None,
    is_damaged: bool | None = None,
    name: str | list[str] | None = None,
    name_prefix: str | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
    sort_by: BladeFields | SequenceNotStr[BladeFields] | None = None,
    direction: Literal["ascending", "descending"] = "ascending",
    sort: InstanceSort | list[InstanceSort] | None = None,
) -> BladeList:
    """Search blades

    Args:
        query: The search query,
        properties: The property to search, if nothing is passed all text fields will be searched.
        is_damaged: The is damaged to filter on.
        name: The name to filter on.
        name_prefix: The prefix of the name to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of blades to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
        sort_by: The property to sort by.
        direction: The direction to sort by, either 'ascending' or 'descending'.
        sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
            This will override the sort_by and direction. This allowos you to sort by multiple fields and
            specify the direction for each field as well as how to handle null values.

    Returns:
        Search results blades matching the query.

    Examples:

       Search for 'my_blade' in all text properties:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> blades = client.blade.search('my_blade')

    """
    filter_ = _create_blade_filter(
        self._view_id,
        is_damaged,
        name,
        name_prefix,
        external_id_prefix,
        space,
        filter,
    )
    return self._search(
        query=query,
        properties=properties,
        filter_=filter_,
        limit=limit,
        sort_by=sort_by,  # type: ignore[arg-type]
        direction=direction,
        sort=sort,
    )

BladeQueryAPI

Bases: QueryAPI[T_DomainModelList]

Source code in examples/windmill/_api/blade_query.py
class BladeQueryAPI(QueryAPI[T_DomainModelList]):
    _view_id = dm.ViewId("power-models", "Blade", "1")

    def __init__(
        self,
        client: CogniteClient,
        builder: QueryBuilder[T_DomainModelList],
        filter_: dm.filters.Filter | None = None,
        limit: int = DEFAULT_QUERY_LIMIT,
    ):
        super().__init__(client, builder)
        from_ = self._builder.get_from()
        self._builder.append(
            NodeQueryStep(
                name=self._builder.create_name(from_),
                expression=dm.query.NodeResultSetExpression(
                    from_=from_,
                    filter=filter_,
                ),
                result_cls=Blade,
                max_retrieve_limit=limit,
            )
        )

    def sensor_positions(
        self,
        min_position: float | None = None,
        max_position: float | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        external_id_prefix_edge: str | None = None,
        space_edge: str | list[str] | None = None,
        filter: dm.Filter | None = None,
        limit: int = DEFAULT_QUERY_LIMIT,
    ) -> SensorPositionQueryAPI[T_DomainModelList]:
        """Query along the sensor position edges of the blade.

        Args:
            min_position: The minimum value of the position to filter on.
            max_position: The maximum value of the position to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            external_id_prefix_edge: The prefix of the external ID to filter on.
            space_edge: The space to filter on.
            filter: (Advanced) Filter applied to node. If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
            limit: Maximum number of sensor position edges to return. Defaults to 3. Set to -1, float("inf") or None
                to return all items.

        Returns:
            SensorPositionQueryAPI: The query API for the sensor position.
        """
        from .sensor_position_query import SensorPositionQueryAPI

        # from is a string as we added a node query step in the __init__ method
        from_ = cast(str, self._builder.get_from())
        edge_filter = _create_edge_filter(
            dm.DirectRelationReference("power-models", "Blade.sensor_positions"),
            external_id_prefix=external_id_prefix_edge,
            space=space_edge,
        )
        self._builder.append(
            EdgeQueryStep(
                name=self._builder.create_name(from_),
                expression=dm.query.EdgeResultSetExpression(
                    filter=edge_filter,
                    from_=from_,
                    direction="outwards",
                ),
                max_retrieve_limit=limit,
            )
        )

        view_id = SensorPositionQueryAPI._view_id
        has_data = dm.filters.HasData(views=[view_id])
        node_filer = _create_sensor_position_filter(
            view_id,
            min_position,
            max_position,
            external_id_prefix,
            space,
            (filter and dm.filters.And(filter, has_data)) or has_data,
        )
        return SensorPositionQueryAPI(self._client, self._builder, node_filer, limit)

    def query(
        self,
    ) -> T_DomainModelList:
        """Execute query and return the result.

        Returns:
            The list of the source nodes of the query.

        """
        return self._query()

query()

Execute query and return the result.

Returns:

Type Description
T_DomainModelList

The list of the source nodes of the query.

Source code in examples/windmill/_api/blade_query.py
def query(
    self,
) -> T_DomainModelList:
    """Execute query and return the result.

    Returns:
        The list of the source nodes of the query.

    """
    return self._query()

sensor_positions(min_position=None, max_position=None, external_id_prefix=None, space=None, external_id_prefix_edge=None, space_edge=None, filter=None, limit=DEFAULT_QUERY_LIMIT)

Query along the sensor position edges of the blade.

Parameters:

Name Type Description Default
min_position float | None

The minimum value of the position to filter on.

None
max_position float | None

The maximum value of the position to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
external_id_prefix_edge str | None

The prefix of the external ID to filter on.

None
space_edge str | list[str] | None

The space to filter on.

None
filter Filter | None

(Advanced) Filter applied to node. If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None
limit int

Maximum number of sensor position edges to return. Defaults to 3. Set to -1, float("inf") or None to return all items.

DEFAULT_QUERY_LIMIT

Returns:

Name Type Description
SensorPositionQueryAPI SensorPositionQueryAPI[T_DomainModelList]

The query API for the sensor position.

Source code in examples/windmill/_api/blade_query.py
def sensor_positions(
    self,
    min_position: float | None = None,
    max_position: float | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    external_id_prefix_edge: str | None = None,
    space_edge: str | list[str] | None = None,
    filter: dm.Filter | None = None,
    limit: int = DEFAULT_QUERY_LIMIT,
) -> SensorPositionQueryAPI[T_DomainModelList]:
    """Query along the sensor position edges of the blade.

    Args:
        min_position: The minimum value of the position to filter on.
        max_position: The maximum value of the position to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        external_id_prefix_edge: The prefix of the external ID to filter on.
        space_edge: The space to filter on.
        filter: (Advanced) Filter applied to node. If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
        limit: Maximum number of sensor position edges to return. Defaults to 3. Set to -1, float("inf") or None
            to return all items.

    Returns:
        SensorPositionQueryAPI: The query API for the sensor position.
    """
    from .sensor_position_query import SensorPositionQueryAPI

    # from is a string as we added a node query step in the __init__ method
    from_ = cast(str, self._builder.get_from())
    edge_filter = _create_edge_filter(
        dm.DirectRelationReference("power-models", "Blade.sensor_positions"),
        external_id_prefix=external_id_prefix_edge,
        space=space_edge,
    )
    self._builder.append(
        EdgeQueryStep(
            name=self._builder.create_name(from_),
            expression=dm.query.EdgeResultSetExpression(
                filter=edge_filter,
                from_=from_,
                direction="outwards",
            ),
            max_retrieve_limit=limit,
        )
    )

    view_id = SensorPositionQueryAPI._view_id
    has_data = dm.filters.HasData(views=[view_id])
    node_filer = _create_sensor_position_filter(
        view_id,
        min_position,
        max_position,
        external_id_prefix,
        space,
        (filter and dm.filters.And(filter, has_data)) or has_data,
    )
    return SensorPositionQueryAPI(self._client, self._builder, node_filer, limit)

BladeSensorPositionsAPI

Bases: EdgeAPI

Source code in examples/windmill/_api/blade_sensor_positions.py
class BladeSensorPositionsAPI(EdgeAPI):
    def list(
        self,
        from_blade: str | list[str] | dm.NodeId | list[dm.NodeId] | None = None,
        from_blade_space: str = DEFAULT_INSTANCE_SPACE,
        to_sensor_position: str | list[str] | dm.NodeId | list[dm.NodeId] | None = None,
        to_sensor_position_space: str = DEFAULT_INSTANCE_SPACE,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit=DEFAULT_LIMIT_READ,
    ) -> dm.EdgeList:
        """List sensor position edges of a blade.

        Args:
            from_blade: ID of the source blade.
            from_blade_space: Location of the blades.
            to_sensor_position: ID of the target sensor position.
            to_sensor_position_space: Location of the sensor positions.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of sensor position edges to return. Defaults to 25. Set to -1, float("inf") or None
                to return all items.

        Returns:
            The requested sensor position edges.

        Examples:

            List 5 sensor position edges connected to "my_blade":

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> blade = client.blade.sensor_positions_edge.list("my_blade", limit=5)

        """
        filter_ = _create_edge_filter(
            dm.DirectRelationReference("power-models", "Blade.sensor_positions"),
            from_blade,
            from_blade_space,
            to_sensor_position,
            to_sensor_position_space,
            external_id_prefix,
            space,
        )
        return self._list(filter_=filter_, limit=limit)

list(from_blade=None, from_blade_space=DEFAULT_INSTANCE_SPACE, to_sensor_position=None, to_sensor_position_space=DEFAULT_INSTANCE_SPACE, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ)

List sensor position edges of a blade.

Parameters:

Name Type Description Default
from_blade str | list[str] | NodeId | list[NodeId] | None

ID of the source blade.

None
from_blade_space str

Location of the blades.

DEFAULT_INSTANCE_SPACE
to_sensor_position str | list[str] | NodeId | list[NodeId] | None

ID of the target sensor position.

None
to_sensor_position_space str

Location of the sensor positions.

DEFAULT_INSTANCE_SPACE
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit

Maximum number of sensor position edges to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ

Returns:

Type Description
EdgeList

The requested sensor position edges.

Examples:

List 5 sensor position edges connected to "my_blade":

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> blade = client.blade.sensor_positions_edge.list("my_blade", limit=5)
Source code in examples/windmill/_api/blade_sensor_positions.py
def list(
    self,
    from_blade: str | list[str] | dm.NodeId | list[dm.NodeId] | None = None,
    from_blade_space: str = DEFAULT_INSTANCE_SPACE,
    to_sensor_position: str | list[str] | dm.NodeId | list[dm.NodeId] | None = None,
    to_sensor_position_space: str = DEFAULT_INSTANCE_SPACE,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit=DEFAULT_LIMIT_READ,
) -> dm.EdgeList:
    """List sensor position edges of a blade.

    Args:
        from_blade: ID of the source blade.
        from_blade_space: Location of the blades.
        to_sensor_position: ID of the target sensor position.
        to_sensor_position_space: Location of the sensor positions.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of sensor position edges to return. Defaults to 25. Set to -1, float("inf") or None
            to return all items.

    Returns:
        The requested sensor position edges.

    Examples:

        List 5 sensor position edges connected to "my_blade":

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> blade = client.blade.sensor_positions_edge.list("my_blade", limit=5)

    """
    filter_ = _create_edge_filter(
        dm.DirectRelationReference("power-models", "Blade.sensor_positions"),
        from_blade,
        from_blade_space,
        to_sensor_position,
        to_sensor_position_space,
        external_id_prefix,
        space,
    )
    return self._list(filter_=filter_, limit=limit)

GearboxAPI

Bases: NodeAPI[Gearbox, GearboxWrite, GearboxList, GearboxWriteList]

Source code in examples/windmill/_api/gearbox.py
class GearboxAPI(NodeAPI[Gearbox, GearboxWrite, GearboxList, GearboxWriteList]):
    _view_id = dm.ViewId("power-models", "Gearbox", "1")
    _properties_by_field = _GEARBOX_PROPERTIES_BY_FIELD
    _class_type = Gearbox
    _class_list = GearboxList
    _class_write_list = GearboxWriteList

    def __init__(self, client: CogniteClient):
        super().__init__(client=client)

        self.displacement_x = GearboxDisplacementXAPI(client, self._view_id)
        self.displacement_y = GearboxDisplacementYAPI(client, self._view_id)
        self.displacement_z = GearboxDisplacementZAPI(client, self._view_id)

    def __call__(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_QUERY_LIMIT,
        filter: dm.Filter | None = None,
    ) -> GearboxQueryAPI[GearboxList]:
        """Query starting at gearboxes.

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of gearboxes to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query API for gearboxes.

        """
        has_data = dm.filters.HasData(views=[self._view_id])
        filter_ = _create_gearbox_filter(
            self._view_id,
            external_id_prefix,
            space,
            (filter and dm.filters.And(filter, has_data)) or has_data,
        )
        builder = QueryBuilder(GearboxList)
        return GearboxQueryAPI(self._client, builder, filter_, limit)

    def apply(
        self,
        gearbox: GearboxWrite | Sequence[GearboxWrite],
        replace: bool = False,
        write_none: bool = False,
    ) -> ResourcesWriteResult:
        """Add or update (upsert) gearboxes.

        Args:
            gearbox: Gearbox or sequence of gearboxes to upsert.
            replace (bool): How do we behave when a property value exists? Do we replace all matching and existing values with the supplied values (true)?
                Or should we merge in new values for properties together with the existing values (false)? Note: This setting applies for all nodes or edges specified in the ingestion call.
            write_none (bool): This method, will by default, skip properties that are set to None. However, if you want to set properties to None,
                you can set this parameter to True. Note this only applies to properties that are nullable.
        Returns:
            Created instance(s), i.e., nodes, edges, and time series.

        Examples:

            Create a new gearbox:

                >>> from windmill import WindmillClient
                >>> from windmill.data_classes import GearboxWrite
                >>> client = WindmillClient()
                >>> gearbox = GearboxWrite(external_id="my_gearbox", ...)
                >>> result = client.gearbox.apply(gearbox)

        """
        warnings.warn(
            "The .apply method is deprecated and will be removed in v1.0. "
            "Please use the .upsert method on the client instead. This means instead of "
            "`my_client.gearbox.apply(my_items)` please use `my_client.upsert(my_items)`."
            "The motivation is that all apply methods are the same, and having one apply method per API "
            " class encourages users to create items in small batches, which is inefficient."
            "In addition, .upsert method is more descriptive of what the method does.",
            UserWarning,
            stacklevel=2,
        )
        return self._apply(gearbox, replace, write_none)

    def delete(
        self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
    ) -> dm.InstancesDeleteResult:
        """Delete one or more gearbox.

        Args:
            external_id: External id of the gearbox to delete.
            space: The space where all the gearbox are located.

        Returns:
            The instance(s), i.e., nodes and edges which has been deleted. Empty list if nothing was deleted.

        Examples:

            Delete gearbox by id:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> client.gearbox.delete("my_gearbox")
        """
        warnings.warn(
            "The .delete method is deprecated and will be removed in v1.0. "
            "Please use the .delete method on the client instead. This means instead of "
            "`my_client.gearbox.delete(my_ids)` please use `my_client.delete(my_ids)`."
            "The motivation is that all delete methods are the same, and having one delete method per API "
            " class encourages users to delete items in small batches, which is inefficient.",
            UserWarning,
            stacklevel=2,
        )
        return self._delete(external_id, space)

    @overload
    def retrieve(self, external_id: str, space: str = DEFAULT_INSTANCE_SPACE) -> Gearbox | None: ...

    @overload
    def retrieve(self, external_id: SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE) -> GearboxList: ...

    def retrieve(
        self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
    ) -> Gearbox | GearboxList | None:
        """Retrieve one or more gearboxes by id(s).

        Args:
            external_id: External id or list of external ids of the gearboxes.
            space: The space where all the gearboxes are located.

        Returns:
            The requested gearboxes.

        Examples:

            Retrieve gearbox by id:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> gearbox = client.gearbox.retrieve("my_gearbox")

        """
        return self._retrieve(external_id, space)

    def search(
        self,
        query: str,
        properties: GearboxTextFields | SequenceNotStr[GearboxTextFields] | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
        sort_by: GearboxFields | SequenceNotStr[GearboxFields] | None = None,
        direction: Literal["ascending", "descending"] = "ascending",
        sort: InstanceSort | list[InstanceSort] | None = None,
    ) -> GearboxList:
        """Search gearboxes

        Args:
            query: The search query,
            properties: The property to search, if nothing is passed all text fields will be searched.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of gearboxes to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
            sort_by: The property to sort by.
            direction: The direction to sort by, either 'ascending' or 'descending'.
            sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
                This will override the sort_by and direction. This allowos you to sort by multiple fields and
                specify the direction for each field as well as how to handle null values.

        Returns:
            Search results gearboxes matching the query.

        Examples:

           Search for 'my_gearbox' in all text properties:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> gearboxes = client.gearbox.search('my_gearbox')

        """
        filter_ = _create_gearbox_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )
        return self._search(
            query=query,
            properties=properties,
            filter_=filter_,
            limit=limit,
            sort_by=sort_by,  # type: ignore[arg-type]
            direction=direction,
            sort=sort,
        )

    @overload
    def aggregate(
        self,
        aggregate: Aggregations | dm.aggregations.MetricAggregation,
        group_by: None = None,
        property: GearboxFields | SequenceNotStr[GearboxFields] | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> dm.aggregations.AggregatedNumberedValue: ...

    @overload
    def aggregate(
        self,
        aggregate: SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation],
        group_by: None = None,
        property: GearboxFields | SequenceNotStr[GearboxFields] | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> list[dm.aggregations.AggregatedNumberedValue]: ...

    @overload
    def aggregate(
        self,
        aggregate: (
            Aggregations
            | dm.aggregations.MetricAggregation
            | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation]
        ),
        group_by: GearboxFields | SequenceNotStr[GearboxFields],
        property: GearboxFields | SequenceNotStr[GearboxFields] | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> InstanceAggregationResultList: ...

    def aggregate(
        self,
        aggregate: (
            Aggregations
            | dm.aggregations.MetricAggregation
            | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation]
        ),
        group_by: GearboxFields | SequenceNotStr[GearboxFields] | None = None,
        property: GearboxFields | SequenceNotStr[GearboxFields] | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> (
        dm.aggregations.AggregatedNumberedValue
        | list[dm.aggregations.AggregatedNumberedValue]
        | InstanceAggregationResultList
    ):
        """Aggregate data across gearboxes

        Args:
            aggregate: The aggregation to perform.
            group_by: The property to group by when doing the aggregation.
            property: The property to perform aggregation on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of gearboxes to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            Aggregation results.

        Examples:

            Count gearboxes in space `my_space`:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> result = client.gearbox.aggregate("count", space="my_space")

        """

        filter_ = _create_gearbox_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )
        return self._aggregate(
            aggregate=aggregate,
            group_by=group_by,  # type: ignore[arg-type]
            properties=property,  # type: ignore[arg-type]
            query=None,
            search_properties=None,
            limit=limit,
            filter=filter_,
        )

    def histogram(
        self,
        property: GearboxFields,
        interval: float,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> dm.aggregations.HistogramValue:
        """Produces histograms for gearboxes

        Args:
            property: The property to use as the value in the histogram.
            interval: The interval to use for the histogram bins.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of gearboxes to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            Bucketed histogram results.

        """
        filter_ = _create_gearbox_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )
        return self._histogram(
            property,
            interval,
            None,
            None,
            limit,
            filter_,
        )

    def query(self) -> GearboxQuery:
        """Start a query for gearboxes."""
        warnings.warn("The .query is in alpha and is subject to breaking changes without notice.")
        return GearboxQuery(self._client)

    def list(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
        sort_by: GearboxFields | Sequence[GearboxFields] | None = None,
        direction: Literal["ascending", "descending"] = "ascending",
        sort: InstanceSort | list[InstanceSort] | None = None,
    ) -> GearboxList:
        """List/filter gearboxes

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of gearboxes to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
            sort_by: The property to sort by.
            direction: The direction to sort by, either 'ascending' or 'descending'.
            sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
                This will override the sort_by and direction. This allowos you to sort by multiple fields and
                specify the direction for each field as well as how to handle null values.

        Returns:
            List of requested gearboxes

        Examples:

            List gearboxes and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> gearboxes = client.gearbox.list(limit=5)

        """
        filter_ = _create_gearbox_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )

        return self._list(
            limit=limit,
            filter=filter_,
            sort_by=sort_by,  # type: ignore[arg-type]
            direction=direction,
            sort=sort,
        )

__call__(external_id_prefix=None, space=None, limit=DEFAULT_QUERY_LIMIT, filter=None)

Query starting at gearboxes.

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of gearboxes to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_QUERY_LIMIT
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
GearboxQueryAPI[GearboxList]

A query API for gearboxes.

Source code in examples/windmill/_api/gearbox.py
def __call__(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_QUERY_LIMIT,
    filter: dm.Filter | None = None,
) -> GearboxQueryAPI[GearboxList]:
    """Query starting at gearboxes.

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of gearboxes to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query API for gearboxes.

    """
    has_data = dm.filters.HasData(views=[self._view_id])
    filter_ = _create_gearbox_filter(
        self._view_id,
        external_id_prefix,
        space,
        (filter and dm.filters.And(filter, has_data)) or has_data,
    )
    builder = QueryBuilder(GearboxList)
    return GearboxQueryAPI(self._client, builder, filter_, limit)

aggregate(aggregate, group_by=None, property=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

aggregate(aggregate: Aggregations | dm.aggregations.MetricAggregation, group_by: None = None, property: GearboxFields | SequenceNotStr[GearboxFields] | None = None, external_id_prefix: str | None = None, space: str | list[str] | None = None, limit: int = DEFAULT_LIMIT_READ, filter: dm.Filter | None = None) -> dm.aggregations.AggregatedNumberedValue
aggregate(aggregate: SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation], group_by: None = None, property: GearboxFields | SequenceNotStr[GearboxFields] | None = None, external_id_prefix: str | None = None, space: str | list[str] | None = None, limit: int = DEFAULT_LIMIT_READ, filter: dm.Filter | None = None) -> list[dm.aggregations.AggregatedNumberedValue]
aggregate(aggregate: Aggregations | dm.aggregations.MetricAggregation | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation], group_by: GearboxFields | SequenceNotStr[GearboxFields], property: GearboxFields | SequenceNotStr[GearboxFields] | None = None, external_id_prefix: str | None = None, space: str | list[str] | None = None, limit: int = DEFAULT_LIMIT_READ, filter: dm.Filter | None = None) -> InstanceAggregationResultList

Aggregate data across gearboxes

Parameters:

Name Type Description Default
aggregate Aggregations | MetricAggregation | SequenceNotStr[Aggregations | MetricAggregation]

The aggregation to perform.

required
group_by GearboxFields | SequenceNotStr[GearboxFields] | None

The property to group by when doing the aggregation.

None
property GearboxFields | SequenceNotStr[GearboxFields] | None

The property to perform aggregation on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of gearboxes to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
AggregatedNumberedValue | list[AggregatedNumberedValue] | InstanceAggregationResultList

Aggregation results.

Examples:

Count gearboxes in space `my_space`:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> result = client.gearbox.aggregate("count", space="my_space")
Source code in examples/windmill/_api/gearbox.py
def aggregate(
    self,
    aggregate: (
        Aggregations
        | dm.aggregations.MetricAggregation
        | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation]
    ),
    group_by: GearboxFields | SequenceNotStr[GearboxFields] | None = None,
    property: GearboxFields | SequenceNotStr[GearboxFields] | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> (
    dm.aggregations.AggregatedNumberedValue
    | list[dm.aggregations.AggregatedNumberedValue]
    | InstanceAggregationResultList
):
    """Aggregate data across gearboxes

    Args:
        aggregate: The aggregation to perform.
        group_by: The property to group by when doing the aggregation.
        property: The property to perform aggregation on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of gearboxes to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        Aggregation results.

    Examples:

        Count gearboxes in space `my_space`:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> result = client.gearbox.aggregate("count", space="my_space")

    """

    filter_ = _create_gearbox_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )
    return self._aggregate(
        aggregate=aggregate,
        group_by=group_by,  # type: ignore[arg-type]
        properties=property,  # type: ignore[arg-type]
        query=None,
        search_properties=None,
        limit=limit,
        filter=filter_,
    )

apply(gearbox, replace=False, write_none=False)

Add or update (upsert) gearboxes.

Parameters:

Name Type Description Default
gearbox GearboxWrite | Sequence[GearboxWrite]

Gearbox or sequence of gearboxes to upsert.

required
replace bool

How do we behave when a property value exists? Do we replace all matching and existing values with the supplied values (true)? Or should we merge in new values for properties together with the existing values (false)? Note: This setting applies for all nodes or edges specified in the ingestion call.

False
write_none bool

This method, will by default, skip properties that are set to None. However, if you want to set properties to None, you can set this parameter to True. Note this only applies to properties that are nullable.

False

Returns: Created instance(s), i.e., nodes, edges, and time series.

Examples:

Create a new gearbox:

    >>> from windmill import WindmillClient
    >>> from windmill.data_classes import GearboxWrite
    >>> client = WindmillClient()
    >>> gearbox = GearboxWrite(external_id="my_gearbox", ...)
    >>> result = client.gearbox.apply(gearbox)
Source code in examples/windmill/_api/gearbox.py
def apply(
    self,
    gearbox: GearboxWrite | Sequence[GearboxWrite],
    replace: bool = False,
    write_none: bool = False,
) -> ResourcesWriteResult:
    """Add or update (upsert) gearboxes.

    Args:
        gearbox: Gearbox or sequence of gearboxes to upsert.
        replace (bool): How do we behave when a property value exists? Do we replace all matching and existing values with the supplied values (true)?
            Or should we merge in new values for properties together with the existing values (false)? Note: This setting applies for all nodes or edges specified in the ingestion call.
        write_none (bool): This method, will by default, skip properties that are set to None. However, if you want to set properties to None,
            you can set this parameter to True. Note this only applies to properties that are nullable.
    Returns:
        Created instance(s), i.e., nodes, edges, and time series.

    Examples:

        Create a new gearbox:

            >>> from windmill import WindmillClient
            >>> from windmill.data_classes import GearboxWrite
            >>> client = WindmillClient()
            >>> gearbox = GearboxWrite(external_id="my_gearbox", ...)
            >>> result = client.gearbox.apply(gearbox)

    """
    warnings.warn(
        "The .apply method is deprecated and will be removed in v1.0. "
        "Please use the .upsert method on the client instead. This means instead of "
        "`my_client.gearbox.apply(my_items)` please use `my_client.upsert(my_items)`."
        "The motivation is that all apply methods are the same, and having one apply method per API "
        " class encourages users to create items in small batches, which is inefficient."
        "In addition, .upsert method is more descriptive of what the method does.",
        UserWarning,
        stacklevel=2,
    )
    return self._apply(gearbox, replace, write_none)

delete(external_id, space=DEFAULT_INSTANCE_SPACE)

Delete one or more gearbox.

Parameters:

Name Type Description Default
external_id str | SequenceNotStr[str]

External id of the gearbox to delete.

required
space str

The space where all the gearbox are located.

DEFAULT_INSTANCE_SPACE

Returns:

Type Description
InstancesDeleteResult

The instance(s), i.e., nodes and edges which has been deleted. Empty list if nothing was deleted.

Examples:

Delete gearbox by id:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> client.gearbox.delete("my_gearbox")
Source code in examples/windmill/_api/gearbox.py
def delete(
    self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
) -> dm.InstancesDeleteResult:
    """Delete one or more gearbox.

    Args:
        external_id: External id of the gearbox to delete.
        space: The space where all the gearbox are located.

    Returns:
        The instance(s), i.e., nodes and edges which has been deleted. Empty list if nothing was deleted.

    Examples:

        Delete gearbox by id:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> client.gearbox.delete("my_gearbox")
    """
    warnings.warn(
        "The .delete method is deprecated and will be removed in v1.0. "
        "Please use the .delete method on the client instead. This means instead of "
        "`my_client.gearbox.delete(my_ids)` please use `my_client.delete(my_ids)`."
        "The motivation is that all delete methods are the same, and having one delete method per API "
        " class encourages users to delete items in small batches, which is inefficient.",
        UserWarning,
        stacklevel=2,
    )
    return self._delete(external_id, space)

histogram(property, interval, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Produces histograms for gearboxes

Parameters:

Name Type Description Default
property GearboxFields

The property to use as the value in the histogram.

required
interval float

The interval to use for the histogram bins.

required
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of gearboxes to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
HistogramValue

Bucketed histogram results.

Source code in examples/windmill/_api/gearbox.py
def histogram(
    self,
    property: GearboxFields,
    interval: float,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> dm.aggregations.HistogramValue:
    """Produces histograms for gearboxes

    Args:
        property: The property to use as the value in the histogram.
        interval: The interval to use for the histogram bins.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of gearboxes to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        Bucketed histogram results.

    """
    filter_ = _create_gearbox_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )
    return self._histogram(
        property,
        interval,
        None,
        None,
        limit,
        filter_,
    )

list(external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None, sort_by=None, direction='ascending', sort=None)

List/filter gearboxes

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of gearboxes to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None
sort_by GearboxFields | Sequence[GearboxFields] | None

The property to sort by.

None
direction Literal['ascending', 'descending']

The direction to sort by, either 'ascending' or 'descending'.

'ascending'
sort InstanceSort | list[InstanceSort] | None

(Advanced) If sort_by and direction are not sufficient, you can write your own sorting. This will override the sort_by and direction. This allowos you to sort by multiple fields and specify the direction for each field as well as how to handle null values.

None

Returns:

Type Description
GearboxList

List of requested gearboxes

Examples:

List gearboxes and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> gearboxes = client.gearbox.list(limit=5)
Source code in examples/windmill/_api/gearbox.py
def list(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
    sort_by: GearboxFields | Sequence[GearboxFields] | None = None,
    direction: Literal["ascending", "descending"] = "ascending",
    sort: InstanceSort | list[InstanceSort] | None = None,
) -> GearboxList:
    """List/filter gearboxes

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of gearboxes to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
        sort_by: The property to sort by.
        direction: The direction to sort by, either 'ascending' or 'descending'.
        sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
            This will override the sort_by and direction. This allowos you to sort by multiple fields and
            specify the direction for each field as well as how to handle null values.

    Returns:
        List of requested gearboxes

    Examples:

        List gearboxes and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> gearboxes = client.gearbox.list(limit=5)

    """
    filter_ = _create_gearbox_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )

    return self._list(
        limit=limit,
        filter=filter_,
        sort_by=sort_by,  # type: ignore[arg-type]
        direction=direction,
        sort=sort,
    )

query()

Start a query for gearboxes.

Source code in examples/windmill/_api/gearbox.py
def query(self) -> GearboxQuery:
    """Start a query for gearboxes."""
    warnings.warn("The .query is in alpha and is subject to breaking changes without notice.")
    return GearboxQuery(self._client)

retrieve(external_id, space=DEFAULT_INSTANCE_SPACE)

retrieve(external_id: str, space: str = DEFAULT_INSTANCE_SPACE) -> Gearbox | None
retrieve(external_id: SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE) -> GearboxList

Retrieve one or more gearboxes by id(s).

Parameters:

Name Type Description Default
external_id str | SequenceNotStr[str]

External id or list of external ids of the gearboxes.

required
space str

The space where all the gearboxes are located.

DEFAULT_INSTANCE_SPACE

Returns:

Type Description
Gearbox | GearboxList | None

The requested gearboxes.

Examples:

Retrieve gearbox by id:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> gearbox = client.gearbox.retrieve("my_gearbox")
Source code in examples/windmill/_api/gearbox.py
def retrieve(
    self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
) -> Gearbox | GearboxList | None:
    """Retrieve one or more gearboxes by id(s).

    Args:
        external_id: External id or list of external ids of the gearboxes.
        space: The space where all the gearboxes are located.

    Returns:
        The requested gearboxes.

    Examples:

        Retrieve gearbox by id:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> gearbox = client.gearbox.retrieve("my_gearbox")

    """
    return self._retrieve(external_id, space)

search(query, properties=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None, sort_by=None, direction='ascending', sort=None)

Search gearboxes

Parameters:

Name Type Description Default
query str

The search query,

required
properties GearboxTextFields | SequenceNotStr[GearboxTextFields] | None

The property to search, if nothing is passed all text fields will be searched.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of gearboxes to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None
sort_by GearboxFields | SequenceNotStr[GearboxFields] | None

The property to sort by.

None
direction Literal['ascending', 'descending']

The direction to sort by, either 'ascending' or 'descending'.

'ascending'
sort InstanceSort | list[InstanceSort] | None

(Advanced) If sort_by and direction are not sufficient, you can write your own sorting. This will override the sort_by and direction. This allowos you to sort by multiple fields and specify the direction for each field as well as how to handle null values.

None

Returns:

Type Description
GearboxList

Search results gearboxes matching the query.

Examples:

Search for 'my_gearbox' in all text properties:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> gearboxes = client.gearbox.search('my_gearbox')
Source code in examples/windmill/_api/gearbox.py
def search(
    self,
    query: str,
    properties: GearboxTextFields | SequenceNotStr[GearboxTextFields] | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
    sort_by: GearboxFields | SequenceNotStr[GearboxFields] | None = None,
    direction: Literal["ascending", "descending"] = "ascending",
    sort: InstanceSort | list[InstanceSort] | None = None,
) -> GearboxList:
    """Search gearboxes

    Args:
        query: The search query,
        properties: The property to search, if nothing is passed all text fields will be searched.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of gearboxes to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
        sort_by: The property to sort by.
        direction: The direction to sort by, either 'ascending' or 'descending'.
        sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
            This will override the sort_by and direction. This allowos you to sort by multiple fields and
            specify the direction for each field as well as how to handle null values.

    Returns:
        Search results gearboxes matching the query.

    Examples:

       Search for 'my_gearbox' in all text properties:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> gearboxes = client.gearbox.search('my_gearbox')

    """
    filter_ = _create_gearbox_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )
    return self._search(
        query=query,
        properties=properties,
        filter_=filter_,
        limit=limit,
        sort_by=sort_by,  # type: ignore[arg-type]
        direction=direction,
        sort=sort,
    )

GearboxDisplacementXAPI

Source code in examples/windmill/_api/gearbox_displacement_x.py
class GearboxDisplacementXAPI:
    def __init__(self, client: CogniteClient, view_id: dm.ViewId):
        self._client = client
        self._view_id = view_id

    def __call__(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> GearboxDisplacementXQuery:
        """Query timeseries `gearbox.displacement_x`

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of gearboxes to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query object that can be used to retrieve datapoins for the gearbox.displacement_x timeseries
            selected in this method.

        Examples:

            Retrieve all data for 5 gearbox.displacement_x timeseries:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> gearboxes = client.gearbox.displacement_x(limit=5).retrieve()

        """
        filter_ = _create_gearbox_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )

        return GearboxDisplacementXQuery(
            client=self._client,
            view_id=self._view_id,
            timeseries_limit=limit,
            filter=filter_,
        )

    def list(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> TimeSeriesList:
        """List timeseries `gearbox.displacement_x`

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of gearboxes to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            List of Timeseries gearbox.displacement_x.

        Examples:

            List gearbox.displacement_x and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> gearboxes = client.gearbox.displacement_x.list(limit=5)

        """
        filter_ = _create_gearbox_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )
        external_ids = _retrieve_timeseries_external_ids_with_extra_displacement_x(
            self._client, self._view_id, filter_, limit
        )
        if external_ids:
            return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
        else:
            return TimeSeriesList([])

__call__(external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Query timeseries gearbox.displacement_x

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of gearboxes to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
GearboxDisplacementXQuery

A query object that can be used to retrieve datapoins for the gearbox.displacement_x timeseries

GearboxDisplacementXQuery

selected in this method.

Examples:

Retrieve all data for 5 gearbox.displacement_x timeseries:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> gearboxes = client.gearbox.displacement_x(limit=5).retrieve()
Source code in examples/windmill/_api/gearbox_displacement_x.py
def __call__(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> GearboxDisplacementXQuery:
    """Query timeseries `gearbox.displacement_x`

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of gearboxes to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query object that can be used to retrieve datapoins for the gearbox.displacement_x timeseries
        selected in this method.

    Examples:

        Retrieve all data for 5 gearbox.displacement_x timeseries:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> gearboxes = client.gearbox.displacement_x(limit=5).retrieve()

    """
    filter_ = _create_gearbox_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )

    return GearboxDisplacementXQuery(
        client=self._client,
        view_id=self._view_id,
        timeseries_limit=limit,
        filter=filter_,
    )

list(external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

List timeseries gearbox.displacement_x

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of gearboxes to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
TimeSeriesList

List of Timeseries gearbox.displacement_x.

Examples:

List gearbox.displacement_x and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> gearboxes = client.gearbox.displacement_x.list(limit=5)
Source code in examples/windmill/_api/gearbox_displacement_x.py
def list(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> TimeSeriesList:
    """List timeseries `gearbox.displacement_x`

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of gearboxes to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        List of Timeseries gearbox.displacement_x.

    Examples:

        List gearbox.displacement_x and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> gearboxes = client.gearbox.displacement_x.list(limit=5)

    """
    filter_ = _create_gearbox_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )
    external_ids = _retrieve_timeseries_external_ids_with_extra_displacement_x(
        self._client, self._view_id, filter_, limit
    )
    if external_ids:
        return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
    else:
        return TimeSeriesList([])

GearboxDisplacementYAPI

Source code in examples/windmill/_api/gearbox_displacement_y.py
class GearboxDisplacementYAPI:
    def __init__(self, client: CogniteClient, view_id: dm.ViewId):
        self._client = client
        self._view_id = view_id

    def __call__(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> GearboxDisplacementYQuery:
        """Query timeseries `gearbox.displacement_y`

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of gearboxes to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query object that can be used to retrieve datapoins for the gearbox.displacement_y timeseries
            selected in this method.

        Examples:

            Retrieve all data for 5 gearbox.displacement_y timeseries:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> gearboxes = client.gearbox.displacement_y(limit=5).retrieve()

        """
        filter_ = _create_gearbox_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )

        return GearboxDisplacementYQuery(
            client=self._client,
            view_id=self._view_id,
            timeseries_limit=limit,
            filter=filter_,
        )

    def list(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> TimeSeriesList:
        """List timeseries `gearbox.displacement_y`

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of gearboxes to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            List of Timeseries gearbox.displacement_y.

        Examples:

            List gearbox.displacement_y and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> gearboxes = client.gearbox.displacement_y.list(limit=5)

        """
        filter_ = _create_gearbox_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )
        external_ids = _retrieve_timeseries_external_ids_with_extra_displacement_y(
            self._client, self._view_id, filter_, limit
        )
        if external_ids:
            return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
        else:
            return TimeSeriesList([])

__call__(external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Query timeseries gearbox.displacement_y

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of gearboxes to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
GearboxDisplacementYQuery

A query object that can be used to retrieve datapoins for the gearbox.displacement_y timeseries

GearboxDisplacementYQuery

selected in this method.

Examples:

Retrieve all data for 5 gearbox.displacement_y timeseries:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> gearboxes = client.gearbox.displacement_y(limit=5).retrieve()
Source code in examples/windmill/_api/gearbox_displacement_y.py
def __call__(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> GearboxDisplacementYQuery:
    """Query timeseries `gearbox.displacement_y`

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of gearboxes to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query object that can be used to retrieve datapoins for the gearbox.displacement_y timeseries
        selected in this method.

    Examples:

        Retrieve all data for 5 gearbox.displacement_y timeseries:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> gearboxes = client.gearbox.displacement_y(limit=5).retrieve()

    """
    filter_ = _create_gearbox_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )

    return GearboxDisplacementYQuery(
        client=self._client,
        view_id=self._view_id,
        timeseries_limit=limit,
        filter=filter_,
    )

list(external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

List timeseries gearbox.displacement_y

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of gearboxes to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
TimeSeriesList

List of Timeseries gearbox.displacement_y.

Examples:

List gearbox.displacement_y and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> gearboxes = client.gearbox.displacement_y.list(limit=5)
Source code in examples/windmill/_api/gearbox_displacement_y.py
def list(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> TimeSeriesList:
    """List timeseries `gearbox.displacement_y`

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of gearboxes to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        List of Timeseries gearbox.displacement_y.

    Examples:

        List gearbox.displacement_y and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> gearboxes = client.gearbox.displacement_y.list(limit=5)

    """
    filter_ = _create_gearbox_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )
    external_ids = _retrieve_timeseries_external_ids_with_extra_displacement_y(
        self._client, self._view_id, filter_, limit
    )
    if external_ids:
        return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
    else:
        return TimeSeriesList([])

GearboxDisplacementZAPI

Source code in examples/windmill/_api/gearbox_displacement_z.py
class GearboxDisplacementZAPI:
    def __init__(self, client: CogniteClient, view_id: dm.ViewId):
        self._client = client
        self._view_id = view_id

    def __call__(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> GearboxDisplacementZQuery:
        """Query timeseries `gearbox.displacement_z`

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of gearboxes to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query object that can be used to retrieve datapoins for the gearbox.displacement_z timeseries
            selected in this method.

        Examples:

            Retrieve all data for 5 gearbox.displacement_z timeseries:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> gearboxes = client.gearbox.displacement_z(limit=5).retrieve()

        """
        filter_ = _create_gearbox_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )

        return GearboxDisplacementZQuery(
            client=self._client,
            view_id=self._view_id,
            timeseries_limit=limit,
            filter=filter_,
        )

    def list(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> TimeSeriesList:
        """List timeseries `gearbox.displacement_z`

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of gearboxes to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            List of Timeseries gearbox.displacement_z.

        Examples:

            List gearbox.displacement_z and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> gearboxes = client.gearbox.displacement_z.list(limit=5)

        """
        filter_ = _create_gearbox_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )
        external_ids = _retrieve_timeseries_external_ids_with_extra_displacement_z(
            self._client, self._view_id, filter_, limit
        )
        if external_ids:
            return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
        else:
            return TimeSeriesList([])

__call__(external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Query timeseries gearbox.displacement_z

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of gearboxes to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
GearboxDisplacementZQuery

A query object that can be used to retrieve datapoins for the gearbox.displacement_z timeseries

GearboxDisplacementZQuery

selected in this method.

Examples:

Retrieve all data for 5 gearbox.displacement_z timeseries:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> gearboxes = client.gearbox.displacement_z(limit=5).retrieve()
Source code in examples/windmill/_api/gearbox_displacement_z.py
def __call__(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> GearboxDisplacementZQuery:
    """Query timeseries `gearbox.displacement_z`

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of gearboxes to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query object that can be used to retrieve datapoins for the gearbox.displacement_z timeseries
        selected in this method.

    Examples:

        Retrieve all data for 5 gearbox.displacement_z timeseries:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> gearboxes = client.gearbox.displacement_z(limit=5).retrieve()

    """
    filter_ = _create_gearbox_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )

    return GearboxDisplacementZQuery(
        client=self._client,
        view_id=self._view_id,
        timeseries_limit=limit,
        filter=filter_,
    )

list(external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

List timeseries gearbox.displacement_z

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of gearboxes to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
TimeSeriesList

List of Timeseries gearbox.displacement_z.

Examples:

List gearbox.displacement_z and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> gearboxes = client.gearbox.displacement_z.list(limit=5)
Source code in examples/windmill/_api/gearbox_displacement_z.py
def list(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> TimeSeriesList:
    """List timeseries `gearbox.displacement_z`

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of gearboxes to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        List of Timeseries gearbox.displacement_z.

    Examples:

        List gearbox.displacement_z and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> gearboxes = client.gearbox.displacement_z.list(limit=5)

    """
    filter_ = _create_gearbox_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )
    external_ids = _retrieve_timeseries_external_ids_with_extra_displacement_z(
        self._client, self._view_id, filter_, limit
    )
    if external_ids:
        return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
    else:
        return TimeSeriesList([])

GearboxQueryAPI

Bases: QueryAPI[T_DomainModelList]

Source code in examples/windmill/_api/gearbox_query.py
class GearboxQueryAPI(QueryAPI[T_DomainModelList]):
    _view_id = dm.ViewId("power-models", "Gearbox", "1")

    def __init__(
        self,
        client: CogniteClient,
        builder: QueryBuilder[T_DomainModelList],
        filter_: dm.filters.Filter | None = None,
        limit: int = DEFAULT_QUERY_LIMIT,
    ):
        super().__init__(client, builder)
        from_ = self._builder.get_from()
        self._builder.append(
            NodeQueryStep(
                name=self._builder.create_name(from_),
                expression=dm.query.NodeResultSetExpression(
                    from_=from_,
                    filter=filter_,
                ),
                result_cls=Gearbox,
                max_retrieve_limit=limit,
            )
        )

    def query(
        self,
    ) -> T_DomainModelList:
        """Execute query and return the result.

        Returns:
            The list of the source nodes of the query.

        """
        return self._query()

query()

Execute query and return the result.

Returns:

Type Description
T_DomainModelList

The list of the source nodes of the query.

Source code in examples/windmill/_api/gearbox_query.py
def query(
    self,
) -> T_DomainModelList:
    """Execute query and return the result.

    Returns:
        The list of the source nodes of the query.

    """
    return self._query()

GeneratorAPI

Bases: NodeAPI[Generator, GeneratorWrite, GeneratorList, GeneratorWriteList]

Source code in examples/windmill/_api/generator.py
class GeneratorAPI(NodeAPI[Generator, GeneratorWrite, GeneratorList, GeneratorWriteList]):
    _view_id = dm.ViewId("power-models", "Generator", "1")
    _properties_by_field = _GENERATOR_PROPERTIES_BY_FIELD
    _class_type = Generator
    _class_list = GeneratorList
    _class_write_list = GeneratorWriteList

    def __init__(self, client: CogniteClient):
        super().__init__(client=client)

        self.generator_speed_controller = GeneratorGeneratorSpeedControllerAPI(client, self._view_id)
        self.generator_speed_controller_reference = GeneratorGeneratorSpeedControllerReferenceAPI(client, self._view_id)

    def __call__(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_QUERY_LIMIT,
        filter: dm.Filter | None = None,
    ) -> GeneratorQueryAPI[GeneratorList]:
        """Query starting at generators.

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of generators to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query API for generators.

        """
        has_data = dm.filters.HasData(views=[self._view_id])
        filter_ = _create_generator_filter(
            self._view_id,
            external_id_prefix,
            space,
            (filter and dm.filters.And(filter, has_data)) or has_data,
        )
        builder = QueryBuilder(GeneratorList)
        return GeneratorQueryAPI(self._client, builder, filter_, limit)

    def apply(
        self,
        generator: GeneratorWrite | Sequence[GeneratorWrite],
        replace: bool = False,
        write_none: bool = False,
    ) -> ResourcesWriteResult:
        """Add or update (upsert) generators.

        Args:
            generator: Generator or sequence of generators to upsert.
            replace (bool): How do we behave when a property value exists? Do we replace all matching and existing values with the supplied values (true)?
                Or should we merge in new values for properties together with the existing values (false)? Note: This setting applies for all nodes or edges specified in the ingestion call.
            write_none (bool): This method, will by default, skip properties that are set to None. However, if you want to set properties to None,
                you can set this parameter to True. Note this only applies to properties that are nullable.
        Returns:
            Created instance(s), i.e., nodes, edges, and time series.

        Examples:

            Create a new generator:

                >>> from windmill import WindmillClient
                >>> from windmill.data_classes import GeneratorWrite
                >>> client = WindmillClient()
                >>> generator = GeneratorWrite(external_id="my_generator", ...)
                >>> result = client.generator.apply(generator)

        """
        warnings.warn(
            "The .apply method is deprecated and will be removed in v1.0. "
            "Please use the .upsert method on the client instead. This means instead of "
            "`my_client.generator.apply(my_items)` please use `my_client.upsert(my_items)`."
            "The motivation is that all apply methods are the same, and having one apply method per API "
            " class encourages users to create items in small batches, which is inefficient."
            "In addition, .upsert method is more descriptive of what the method does.",
            UserWarning,
            stacklevel=2,
        )
        return self._apply(generator, replace, write_none)

    def delete(
        self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
    ) -> dm.InstancesDeleteResult:
        """Delete one or more generator.

        Args:
            external_id: External id of the generator to delete.
            space: The space where all the generator are located.

        Returns:
            The instance(s), i.e., nodes and edges which has been deleted. Empty list if nothing was deleted.

        Examples:

            Delete generator by id:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> client.generator.delete("my_generator")
        """
        warnings.warn(
            "The .delete method is deprecated and will be removed in v1.0. "
            "Please use the .delete method on the client instead. This means instead of "
            "`my_client.generator.delete(my_ids)` please use `my_client.delete(my_ids)`."
            "The motivation is that all delete methods are the same, and having one delete method per API "
            " class encourages users to delete items in small batches, which is inefficient.",
            UserWarning,
            stacklevel=2,
        )
        return self._delete(external_id, space)

    @overload
    def retrieve(self, external_id: str, space: str = DEFAULT_INSTANCE_SPACE) -> Generator | None: ...

    @overload
    def retrieve(self, external_id: SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE) -> GeneratorList: ...

    def retrieve(
        self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
    ) -> Generator | GeneratorList | None:
        """Retrieve one or more generators by id(s).

        Args:
            external_id: External id or list of external ids of the generators.
            space: The space where all the generators are located.

        Returns:
            The requested generators.

        Examples:

            Retrieve generator by id:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> generator = client.generator.retrieve("my_generator")

        """
        return self._retrieve(external_id, space)

    def search(
        self,
        query: str,
        properties: GeneratorTextFields | SequenceNotStr[GeneratorTextFields] | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
        sort_by: GeneratorFields | SequenceNotStr[GeneratorFields] | None = None,
        direction: Literal["ascending", "descending"] = "ascending",
        sort: InstanceSort | list[InstanceSort] | None = None,
    ) -> GeneratorList:
        """Search generators

        Args:
            query: The search query,
            properties: The property to search, if nothing is passed all text fields will be searched.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of generators to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
            sort_by: The property to sort by.
            direction: The direction to sort by, either 'ascending' or 'descending'.
            sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
                This will override the sort_by and direction. This allowos you to sort by multiple fields and
                specify the direction for each field as well as how to handle null values.

        Returns:
            Search results generators matching the query.

        Examples:

           Search for 'my_generator' in all text properties:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> generators = client.generator.search('my_generator')

        """
        filter_ = _create_generator_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )
        return self._search(
            query=query,
            properties=properties,
            filter_=filter_,
            limit=limit,
            sort_by=sort_by,  # type: ignore[arg-type]
            direction=direction,
            sort=sort,
        )

    @overload
    def aggregate(
        self,
        aggregate: Aggregations | dm.aggregations.MetricAggregation,
        group_by: None = None,
        property: GeneratorFields | SequenceNotStr[GeneratorFields] | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> dm.aggregations.AggregatedNumberedValue: ...

    @overload
    def aggregate(
        self,
        aggregate: SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation],
        group_by: None = None,
        property: GeneratorFields | SequenceNotStr[GeneratorFields] | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> list[dm.aggregations.AggregatedNumberedValue]: ...

    @overload
    def aggregate(
        self,
        aggregate: (
            Aggregations
            | dm.aggregations.MetricAggregation
            | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation]
        ),
        group_by: GeneratorFields | SequenceNotStr[GeneratorFields],
        property: GeneratorFields | SequenceNotStr[GeneratorFields] | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> InstanceAggregationResultList: ...

    def aggregate(
        self,
        aggregate: (
            Aggregations
            | dm.aggregations.MetricAggregation
            | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation]
        ),
        group_by: GeneratorFields | SequenceNotStr[GeneratorFields] | None = None,
        property: GeneratorFields | SequenceNotStr[GeneratorFields] | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> (
        dm.aggregations.AggregatedNumberedValue
        | list[dm.aggregations.AggregatedNumberedValue]
        | InstanceAggregationResultList
    ):
        """Aggregate data across generators

        Args:
            aggregate: The aggregation to perform.
            group_by: The property to group by when doing the aggregation.
            property: The property to perform aggregation on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of generators to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            Aggregation results.

        Examples:

            Count generators in space `my_space`:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> result = client.generator.aggregate("count", space="my_space")

        """

        filter_ = _create_generator_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )
        return self._aggregate(
            aggregate=aggregate,
            group_by=group_by,  # type: ignore[arg-type]
            properties=property,  # type: ignore[arg-type]
            query=None,
            search_properties=None,
            limit=limit,
            filter=filter_,
        )

    def histogram(
        self,
        property: GeneratorFields,
        interval: float,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> dm.aggregations.HistogramValue:
        """Produces histograms for generators

        Args:
            property: The property to use as the value in the histogram.
            interval: The interval to use for the histogram bins.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of generators to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            Bucketed histogram results.

        """
        filter_ = _create_generator_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )
        return self._histogram(
            property,
            interval,
            None,
            None,
            limit,
            filter_,
        )

    def query(self) -> GeneratorQuery:
        """Start a query for generators."""
        warnings.warn("The .query is in alpha and is subject to breaking changes without notice.")
        return GeneratorQuery(self._client)

    def list(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
        sort_by: GeneratorFields | Sequence[GeneratorFields] | None = None,
        direction: Literal["ascending", "descending"] = "ascending",
        sort: InstanceSort | list[InstanceSort] | None = None,
    ) -> GeneratorList:
        """List/filter generators

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of generators to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
            sort_by: The property to sort by.
            direction: The direction to sort by, either 'ascending' or 'descending'.
            sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
                This will override the sort_by and direction. This allowos you to sort by multiple fields and
                specify the direction for each field as well as how to handle null values.

        Returns:
            List of requested generators

        Examples:

            List generators and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> generators = client.generator.list(limit=5)

        """
        filter_ = _create_generator_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )

        return self._list(
            limit=limit,
            filter=filter_,
            sort_by=sort_by,  # type: ignore[arg-type]
            direction=direction,
            sort=sort,
        )

__call__(external_id_prefix=None, space=None, limit=DEFAULT_QUERY_LIMIT, filter=None)

Query starting at generators.

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of generators to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_QUERY_LIMIT
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
GeneratorQueryAPI[GeneratorList]

A query API for generators.

Source code in examples/windmill/_api/generator.py
def __call__(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_QUERY_LIMIT,
    filter: dm.Filter | None = None,
) -> GeneratorQueryAPI[GeneratorList]:
    """Query starting at generators.

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of generators to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query API for generators.

    """
    has_data = dm.filters.HasData(views=[self._view_id])
    filter_ = _create_generator_filter(
        self._view_id,
        external_id_prefix,
        space,
        (filter and dm.filters.And(filter, has_data)) or has_data,
    )
    builder = QueryBuilder(GeneratorList)
    return GeneratorQueryAPI(self._client, builder, filter_, limit)

aggregate(aggregate, group_by=None, property=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

aggregate(aggregate: Aggregations | dm.aggregations.MetricAggregation, group_by: None = None, property: GeneratorFields | SequenceNotStr[GeneratorFields] | None = None, external_id_prefix: str | None = None, space: str | list[str] | None = None, limit: int = DEFAULT_LIMIT_READ, filter: dm.Filter | None = None) -> dm.aggregations.AggregatedNumberedValue
aggregate(aggregate: SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation], group_by: None = None, property: GeneratorFields | SequenceNotStr[GeneratorFields] | None = None, external_id_prefix: str | None = None, space: str | list[str] | None = None, limit: int = DEFAULT_LIMIT_READ, filter: dm.Filter | None = None) -> list[dm.aggregations.AggregatedNumberedValue]
aggregate(aggregate: Aggregations | dm.aggregations.MetricAggregation | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation], group_by: GeneratorFields | SequenceNotStr[GeneratorFields], property: GeneratorFields | SequenceNotStr[GeneratorFields] | None = None, external_id_prefix: str | None = None, space: str | list[str] | None = None, limit: int = DEFAULT_LIMIT_READ, filter: dm.Filter | None = None) -> InstanceAggregationResultList

Aggregate data across generators

Parameters:

Name Type Description Default
aggregate Aggregations | MetricAggregation | SequenceNotStr[Aggregations | MetricAggregation]

The aggregation to perform.

required
group_by GeneratorFields | SequenceNotStr[GeneratorFields] | None

The property to group by when doing the aggregation.

None
property GeneratorFields | SequenceNotStr[GeneratorFields] | None

The property to perform aggregation on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of generators to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
AggregatedNumberedValue | list[AggregatedNumberedValue] | InstanceAggregationResultList

Aggregation results.

Examples:

Count generators in space `my_space`:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> result = client.generator.aggregate("count", space="my_space")
Source code in examples/windmill/_api/generator.py
def aggregate(
    self,
    aggregate: (
        Aggregations
        | dm.aggregations.MetricAggregation
        | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation]
    ),
    group_by: GeneratorFields | SequenceNotStr[GeneratorFields] | None = None,
    property: GeneratorFields | SequenceNotStr[GeneratorFields] | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> (
    dm.aggregations.AggregatedNumberedValue
    | list[dm.aggregations.AggregatedNumberedValue]
    | InstanceAggregationResultList
):
    """Aggregate data across generators

    Args:
        aggregate: The aggregation to perform.
        group_by: The property to group by when doing the aggregation.
        property: The property to perform aggregation on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of generators to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        Aggregation results.

    Examples:

        Count generators in space `my_space`:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> result = client.generator.aggregate("count", space="my_space")

    """

    filter_ = _create_generator_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )
    return self._aggregate(
        aggregate=aggregate,
        group_by=group_by,  # type: ignore[arg-type]
        properties=property,  # type: ignore[arg-type]
        query=None,
        search_properties=None,
        limit=limit,
        filter=filter_,
    )

apply(generator, replace=False, write_none=False)

Add or update (upsert) generators.

Parameters:

Name Type Description Default
generator GeneratorWrite | Sequence[GeneratorWrite]

Generator or sequence of generators to upsert.

required
replace bool

How do we behave when a property value exists? Do we replace all matching and existing values with the supplied values (true)? Or should we merge in new values for properties together with the existing values (false)? Note: This setting applies for all nodes or edges specified in the ingestion call.

False
write_none bool

This method, will by default, skip properties that are set to None. However, if you want to set properties to None, you can set this parameter to True. Note this only applies to properties that are nullable.

False

Returns: Created instance(s), i.e., nodes, edges, and time series.

Examples:

Create a new generator:

    >>> from windmill import WindmillClient
    >>> from windmill.data_classes import GeneratorWrite
    >>> client = WindmillClient()
    >>> generator = GeneratorWrite(external_id="my_generator", ...)
    >>> result = client.generator.apply(generator)
Source code in examples/windmill/_api/generator.py
def apply(
    self,
    generator: GeneratorWrite | Sequence[GeneratorWrite],
    replace: bool = False,
    write_none: bool = False,
) -> ResourcesWriteResult:
    """Add or update (upsert) generators.

    Args:
        generator: Generator or sequence of generators to upsert.
        replace (bool): How do we behave when a property value exists? Do we replace all matching and existing values with the supplied values (true)?
            Or should we merge in new values for properties together with the existing values (false)? Note: This setting applies for all nodes or edges specified in the ingestion call.
        write_none (bool): This method, will by default, skip properties that are set to None. However, if you want to set properties to None,
            you can set this parameter to True. Note this only applies to properties that are nullable.
    Returns:
        Created instance(s), i.e., nodes, edges, and time series.

    Examples:

        Create a new generator:

            >>> from windmill import WindmillClient
            >>> from windmill.data_classes import GeneratorWrite
            >>> client = WindmillClient()
            >>> generator = GeneratorWrite(external_id="my_generator", ...)
            >>> result = client.generator.apply(generator)

    """
    warnings.warn(
        "The .apply method is deprecated and will be removed in v1.0. "
        "Please use the .upsert method on the client instead. This means instead of "
        "`my_client.generator.apply(my_items)` please use `my_client.upsert(my_items)`."
        "The motivation is that all apply methods are the same, and having one apply method per API "
        " class encourages users to create items in small batches, which is inefficient."
        "In addition, .upsert method is more descriptive of what the method does.",
        UserWarning,
        stacklevel=2,
    )
    return self._apply(generator, replace, write_none)

delete(external_id, space=DEFAULT_INSTANCE_SPACE)

Delete one or more generator.

Parameters:

Name Type Description Default
external_id str | SequenceNotStr[str]

External id of the generator to delete.

required
space str

The space where all the generator are located.

DEFAULT_INSTANCE_SPACE

Returns:

Type Description
InstancesDeleteResult

The instance(s), i.e., nodes and edges which has been deleted. Empty list if nothing was deleted.

Examples:

Delete generator by id:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> client.generator.delete("my_generator")
Source code in examples/windmill/_api/generator.py
def delete(
    self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
) -> dm.InstancesDeleteResult:
    """Delete one or more generator.

    Args:
        external_id: External id of the generator to delete.
        space: The space where all the generator are located.

    Returns:
        The instance(s), i.e., nodes and edges which has been deleted. Empty list if nothing was deleted.

    Examples:

        Delete generator by id:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> client.generator.delete("my_generator")
    """
    warnings.warn(
        "The .delete method is deprecated and will be removed in v1.0. "
        "Please use the .delete method on the client instead. This means instead of "
        "`my_client.generator.delete(my_ids)` please use `my_client.delete(my_ids)`."
        "The motivation is that all delete methods are the same, and having one delete method per API "
        " class encourages users to delete items in small batches, which is inefficient.",
        UserWarning,
        stacklevel=2,
    )
    return self._delete(external_id, space)

histogram(property, interval, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Produces histograms for generators

Parameters:

Name Type Description Default
property GeneratorFields

The property to use as the value in the histogram.

required
interval float

The interval to use for the histogram bins.

required
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of generators to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
HistogramValue

Bucketed histogram results.

Source code in examples/windmill/_api/generator.py
def histogram(
    self,
    property: GeneratorFields,
    interval: float,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> dm.aggregations.HistogramValue:
    """Produces histograms for generators

    Args:
        property: The property to use as the value in the histogram.
        interval: The interval to use for the histogram bins.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of generators to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        Bucketed histogram results.

    """
    filter_ = _create_generator_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )
    return self._histogram(
        property,
        interval,
        None,
        None,
        limit,
        filter_,
    )

list(external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None, sort_by=None, direction='ascending', sort=None)

List/filter generators

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of generators to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None
sort_by GeneratorFields | Sequence[GeneratorFields] | None

The property to sort by.

None
direction Literal['ascending', 'descending']

The direction to sort by, either 'ascending' or 'descending'.

'ascending'
sort InstanceSort | list[InstanceSort] | None

(Advanced) If sort_by and direction are not sufficient, you can write your own sorting. This will override the sort_by and direction. This allowos you to sort by multiple fields and specify the direction for each field as well as how to handle null values.

None

Returns:

Type Description
GeneratorList

List of requested generators

Examples:

List generators and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> generators = client.generator.list(limit=5)
Source code in examples/windmill/_api/generator.py
def list(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
    sort_by: GeneratorFields | Sequence[GeneratorFields] | None = None,
    direction: Literal["ascending", "descending"] = "ascending",
    sort: InstanceSort | list[InstanceSort] | None = None,
) -> GeneratorList:
    """List/filter generators

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of generators to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
        sort_by: The property to sort by.
        direction: The direction to sort by, either 'ascending' or 'descending'.
        sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
            This will override the sort_by and direction. This allowos you to sort by multiple fields and
            specify the direction for each field as well as how to handle null values.

    Returns:
        List of requested generators

    Examples:

        List generators and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> generators = client.generator.list(limit=5)

    """
    filter_ = _create_generator_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )

    return self._list(
        limit=limit,
        filter=filter_,
        sort_by=sort_by,  # type: ignore[arg-type]
        direction=direction,
        sort=sort,
    )

query()

Start a query for generators.

Source code in examples/windmill/_api/generator.py
def query(self) -> GeneratorQuery:
    """Start a query for generators."""
    warnings.warn("The .query is in alpha and is subject to breaking changes without notice.")
    return GeneratorQuery(self._client)

retrieve(external_id, space=DEFAULT_INSTANCE_SPACE)

retrieve(external_id: str, space: str = DEFAULT_INSTANCE_SPACE) -> Generator | None
retrieve(external_id: SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE) -> GeneratorList

Retrieve one or more generators by id(s).

Parameters:

Name Type Description Default
external_id str | SequenceNotStr[str]

External id or list of external ids of the generators.

required
space str

The space where all the generators are located.

DEFAULT_INSTANCE_SPACE

Returns:

Type Description
Generator | GeneratorList | None

The requested generators.

Examples:

Retrieve generator by id:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> generator = client.generator.retrieve("my_generator")
Source code in examples/windmill/_api/generator.py
def retrieve(
    self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
) -> Generator | GeneratorList | None:
    """Retrieve one or more generators by id(s).

    Args:
        external_id: External id or list of external ids of the generators.
        space: The space where all the generators are located.

    Returns:
        The requested generators.

    Examples:

        Retrieve generator by id:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> generator = client.generator.retrieve("my_generator")

    """
    return self._retrieve(external_id, space)

search(query, properties=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None, sort_by=None, direction='ascending', sort=None)

Search generators

Parameters:

Name Type Description Default
query str

The search query,

required
properties GeneratorTextFields | SequenceNotStr[GeneratorTextFields] | None

The property to search, if nothing is passed all text fields will be searched.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of generators to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None
sort_by GeneratorFields | SequenceNotStr[GeneratorFields] | None

The property to sort by.

None
direction Literal['ascending', 'descending']

The direction to sort by, either 'ascending' or 'descending'.

'ascending'
sort InstanceSort | list[InstanceSort] | None

(Advanced) If sort_by and direction are not sufficient, you can write your own sorting. This will override the sort_by and direction. This allowos you to sort by multiple fields and specify the direction for each field as well as how to handle null values.

None

Returns:

Type Description
GeneratorList

Search results generators matching the query.

Examples:

Search for 'my_generator' in all text properties:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> generators = client.generator.search('my_generator')
Source code in examples/windmill/_api/generator.py
def search(
    self,
    query: str,
    properties: GeneratorTextFields | SequenceNotStr[GeneratorTextFields] | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
    sort_by: GeneratorFields | SequenceNotStr[GeneratorFields] | None = None,
    direction: Literal["ascending", "descending"] = "ascending",
    sort: InstanceSort | list[InstanceSort] | None = None,
) -> GeneratorList:
    """Search generators

    Args:
        query: The search query,
        properties: The property to search, if nothing is passed all text fields will be searched.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of generators to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
        sort_by: The property to sort by.
        direction: The direction to sort by, either 'ascending' or 'descending'.
        sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
            This will override the sort_by and direction. This allowos you to sort by multiple fields and
            specify the direction for each field as well as how to handle null values.

    Returns:
        Search results generators matching the query.

    Examples:

       Search for 'my_generator' in all text properties:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> generators = client.generator.search('my_generator')

    """
    filter_ = _create_generator_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )
    return self._search(
        query=query,
        properties=properties,
        filter_=filter_,
        limit=limit,
        sort_by=sort_by,  # type: ignore[arg-type]
        direction=direction,
        sort=sort,
    )

GeneratorGeneratorSpeedControllerAPI

Source code in examples/windmill/_api/generator_generator_speed_controller.py
class GeneratorGeneratorSpeedControllerAPI:
    def __init__(self, client: CogniteClient, view_id: dm.ViewId):
        self._client = client
        self._view_id = view_id

    def __call__(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> GeneratorGeneratorSpeedControllerQuery:
        """Query timeseries `generator.generator_speed_controller`

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of generators to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query object that can be used to retrieve datapoins for the generator.generator_speed_controller timeseries
            selected in this method.

        Examples:

            Retrieve all data for 5 generator.generator_speed_controller timeseries:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> generators = client.generator.generator_speed_controller(limit=5).retrieve()

        """
        filter_ = _create_generator_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )

        return GeneratorGeneratorSpeedControllerQuery(
            client=self._client,
            view_id=self._view_id,
            timeseries_limit=limit,
            filter=filter_,
        )

    def list(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> TimeSeriesList:
        """List timeseries `generator.generator_speed_controller`

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of generators to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            List of Timeseries generator.generator_speed_controller.

        Examples:

            List generator.generator_speed_controller and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> generators = client.generator.generator_speed_controller.list(limit=5)

        """
        filter_ = _create_generator_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )
        external_ids = _retrieve_timeseries_external_ids_with_extra_generator_speed_controller(
            self._client, self._view_id, filter_, limit
        )
        if external_ids:
            return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
        else:
            return TimeSeriesList([])

__call__(external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Query timeseries generator.generator_speed_controller

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of generators to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
GeneratorGeneratorSpeedControllerQuery

A query object that can be used to retrieve datapoins for the generator.generator_speed_controller timeseries

GeneratorGeneratorSpeedControllerQuery

selected in this method.

Examples:

Retrieve all data for 5 generator.generator_speed_controller timeseries:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> generators = client.generator.generator_speed_controller(limit=5).retrieve()
Source code in examples/windmill/_api/generator_generator_speed_controller.py
def __call__(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> GeneratorGeneratorSpeedControllerQuery:
    """Query timeseries `generator.generator_speed_controller`

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of generators to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query object that can be used to retrieve datapoins for the generator.generator_speed_controller timeseries
        selected in this method.

    Examples:

        Retrieve all data for 5 generator.generator_speed_controller timeseries:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> generators = client.generator.generator_speed_controller(limit=5).retrieve()

    """
    filter_ = _create_generator_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )

    return GeneratorGeneratorSpeedControllerQuery(
        client=self._client,
        view_id=self._view_id,
        timeseries_limit=limit,
        filter=filter_,
    )

list(external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

List timeseries generator.generator_speed_controller

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of generators to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
TimeSeriesList

List of Timeseries generator.generator_speed_controller.

Examples:

List generator.generator_speed_controller and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> generators = client.generator.generator_speed_controller.list(limit=5)
Source code in examples/windmill/_api/generator_generator_speed_controller.py
def list(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> TimeSeriesList:
    """List timeseries `generator.generator_speed_controller`

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of generators to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        List of Timeseries generator.generator_speed_controller.

    Examples:

        List generator.generator_speed_controller and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> generators = client.generator.generator_speed_controller.list(limit=5)

    """
    filter_ = _create_generator_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )
    external_ids = _retrieve_timeseries_external_ids_with_extra_generator_speed_controller(
        self._client, self._view_id, filter_, limit
    )
    if external_ids:
        return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
    else:
        return TimeSeriesList([])

GeneratorGeneratorSpeedControllerReferenceAPI

Source code in examples/windmill/_api/generator_generator_speed_controller_reference.py
class GeneratorGeneratorSpeedControllerReferenceAPI:
    def __init__(self, client: CogniteClient, view_id: dm.ViewId):
        self._client = client
        self._view_id = view_id

    def __call__(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> GeneratorGeneratorSpeedControllerReferenceQuery:
        """Query timeseries `generator.generator_speed_controller_reference`

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of generators to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query object that can be used to retrieve datapoins for the generator.generator_speed_controller_reference timeseries
            selected in this method.

        Examples:

            Retrieve all data for 5 generator.generator_speed_controller_reference timeseries:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> generators = client.generator.generator_speed_controller_reference(limit=5).retrieve()

        """
        filter_ = _create_generator_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )

        return GeneratorGeneratorSpeedControllerReferenceQuery(
            client=self._client,
            view_id=self._view_id,
            timeseries_limit=limit,
            filter=filter_,
        )

    def list(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> TimeSeriesList:
        """List timeseries `generator.generator_speed_controller_reference`

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of generators to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            List of Timeseries generator.generator_speed_controller_reference.

        Examples:

            List generator.generator_speed_controller_reference and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> generators = client.generator.generator_speed_controller_reference.list(limit=5)

        """
        filter_ = _create_generator_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )
        external_ids = _retrieve_timeseries_external_ids_with_extra_generator_speed_controller_reference(
            self._client, self._view_id, filter_, limit
        )
        if external_ids:
            return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
        else:
            return TimeSeriesList([])

__call__(external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Query timeseries generator.generator_speed_controller_reference

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of generators to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
GeneratorGeneratorSpeedControllerReferenceQuery

A query object that can be used to retrieve datapoins for the generator.generator_speed_controller_reference timeseries

GeneratorGeneratorSpeedControllerReferenceQuery

selected in this method.

Examples:

Retrieve all data for 5 generator.generator_speed_controller_reference timeseries:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> generators = client.generator.generator_speed_controller_reference(limit=5).retrieve()
Source code in examples/windmill/_api/generator_generator_speed_controller_reference.py
def __call__(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> GeneratorGeneratorSpeedControllerReferenceQuery:
    """Query timeseries `generator.generator_speed_controller_reference`

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of generators to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query object that can be used to retrieve datapoins for the generator.generator_speed_controller_reference timeseries
        selected in this method.

    Examples:

        Retrieve all data for 5 generator.generator_speed_controller_reference timeseries:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> generators = client.generator.generator_speed_controller_reference(limit=5).retrieve()

    """
    filter_ = _create_generator_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )

    return GeneratorGeneratorSpeedControllerReferenceQuery(
        client=self._client,
        view_id=self._view_id,
        timeseries_limit=limit,
        filter=filter_,
    )

list(external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

List timeseries generator.generator_speed_controller_reference

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of generators to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
TimeSeriesList

List of Timeseries generator.generator_speed_controller_reference.

Examples:

List generator.generator_speed_controller_reference and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> generators = client.generator.generator_speed_controller_reference.list(limit=5)
Source code in examples/windmill/_api/generator_generator_speed_controller_reference.py
def list(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> TimeSeriesList:
    """List timeseries `generator.generator_speed_controller_reference`

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of generators to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        List of Timeseries generator.generator_speed_controller_reference.

    Examples:

        List generator.generator_speed_controller_reference and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> generators = client.generator.generator_speed_controller_reference.list(limit=5)

    """
    filter_ = _create_generator_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )
    external_ids = _retrieve_timeseries_external_ids_with_extra_generator_speed_controller_reference(
        self._client, self._view_id, filter_, limit
    )
    if external_ids:
        return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
    else:
        return TimeSeriesList([])

GeneratorQueryAPI

Bases: QueryAPI[T_DomainModelList]

Source code in examples/windmill/_api/generator_query.py
class GeneratorQueryAPI(QueryAPI[T_DomainModelList]):
    _view_id = dm.ViewId("power-models", "Generator", "1")

    def __init__(
        self,
        client: CogniteClient,
        builder: QueryBuilder[T_DomainModelList],
        filter_: dm.filters.Filter | None = None,
        limit: int = DEFAULT_QUERY_LIMIT,
    ):
        super().__init__(client, builder)
        from_ = self._builder.get_from()
        self._builder.append(
            NodeQueryStep(
                name=self._builder.create_name(from_),
                expression=dm.query.NodeResultSetExpression(
                    from_=from_,
                    filter=filter_,
                ),
                result_cls=Generator,
                max_retrieve_limit=limit,
            )
        )

    def query(
        self,
    ) -> T_DomainModelList:
        """Execute query and return the result.

        Returns:
            The list of the source nodes of the query.

        """
        return self._query()

query()

Execute query and return the result.

Returns:

Type Description
T_DomainModelList

The list of the source nodes of the query.

Source code in examples/windmill/_api/generator_query.py
def query(
    self,
) -> T_DomainModelList:
    """Execute query and return the result.

    Returns:
        The list of the source nodes of the query.

    """
    return self._query()

HighSpeedShaftAPI

Bases: NodeAPI[HighSpeedShaft, HighSpeedShaftWrite, HighSpeedShaftList, HighSpeedShaftWriteList]

Source code in examples/windmill/_api/high_speed_shaft.py
class HighSpeedShaftAPI(NodeAPI[HighSpeedShaft, HighSpeedShaftWrite, HighSpeedShaftList, HighSpeedShaftWriteList]):
    _view_id = dm.ViewId("power-models", "HighSpeedShaft", "1")
    _properties_by_field = _HIGHSPEEDSHAFT_PROPERTIES_BY_FIELD
    _class_type = HighSpeedShaft
    _class_list = HighSpeedShaftList
    _class_write_list = HighSpeedShaftWriteList

    def __init__(self, client: CogniteClient):
        super().__init__(client=client)

        self.bending_moment_y = HighSpeedShaftBendingMomentYAPI(client, self._view_id)
        self.bending_monent_x = HighSpeedShaftBendingMonentXAPI(client, self._view_id)
        self.torque = HighSpeedShaftTorqueAPI(client, self._view_id)

    def __call__(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_QUERY_LIMIT,
        filter: dm.Filter | None = None,
    ) -> HighSpeedShaftQueryAPI[HighSpeedShaftList]:
        """Query starting at high speed shafts.

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of high speed shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query API for high speed shafts.

        """
        has_data = dm.filters.HasData(views=[self._view_id])
        filter_ = _create_high_speed_shaft_filter(
            self._view_id,
            external_id_prefix,
            space,
            (filter and dm.filters.And(filter, has_data)) or has_data,
        )
        builder = QueryBuilder(HighSpeedShaftList)
        return HighSpeedShaftQueryAPI(self._client, builder, filter_, limit)

    def apply(
        self,
        high_speed_shaft: HighSpeedShaftWrite | Sequence[HighSpeedShaftWrite],
        replace: bool = False,
        write_none: bool = False,
    ) -> ResourcesWriteResult:
        """Add or update (upsert) high speed shafts.

        Args:
            high_speed_shaft: High speed shaft or sequence of high speed shafts to upsert.
            replace (bool): How do we behave when a property value exists? Do we replace all matching and existing values with the supplied values (true)?
                Or should we merge in new values for properties together with the existing values (false)? Note: This setting applies for all nodes or edges specified in the ingestion call.
            write_none (bool): This method, will by default, skip properties that are set to None. However, if you want to set properties to None,
                you can set this parameter to True. Note this only applies to properties that are nullable.
        Returns:
            Created instance(s), i.e., nodes, edges, and time series.

        Examples:

            Create a new high_speed_shaft:

                >>> from windmill import WindmillClient
                >>> from windmill.data_classes import HighSpeedShaftWrite
                >>> client = WindmillClient()
                >>> high_speed_shaft = HighSpeedShaftWrite(external_id="my_high_speed_shaft", ...)
                >>> result = client.high_speed_shaft.apply(high_speed_shaft)

        """
        warnings.warn(
            "The .apply method is deprecated and will be removed in v1.0. "
            "Please use the .upsert method on the client instead. This means instead of "
            "`my_client.high_speed_shaft.apply(my_items)` please use `my_client.upsert(my_items)`."
            "The motivation is that all apply methods are the same, and having one apply method per API "
            " class encourages users to create items in small batches, which is inefficient."
            "In addition, .upsert method is more descriptive of what the method does.",
            UserWarning,
            stacklevel=2,
        )
        return self._apply(high_speed_shaft, replace, write_none)

    def delete(
        self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
    ) -> dm.InstancesDeleteResult:
        """Delete one or more high speed shaft.

        Args:
            external_id: External id of the high speed shaft to delete.
            space: The space where all the high speed shaft are located.

        Returns:
            The instance(s), i.e., nodes and edges which has been deleted. Empty list if nothing was deleted.

        Examples:

            Delete high_speed_shaft by id:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> client.high_speed_shaft.delete("my_high_speed_shaft")
        """
        warnings.warn(
            "The .delete method is deprecated and will be removed in v1.0. "
            "Please use the .delete method on the client instead. This means instead of "
            "`my_client.high_speed_shaft.delete(my_ids)` please use `my_client.delete(my_ids)`."
            "The motivation is that all delete methods are the same, and having one delete method per API "
            " class encourages users to delete items in small batches, which is inefficient.",
            UserWarning,
            stacklevel=2,
        )
        return self._delete(external_id, space)

    @overload
    def retrieve(self, external_id: str, space: str = DEFAULT_INSTANCE_SPACE) -> HighSpeedShaft | None: ...

    @overload
    def retrieve(self, external_id: SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE) -> HighSpeedShaftList: ...

    def retrieve(
        self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
    ) -> HighSpeedShaft | HighSpeedShaftList | None:
        """Retrieve one or more high speed shafts by id(s).

        Args:
            external_id: External id or list of external ids of the high speed shafts.
            space: The space where all the high speed shafts are located.

        Returns:
            The requested high speed shafts.

        Examples:

            Retrieve high_speed_shaft by id:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> high_speed_shaft = client.high_speed_shaft.retrieve("my_high_speed_shaft")

        """
        return self._retrieve(external_id, space)

    def search(
        self,
        query: str,
        properties: HighSpeedShaftTextFields | SequenceNotStr[HighSpeedShaftTextFields] | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
        sort_by: HighSpeedShaftFields | SequenceNotStr[HighSpeedShaftFields] | None = None,
        direction: Literal["ascending", "descending"] = "ascending",
        sort: InstanceSort | list[InstanceSort] | None = None,
    ) -> HighSpeedShaftList:
        """Search high speed shafts

        Args:
            query: The search query,
            properties: The property to search, if nothing is passed all text fields will be searched.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of high speed shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
            sort_by: The property to sort by.
            direction: The direction to sort by, either 'ascending' or 'descending'.
            sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
                This will override the sort_by and direction. This allowos you to sort by multiple fields and
                specify the direction for each field as well as how to handle null values.

        Returns:
            Search results high speed shafts matching the query.

        Examples:

           Search for 'my_high_speed_shaft' in all text properties:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> high_speed_shafts = client.high_speed_shaft.search('my_high_speed_shaft')

        """
        filter_ = _create_high_speed_shaft_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )
        return self._search(
            query=query,
            properties=properties,
            filter_=filter_,
            limit=limit,
            sort_by=sort_by,  # type: ignore[arg-type]
            direction=direction,
            sort=sort,
        )

    @overload
    def aggregate(
        self,
        aggregate: Aggregations | dm.aggregations.MetricAggregation,
        group_by: None = None,
        property: HighSpeedShaftFields | SequenceNotStr[HighSpeedShaftFields] | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> dm.aggregations.AggregatedNumberedValue: ...

    @overload
    def aggregate(
        self,
        aggregate: SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation],
        group_by: None = None,
        property: HighSpeedShaftFields | SequenceNotStr[HighSpeedShaftFields] | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> list[dm.aggregations.AggregatedNumberedValue]: ...

    @overload
    def aggregate(
        self,
        aggregate: (
            Aggregations
            | dm.aggregations.MetricAggregation
            | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation]
        ),
        group_by: HighSpeedShaftFields | SequenceNotStr[HighSpeedShaftFields],
        property: HighSpeedShaftFields | SequenceNotStr[HighSpeedShaftFields] | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> InstanceAggregationResultList: ...

    def aggregate(
        self,
        aggregate: (
            Aggregations
            | dm.aggregations.MetricAggregation
            | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation]
        ),
        group_by: HighSpeedShaftFields | SequenceNotStr[HighSpeedShaftFields] | None = None,
        property: HighSpeedShaftFields | SequenceNotStr[HighSpeedShaftFields] | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> (
        dm.aggregations.AggregatedNumberedValue
        | list[dm.aggregations.AggregatedNumberedValue]
        | InstanceAggregationResultList
    ):
        """Aggregate data across high speed shafts

        Args:
            aggregate: The aggregation to perform.
            group_by: The property to group by when doing the aggregation.
            property: The property to perform aggregation on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of high speed shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            Aggregation results.

        Examples:

            Count high speed shafts in space `my_space`:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> result = client.high_speed_shaft.aggregate("count", space="my_space")

        """

        filter_ = _create_high_speed_shaft_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )
        return self._aggregate(
            aggregate=aggregate,
            group_by=group_by,  # type: ignore[arg-type]
            properties=property,  # type: ignore[arg-type]
            query=None,
            search_properties=None,
            limit=limit,
            filter=filter_,
        )

    def histogram(
        self,
        property: HighSpeedShaftFields,
        interval: float,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> dm.aggregations.HistogramValue:
        """Produces histograms for high speed shafts

        Args:
            property: The property to use as the value in the histogram.
            interval: The interval to use for the histogram bins.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of high speed shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            Bucketed histogram results.

        """
        filter_ = _create_high_speed_shaft_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )
        return self._histogram(
            property,
            interval,
            None,
            None,
            limit,
            filter_,
        )

    def query(self) -> HighSpeedShaftQuery:
        """Start a query for high speed shafts."""
        warnings.warn("The .query is in alpha and is subject to breaking changes without notice.")
        return HighSpeedShaftQuery(self._client)

    def list(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
        sort_by: HighSpeedShaftFields | Sequence[HighSpeedShaftFields] | None = None,
        direction: Literal["ascending", "descending"] = "ascending",
        sort: InstanceSort | list[InstanceSort] | None = None,
    ) -> HighSpeedShaftList:
        """List/filter high speed shafts

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of high speed shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
            sort_by: The property to sort by.
            direction: The direction to sort by, either 'ascending' or 'descending'.
            sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
                This will override the sort_by and direction. This allowos you to sort by multiple fields and
                specify the direction for each field as well as how to handle null values.

        Returns:
            List of requested high speed shafts

        Examples:

            List high speed shafts and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> high_speed_shafts = client.high_speed_shaft.list(limit=5)

        """
        filter_ = _create_high_speed_shaft_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )

        return self._list(
            limit=limit,
            filter=filter_,
            sort_by=sort_by,  # type: ignore[arg-type]
            direction=direction,
            sort=sort,
        )

__call__(external_id_prefix=None, space=None, limit=DEFAULT_QUERY_LIMIT, filter=None)

Query starting at high speed shafts.

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of high speed shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_QUERY_LIMIT
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
HighSpeedShaftQueryAPI[HighSpeedShaftList]

A query API for high speed shafts.

Source code in examples/windmill/_api/high_speed_shaft.py
def __call__(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_QUERY_LIMIT,
    filter: dm.Filter | None = None,
) -> HighSpeedShaftQueryAPI[HighSpeedShaftList]:
    """Query starting at high speed shafts.

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of high speed shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query API for high speed shafts.

    """
    has_data = dm.filters.HasData(views=[self._view_id])
    filter_ = _create_high_speed_shaft_filter(
        self._view_id,
        external_id_prefix,
        space,
        (filter and dm.filters.And(filter, has_data)) or has_data,
    )
    builder = QueryBuilder(HighSpeedShaftList)
    return HighSpeedShaftQueryAPI(self._client, builder, filter_, limit)

aggregate(aggregate, group_by=None, property=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

aggregate(aggregate: Aggregations | dm.aggregations.MetricAggregation, group_by: None = None, property: HighSpeedShaftFields | SequenceNotStr[HighSpeedShaftFields] | None = None, external_id_prefix: str | None = None, space: str | list[str] | None = None, limit: int = DEFAULT_LIMIT_READ, filter: dm.Filter | None = None) -> dm.aggregations.AggregatedNumberedValue
aggregate(aggregate: SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation], group_by: None = None, property: HighSpeedShaftFields | SequenceNotStr[HighSpeedShaftFields] | None = None, external_id_prefix: str | None = None, space: str | list[str] | None = None, limit: int = DEFAULT_LIMIT_READ, filter: dm.Filter | None = None) -> list[dm.aggregations.AggregatedNumberedValue]
aggregate(aggregate: Aggregations | dm.aggregations.MetricAggregation | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation], group_by: HighSpeedShaftFields | SequenceNotStr[HighSpeedShaftFields], property: HighSpeedShaftFields | SequenceNotStr[HighSpeedShaftFields] | None = None, external_id_prefix: str | None = None, space: str | list[str] | None = None, limit: int = DEFAULT_LIMIT_READ, filter: dm.Filter | None = None) -> InstanceAggregationResultList

Aggregate data across high speed shafts

Parameters:

Name Type Description Default
aggregate Aggregations | MetricAggregation | SequenceNotStr[Aggregations | MetricAggregation]

The aggregation to perform.

required
group_by HighSpeedShaftFields | SequenceNotStr[HighSpeedShaftFields] | None

The property to group by when doing the aggregation.

None
property HighSpeedShaftFields | SequenceNotStr[HighSpeedShaftFields] | None

The property to perform aggregation on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of high speed shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
AggregatedNumberedValue | list[AggregatedNumberedValue] | InstanceAggregationResultList

Aggregation results.

Examples:

Count high speed shafts in space `my_space`:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> result = client.high_speed_shaft.aggregate("count", space="my_space")
Source code in examples/windmill/_api/high_speed_shaft.py
def aggregate(
    self,
    aggregate: (
        Aggregations
        | dm.aggregations.MetricAggregation
        | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation]
    ),
    group_by: HighSpeedShaftFields | SequenceNotStr[HighSpeedShaftFields] | None = None,
    property: HighSpeedShaftFields | SequenceNotStr[HighSpeedShaftFields] | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> (
    dm.aggregations.AggregatedNumberedValue
    | list[dm.aggregations.AggregatedNumberedValue]
    | InstanceAggregationResultList
):
    """Aggregate data across high speed shafts

    Args:
        aggregate: The aggregation to perform.
        group_by: The property to group by when doing the aggregation.
        property: The property to perform aggregation on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of high speed shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        Aggregation results.

    Examples:

        Count high speed shafts in space `my_space`:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> result = client.high_speed_shaft.aggregate("count", space="my_space")

    """

    filter_ = _create_high_speed_shaft_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )
    return self._aggregate(
        aggregate=aggregate,
        group_by=group_by,  # type: ignore[arg-type]
        properties=property,  # type: ignore[arg-type]
        query=None,
        search_properties=None,
        limit=limit,
        filter=filter_,
    )

apply(high_speed_shaft, replace=False, write_none=False)

Add or update (upsert) high speed shafts.

Parameters:

Name Type Description Default
high_speed_shaft HighSpeedShaftWrite | Sequence[HighSpeedShaftWrite]

High speed shaft or sequence of high speed shafts to upsert.

required
replace bool

How do we behave when a property value exists? Do we replace all matching and existing values with the supplied values (true)? Or should we merge in new values for properties together with the existing values (false)? Note: This setting applies for all nodes or edges specified in the ingestion call.

False
write_none bool

This method, will by default, skip properties that are set to None. However, if you want to set properties to None, you can set this parameter to True. Note this only applies to properties that are nullable.

False

Returns: Created instance(s), i.e., nodes, edges, and time series.

Examples:

Create a new high_speed_shaft:

    >>> from windmill import WindmillClient
    >>> from windmill.data_classes import HighSpeedShaftWrite
    >>> client = WindmillClient()
    >>> high_speed_shaft = HighSpeedShaftWrite(external_id="my_high_speed_shaft", ...)
    >>> result = client.high_speed_shaft.apply(high_speed_shaft)
Source code in examples/windmill/_api/high_speed_shaft.py
def apply(
    self,
    high_speed_shaft: HighSpeedShaftWrite | Sequence[HighSpeedShaftWrite],
    replace: bool = False,
    write_none: bool = False,
) -> ResourcesWriteResult:
    """Add or update (upsert) high speed shafts.

    Args:
        high_speed_shaft: High speed shaft or sequence of high speed shafts to upsert.
        replace (bool): How do we behave when a property value exists? Do we replace all matching and existing values with the supplied values (true)?
            Or should we merge in new values for properties together with the existing values (false)? Note: This setting applies for all nodes or edges specified in the ingestion call.
        write_none (bool): This method, will by default, skip properties that are set to None. However, if you want to set properties to None,
            you can set this parameter to True. Note this only applies to properties that are nullable.
    Returns:
        Created instance(s), i.e., nodes, edges, and time series.

    Examples:

        Create a new high_speed_shaft:

            >>> from windmill import WindmillClient
            >>> from windmill.data_classes import HighSpeedShaftWrite
            >>> client = WindmillClient()
            >>> high_speed_shaft = HighSpeedShaftWrite(external_id="my_high_speed_shaft", ...)
            >>> result = client.high_speed_shaft.apply(high_speed_shaft)

    """
    warnings.warn(
        "The .apply method is deprecated and will be removed in v1.0. "
        "Please use the .upsert method on the client instead. This means instead of "
        "`my_client.high_speed_shaft.apply(my_items)` please use `my_client.upsert(my_items)`."
        "The motivation is that all apply methods are the same, and having one apply method per API "
        " class encourages users to create items in small batches, which is inefficient."
        "In addition, .upsert method is more descriptive of what the method does.",
        UserWarning,
        stacklevel=2,
    )
    return self._apply(high_speed_shaft, replace, write_none)

delete(external_id, space=DEFAULT_INSTANCE_SPACE)

Delete one or more high speed shaft.

Parameters:

Name Type Description Default
external_id str | SequenceNotStr[str]

External id of the high speed shaft to delete.

required
space str

The space where all the high speed shaft are located.

DEFAULT_INSTANCE_SPACE

Returns:

Type Description
InstancesDeleteResult

The instance(s), i.e., nodes and edges which has been deleted. Empty list if nothing was deleted.

Examples:

Delete high_speed_shaft by id:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> client.high_speed_shaft.delete("my_high_speed_shaft")
Source code in examples/windmill/_api/high_speed_shaft.py
def delete(
    self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
) -> dm.InstancesDeleteResult:
    """Delete one or more high speed shaft.

    Args:
        external_id: External id of the high speed shaft to delete.
        space: The space where all the high speed shaft are located.

    Returns:
        The instance(s), i.e., nodes and edges which has been deleted. Empty list if nothing was deleted.

    Examples:

        Delete high_speed_shaft by id:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> client.high_speed_shaft.delete("my_high_speed_shaft")
    """
    warnings.warn(
        "The .delete method is deprecated and will be removed in v1.0. "
        "Please use the .delete method on the client instead. This means instead of "
        "`my_client.high_speed_shaft.delete(my_ids)` please use `my_client.delete(my_ids)`."
        "The motivation is that all delete methods are the same, and having one delete method per API "
        " class encourages users to delete items in small batches, which is inefficient.",
        UserWarning,
        stacklevel=2,
    )
    return self._delete(external_id, space)

histogram(property, interval, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Produces histograms for high speed shafts

Parameters:

Name Type Description Default
property HighSpeedShaftFields

The property to use as the value in the histogram.

required
interval float

The interval to use for the histogram bins.

required
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of high speed shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
HistogramValue

Bucketed histogram results.

Source code in examples/windmill/_api/high_speed_shaft.py
def histogram(
    self,
    property: HighSpeedShaftFields,
    interval: float,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> dm.aggregations.HistogramValue:
    """Produces histograms for high speed shafts

    Args:
        property: The property to use as the value in the histogram.
        interval: The interval to use for the histogram bins.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of high speed shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        Bucketed histogram results.

    """
    filter_ = _create_high_speed_shaft_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )
    return self._histogram(
        property,
        interval,
        None,
        None,
        limit,
        filter_,
    )

list(external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None, sort_by=None, direction='ascending', sort=None)

List/filter high speed shafts

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of high speed shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None
sort_by HighSpeedShaftFields | Sequence[HighSpeedShaftFields] | None

The property to sort by.

None
direction Literal['ascending', 'descending']

The direction to sort by, either 'ascending' or 'descending'.

'ascending'
sort InstanceSort | list[InstanceSort] | None

(Advanced) If sort_by and direction are not sufficient, you can write your own sorting. This will override the sort_by and direction. This allowos you to sort by multiple fields and specify the direction for each field as well as how to handle null values.

None

Returns:

Type Description
HighSpeedShaftList

List of requested high speed shafts

Examples:

List high speed shafts and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> high_speed_shafts = client.high_speed_shaft.list(limit=5)
Source code in examples/windmill/_api/high_speed_shaft.py
def list(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
    sort_by: HighSpeedShaftFields | Sequence[HighSpeedShaftFields] | None = None,
    direction: Literal["ascending", "descending"] = "ascending",
    sort: InstanceSort | list[InstanceSort] | None = None,
) -> HighSpeedShaftList:
    """List/filter high speed shafts

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of high speed shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
        sort_by: The property to sort by.
        direction: The direction to sort by, either 'ascending' or 'descending'.
        sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
            This will override the sort_by and direction. This allowos you to sort by multiple fields and
            specify the direction for each field as well as how to handle null values.

    Returns:
        List of requested high speed shafts

    Examples:

        List high speed shafts and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> high_speed_shafts = client.high_speed_shaft.list(limit=5)

    """
    filter_ = _create_high_speed_shaft_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )

    return self._list(
        limit=limit,
        filter=filter_,
        sort_by=sort_by,  # type: ignore[arg-type]
        direction=direction,
        sort=sort,
    )

query()

Start a query for high speed shafts.

Source code in examples/windmill/_api/high_speed_shaft.py
def query(self) -> HighSpeedShaftQuery:
    """Start a query for high speed shafts."""
    warnings.warn("The .query is in alpha and is subject to breaking changes without notice.")
    return HighSpeedShaftQuery(self._client)

retrieve(external_id, space=DEFAULT_INSTANCE_SPACE)

retrieve(external_id: str, space: str = DEFAULT_INSTANCE_SPACE) -> HighSpeedShaft | None
retrieve(external_id: SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE) -> HighSpeedShaftList

Retrieve one or more high speed shafts by id(s).

Parameters:

Name Type Description Default
external_id str | SequenceNotStr[str]

External id or list of external ids of the high speed shafts.

required
space str

The space where all the high speed shafts are located.

DEFAULT_INSTANCE_SPACE

Returns:

Type Description
HighSpeedShaft | HighSpeedShaftList | None

The requested high speed shafts.

Examples:

Retrieve high_speed_shaft by id:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> high_speed_shaft = client.high_speed_shaft.retrieve("my_high_speed_shaft")
Source code in examples/windmill/_api/high_speed_shaft.py
def retrieve(
    self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
) -> HighSpeedShaft | HighSpeedShaftList | None:
    """Retrieve one or more high speed shafts by id(s).

    Args:
        external_id: External id or list of external ids of the high speed shafts.
        space: The space where all the high speed shafts are located.

    Returns:
        The requested high speed shafts.

    Examples:

        Retrieve high_speed_shaft by id:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> high_speed_shaft = client.high_speed_shaft.retrieve("my_high_speed_shaft")

    """
    return self._retrieve(external_id, space)

search(query, properties=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None, sort_by=None, direction='ascending', sort=None)

Search high speed shafts

Parameters:

Name Type Description Default
query str

The search query,

required
properties HighSpeedShaftTextFields | SequenceNotStr[HighSpeedShaftTextFields] | None

The property to search, if nothing is passed all text fields will be searched.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of high speed shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None
sort_by HighSpeedShaftFields | SequenceNotStr[HighSpeedShaftFields] | None

The property to sort by.

None
direction Literal['ascending', 'descending']

The direction to sort by, either 'ascending' or 'descending'.

'ascending'
sort InstanceSort | list[InstanceSort] | None

(Advanced) If sort_by and direction are not sufficient, you can write your own sorting. This will override the sort_by and direction. This allowos you to sort by multiple fields and specify the direction for each field as well as how to handle null values.

None

Returns:

Type Description
HighSpeedShaftList

Search results high speed shafts matching the query.

Examples:

Search for 'my_high_speed_shaft' in all text properties:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> high_speed_shafts = client.high_speed_shaft.search('my_high_speed_shaft')
Source code in examples/windmill/_api/high_speed_shaft.py
def search(
    self,
    query: str,
    properties: HighSpeedShaftTextFields | SequenceNotStr[HighSpeedShaftTextFields] | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
    sort_by: HighSpeedShaftFields | SequenceNotStr[HighSpeedShaftFields] | None = None,
    direction: Literal["ascending", "descending"] = "ascending",
    sort: InstanceSort | list[InstanceSort] | None = None,
) -> HighSpeedShaftList:
    """Search high speed shafts

    Args:
        query: The search query,
        properties: The property to search, if nothing is passed all text fields will be searched.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of high speed shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
        sort_by: The property to sort by.
        direction: The direction to sort by, either 'ascending' or 'descending'.
        sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
            This will override the sort_by and direction. This allowos you to sort by multiple fields and
            specify the direction for each field as well as how to handle null values.

    Returns:
        Search results high speed shafts matching the query.

    Examples:

       Search for 'my_high_speed_shaft' in all text properties:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> high_speed_shafts = client.high_speed_shaft.search('my_high_speed_shaft')

    """
    filter_ = _create_high_speed_shaft_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )
    return self._search(
        query=query,
        properties=properties,
        filter_=filter_,
        limit=limit,
        sort_by=sort_by,  # type: ignore[arg-type]
        direction=direction,
        sort=sort,
    )

HighSpeedShaftBendingMomentYAPI

Source code in examples/windmill/_api/high_speed_shaft_bending_moment_y.py
class HighSpeedShaftBendingMomentYAPI:
    def __init__(self, client: CogniteClient, view_id: dm.ViewId):
        self._client = client
        self._view_id = view_id

    def __call__(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> HighSpeedShaftBendingMomentYQuery:
        """Query timeseries `high_speed_shaft.bending_moment_y`

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of high speed shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query object that can be used to retrieve datapoins for the high_speed_shaft.bending_moment_y timeseries
            selected in this method.

        Examples:

            Retrieve all data for 5 high_speed_shaft.bending_moment_y timeseries:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> high_speed_shafts = client.high_speed_shaft.bending_moment_y(limit=5).retrieve()

        """
        filter_ = _create_high_speed_shaft_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )

        return HighSpeedShaftBendingMomentYQuery(
            client=self._client,
            view_id=self._view_id,
            timeseries_limit=limit,
            filter=filter_,
        )

    def list(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> TimeSeriesList:
        """List timeseries `high_speed_shaft.bending_moment_y`

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of high speed shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            List of Timeseries high_speed_shaft.bending_moment_y.

        Examples:

            List high_speed_shaft.bending_moment_y and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> high_speed_shafts = client.high_speed_shaft.bending_moment_y.list(limit=5)

        """
        filter_ = _create_high_speed_shaft_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )
        external_ids = _retrieve_timeseries_external_ids_with_extra_bending_moment_y(
            self._client, self._view_id, filter_, limit
        )
        if external_ids:
            return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
        else:
            return TimeSeriesList([])

__call__(external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Query timeseries high_speed_shaft.bending_moment_y

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of high speed shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
HighSpeedShaftBendingMomentYQuery

A query object that can be used to retrieve datapoins for the high_speed_shaft.bending_moment_y timeseries

HighSpeedShaftBendingMomentYQuery

selected in this method.

Examples:

Retrieve all data for 5 high_speed_shaft.bending_moment_y timeseries:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> high_speed_shafts = client.high_speed_shaft.bending_moment_y(limit=5).retrieve()
Source code in examples/windmill/_api/high_speed_shaft_bending_moment_y.py
def __call__(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> HighSpeedShaftBendingMomentYQuery:
    """Query timeseries `high_speed_shaft.bending_moment_y`

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of high speed shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query object that can be used to retrieve datapoins for the high_speed_shaft.bending_moment_y timeseries
        selected in this method.

    Examples:

        Retrieve all data for 5 high_speed_shaft.bending_moment_y timeseries:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> high_speed_shafts = client.high_speed_shaft.bending_moment_y(limit=5).retrieve()

    """
    filter_ = _create_high_speed_shaft_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )

    return HighSpeedShaftBendingMomentYQuery(
        client=self._client,
        view_id=self._view_id,
        timeseries_limit=limit,
        filter=filter_,
    )

list(external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

List timeseries high_speed_shaft.bending_moment_y

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of high speed shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
TimeSeriesList

List of Timeseries high_speed_shaft.bending_moment_y.

Examples:

List high_speed_shaft.bending_moment_y and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> high_speed_shafts = client.high_speed_shaft.bending_moment_y.list(limit=5)
Source code in examples/windmill/_api/high_speed_shaft_bending_moment_y.py
def list(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> TimeSeriesList:
    """List timeseries `high_speed_shaft.bending_moment_y`

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of high speed shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        List of Timeseries high_speed_shaft.bending_moment_y.

    Examples:

        List high_speed_shaft.bending_moment_y and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> high_speed_shafts = client.high_speed_shaft.bending_moment_y.list(limit=5)

    """
    filter_ = _create_high_speed_shaft_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )
    external_ids = _retrieve_timeseries_external_ids_with_extra_bending_moment_y(
        self._client, self._view_id, filter_, limit
    )
    if external_ids:
        return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
    else:
        return TimeSeriesList([])

HighSpeedShaftBendingMonentXAPI

Source code in examples/windmill/_api/high_speed_shaft_bending_monent_x.py
class HighSpeedShaftBendingMonentXAPI:
    def __init__(self, client: CogniteClient, view_id: dm.ViewId):
        self._client = client
        self._view_id = view_id

    def __call__(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> HighSpeedShaftBendingMonentXQuery:
        """Query timeseries `high_speed_shaft.bending_monent_x`

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of high speed shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query object that can be used to retrieve datapoins for the high_speed_shaft.bending_monent_x timeseries
            selected in this method.

        Examples:

            Retrieve all data for 5 high_speed_shaft.bending_monent_x timeseries:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> high_speed_shafts = client.high_speed_shaft.bending_monent_x(limit=5).retrieve()

        """
        filter_ = _create_high_speed_shaft_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )

        return HighSpeedShaftBendingMonentXQuery(
            client=self._client,
            view_id=self._view_id,
            timeseries_limit=limit,
            filter=filter_,
        )

    def list(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> TimeSeriesList:
        """List timeseries `high_speed_shaft.bending_monent_x`

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of high speed shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            List of Timeseries high_speed_shaft.bending_monent_x.

        Examples:

            List high_speed_shaft.bending_monent_x and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> high_speed_shafts = client.high_speed_shaft.bending_monent_x.list(limit=5)

        """
        filter_ = _create_high_speed_shaft_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )
        external_ids = _retrieve_timeseries_external_ids_with_extra_bending_monent_x(
            self._client, self._view_id, filter_, limit
        )
        if external_ids:
            return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
        else:
            return TimeSeriesList([])

__call__(external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Query timeseries high_speed_shaft.bending_monent_x

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of high speed shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
HighSpeedShaftBendingMonentXQuery

A query object that can be used to retrieve datapoins for the high_speed_shaft.bending_monent_x timeseries

HighSpeedShaftBendingMonentXQuery

selected in this method.

Examples:

Retrieve all data for 5 high_speed_shaft.bending_monent_x timeseries:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> high_speed_shafts = client.high_speed_shaft.bending_monent_x(limit=5).retrieve()
Source code in examples/windmill/_api/high_speed_shaft_bending_monent_x.py
def __call__(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> HighSpeedShaftBendingMonentXQuery:
    """Query timeseries `high_speed_shaft.bending_monent_x`

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of high speed shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query object that can be used to retrieve datapoins for the high_speed_shaft.bending_monent_x timeseries
        selected in this method.

    Examples:

        Retrieve all data for 5 high_speed_shaft.bending_monent_x timeseries:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> high_speed_shafts = client.high_speed_shaft.bending_monent_x(limit=5).retrieve()

    """
    filter_ = _create_high_speed_shaft_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )

    return HighSpeedShaftBendingMonentXQuery(
        client=self._client,
        view_id=self._view_id,
        timeseries_limit=limit,
        filter=filter_,
    )

list(external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

List timeseries high_speed_shaft.bending_monent_x

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of high speed shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
TimeSeriesList

List of Timeseries high_speed_shaft.bending_monent_x.

Examples:

List high_speed_shaft.bending_monent_x and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> high_speed_shafts = client.high_speed_shaft.bending_monent_x.list(limit=5)
Source code in examples/windmill/_api/high_speed_shaft_bending_monent_x.py
def list(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> TimeSeriesList:
    """List timeseries `high_speed_shaft.bending_monent_x`

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of high speed shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        List of Timeseries high_speed_shaft.bending_monent_x.

    Examples:

        List high_speed_shaft.bending_monent_x and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> high_speed_shafts = client.high_speed_shaft.bending_monent_x.list(limit=5)

    """
    filter_ = _create_high_speed_shaft_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )
    external_ids = _retrieve_timeseries_external_ids_with_extra_bending_monent_x(
        self._client, self._view_id, filter_, limit
    )
    if external_ids:
        return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
    else:
        return TimeSeriesList([])

HighSpeedShaftQueryAPI

Bases: QueryAPI[T_DomainModelList]

Source code in examples/windmill/_api/high_speed_shaft_query.py
class HighSpeedShaftQueryAPI(QueryAPI[T_DomainModelList]):
    _view_id = dm.ViewId("power-models", "HighSpeedShaft", "1")

    def __init__(
        self,
        client: CogniteClient,
        builder: QueryBuilder[T_DomainModelList],
        filter_: dm.filters.Filter | None = None,
        limit: int = DEFAULT_QUERY_LIMIT,
    ):
        super().__init__(client, builder)
        from_ = self._builder.get_from()
        self._builder.append(
            NodeQueryStep(
                name=self._builder.create_name(from_),
                expression=dm.query.NodeResultSetExpression(
                    from_=from_,
                    filter=filter_,
                ),
                result_cls=HighSpeedShaft,
                max_retrieve_limit=limit,
            )
        )

    def query(
        self,
    ) -> T_DomainModelList:
        """Execute query and return the result.

        Returns:
            The list of the source nodes of the query.

        """
        return self._query()

query()

Execute query and return the result.

Returns:

Type Description
T_DomainModelList

The list of the source nodes of the query.

Source code in examples/windmill/_api/high_speed_shaft_query.py
def query(
    self,
) -> T_DomainModelList:
    """Execute query and return the result.

    Returns:
        The list of the source nodes of the query.

    """
    return self._query()

HighSpeedShaftTorqueAPI

Source code in examples/windmill/_api/high_speed_shaft_torque.py
class HighSpeedShaftTorqueAPI:
    def __init__(self, client: CogniteClient, view_id: dm.ViewId):
        self._client = client
        self._view_id = view_id

    def __call__(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> HighSpeedShaftTorqueQuery:
        """Query timeseries `high_speed_shaft.torque`

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of high speed shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query object that can be used to retrieve datapoins for the high_speed_shaft.torque timeseries
            selected in this method.

        Examples:

            Retrieve all data for 5 high_speed_shaft.torque timeseries:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> high_speed_shafts = client.high_speed_shaft.torque(limit=5).retrieve()

        """
        filter_ = _create_high_speed_shaft_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )

        return HighSpeedShaftTorqueQuery(
            client=self._client,
            view_id=self._view_id,
            timeseries_limit=limit,
            filter=filter_,
        )

    def list(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> TimeSeriesList:
        """List timeseries `high_speed_shaft.torque`

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of high speed shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            List of Timeseries high_speed_shaft.torque.

        Examples:

            List high_speed_shaft.torque and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> high_speed_shafts = client.high_speed_shaft.torque.list(limit=5)

        """
        filter_ = _create_high_speed_shaft_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )
        external_ids = _retrieve_timeseries_external_ids_with_extra_torque(self._client, self._view_id, filter_, limit)
        if external_ids:
            return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
        else:
            return TimeSeriesList([])

__call__(external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Query timeseries high_speed_shaft.torque

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of high speed shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
HighSpeedShaftTorqueQuery

A query object that can be used to retrieve datapoins for the high_speed_shaft.torque timeseries

HighSpeedShaftTorqueQuery

selected in this method.

Examples:

Retrieve all data for 5 high_speed_shaft.torque timeseries:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> high_speed_shafts = client.high_speed_shaft.torque(limit=5).retrieve()
Source code in examples/windmill/_api/high_speed_shaft_torque.py
def __call__(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> HighSpeedShaftTorqueQuery:
    """Query timeseries `high_speed_shaft.torque`

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of high speed shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query object that can be used to retrieve datapoins for the high_speed_shaft.torque timeseries
        selected in this method.

    Examples:

        Retrieve all data for 5 high_speed_shaft.torque timeseries:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> high_speed_shafts = client.high_speed_shaft.torque(limit=5).retrieve()

    """
    filter_ = _create_high_speed_shaft_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )

    return HighSpeedShaftTorqueQuery(
        client=self._client,
        view_id=self._view_id,
        timeseries_limit=limit,
        filter=filter_,
    )

list(external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

List timeseries high_speed_shaft.torque

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of high speed shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
TimeSeriesList

List of Timeseries high_speed_shaft.torque.

Examples:

List high_speed_shaft.torque and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> high_speed_shafts = client.high_speed_shaft.torque.list(limit=5)
Source code in examples/windmill/_api/high_speed_shaft_torque.py
def list(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> TimeSeriesList:
    """List timeseries `high_speed_shaft.torque`

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of high speed shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        List of Timeseries high_speed_shaft.torque.

    Examples:

        List high_speed_shaft.torque and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> high_speed_shafts = client.high_speed_shaft.torque.list(limit=5)

    """
    filter_ = _create_high_speed_shaft_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )
    external_ids = _retrieve_timeseries_external_ids_with_extra_torque(self._client, self._view_id, filter_, limit)
    if external_ids:
        return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
    else:
        return TimeSeriesList([])

MainShaftAPI

Bases: NodeAPI[MainShaft, MainShaftWrite, MainShaftList, MainShaftWriteList]

Source code in examples/windmill/_api/main_shaft.py
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
class MainShaftAPI(NodeAPI[MainShaft, MainShaftWrite, MainShaftList, MainShaftWriteList]):
    _view_id = dm.ViewId("power-models", "MainShaft", "1")
    _properties_by_field = _MAINSHAFT_PROPERTIES_BY_FIELD
    _class_type = MainShaft
    _class_list = MainShaftList
    _class_write_list = MainShaftWriteList

    def __init__(self, client: CogniteClient):
        super().__init__(client=client)

        self.bending_x = MainShaftBendingXAPI(client, self._view_id)
        self.bending_y = MainShaftBendingYAPI(client, self._view_id)
        self.calculated_tilt_moment = MainShaftCalculatedTiltMomentAPI(client, self._view_id)
        self.calculated_yaw_moment = MainShaftCalculatedYawMomentAPI(client, self._view_id)
        self.torque = MainShaftTorqueAPI(client, self._view_id)

    def __call__(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_QUERY_LIMIT,
        filter: dm.Filter | None = None,
    ) -> MainShaftQueryAPI[MainShaftList]:
        """Query starting at main shafts.

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query API for main shafts.

        """
        has_data = dm.filters.HasData(views=[self._view_id])
        filter_ = _create_main_shaft_filter(
            self._view_id,
            external_id_prefix,
            space,
            (filter and dm.filters.And(filter, has_data)) or has_data,
        )
        builder = QueryBuilder(MainShaftList)
        return MainShaftQueryAPI(self._client, builder, filter_, limit)

    def apply(
        self,
        main_shaft: MainShaftWrite | Sequence[MainShaftWrite],
        replace: bool = False,
        write_none: bool = False,
    ) -> ResourcesWriteResult:
        """Add or update (upsert) main shafts.

        Args:
            main_shaft: Main shaft or sequence of main shafts to upsert.
            replace (bool): How do we behave when a property value exists? Do we replace all matching and existing values with the supplied values (true)?
                Or should we merge in new values for properties together with the existing values (false)? Note: This setting applies for all nodes or edges specified in the ingestion call.
            write_none (bool): This method, will by default, skip properties that are set to None. However, if you want to set properties to None,
                you can set this parameter to True. Note this only applies to properties that are nullable.
        Returns:
            Created instance(s), i.e., nodes, edges, and time series.

        Examples:

            Create a new main_shaft:

                >>> from windmill import WindmillClient
                >>> from windmill.data_classes import MainShaftWrite
                >>> client = WindmillClient()
                >>> main_shaft = MainShaftWrite(external_id="my_main_shaft", ...)
                >>> result = client.main_shaft.apply(main_shaft)

        """
        warnings.warn(
            "The .apply method is deprecated and will be removed in v1.0. "
            "Please use the .upsert method on the client instead. This means instead of "
            "`my_client.main_shaft.apply(my_items)` please use `my_client.upsert(my_items)`."
            "The motivation is that all apply methods are the same, and having one apply method per API "
            " class encourages users to create items in small batches, which is inefficient."
            "In addition, .upsert method is more descriptive of what the method does.",
            UserWarning,
            stacklevel=2,
        )
        return self._apply(main_shaft, replace, write_none)

    def delete(
        self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
    ) -> dm.InstancesDeleteResult:
        """Delete one or more main shaft.

        Args:
            external_id: External id of the main shaft to delete.
            space: The space where all the main shaft are located.

        Returns:
            The instance(s), i.e., nodes and edges which has been deleted. Empty list if nothing was deleted.

        Examples:

            Delete main_shaft by id:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> client.main_shaft.delete("my_main_shaft")
        """
        warnings.warn(
            "The .delete method is deprecated and will be removed in v1.0. "
            "Please use the .delete method on the client instead. This means instead of "
            "`my_client.main_shaft.delete(my_ids)` please use `my_client.delete(my_ids)`."
            "The motivation is that all delete methods are the same, and having one delete method per API "
            " class encourages users to delete items in small batches, which is inefficient.",
            UserWarning,
            stacklevel=2,
        )
        return self._delete(external_id, space)

    @overload
    def retrieve(self, external_id: str, space: str = DEFAULT_INSTANCE_SPACE) -> MainShaft | None: ...

    @overload
    def retrieve(self, external_id: SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE) -> MainShaftList: ...

    def retrieve(
        self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
    ) -> MainShaft | MainShaftList | None:
        """Retrieve one or more main shafts by id(s).

        Args:
            external_id: External id or list of external ids of the main shafts.
            space: The space where all the main shafts are located.

        Returns:
            The requested main shafts.

        Examples:

            Retrieve main_shaft by id:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> main_shaft = client.main_shaft.retrieve("my_main_shaft")

        """
        return self._retrieve(external_id, space)

    def search(
        self,
        query: str,
        properties: MainShaftTextFields | SequenceNotStr[MainShaftTextFields] | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
        sort_by: MainShaftFields | SequenceNotStr[MainShaftFields] | None = None,
        direction: Literal["ascending", "descending"] = "ascending",
        sort: InstanceSort | list[InstanceSort] | None = None,
    ) -> MainShaftList:
        """Search main shafts

        Args:
            query: The search query,
            properties: The property to search, if nothing is passed all text fields will be searched.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
            sort_by: The property to sort by.
            direction: The direction to sort by, either 'ascending' or 'descending'.
            sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
                This will override the sort_by and direction. This allowos you to sort by multiple fields and
                specify the direction for each field as well as how to handle null values.

        Returns:
            Search results main shafts matching the query.

        Examples:

           Search for 'my_main_shaft' in all text properties:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> main_shafts = client.main_shaft.search('my_main_shaft')

        """
        filter_ = _create_main_shaft_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )
        return self._search(
            query=query,
            properties=properties,
            filter_=filter_,
            limit=limit,
            sort_by=sort_by,  # type: ignore[arg-type]
            direction=direction,
            sort=sort,
        )

    @overload
    def aggregate(
        self,
        aggregate: Aggregations | dm.aggregations.MetricAggregation,
        group_by: None = None,
        property: MainShaftFields | SequenceNotStr[MainShaftFields] | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> dm.aggregations.AggregatedNumberedValue: ...

    @overload
    def aggregate(
        self,
        aggregate: SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation],
        group_by: None = None,
        property: MainShaftFields | SequenceNotStr[MainShaftFields] | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> list[dm.aggregations.AggregatedNumberedValue]: ...

    @overload
    def aggregate(
        self,
        aggregate: (
            Aggregations
            | dm.aggregations.MetricAggregation
            | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation]
        ),
        group_by: MainShaftFields | SequenceNotStr[MainShaftFields],
        property: MainShaftFields | SequenceNotStr[MainShaftFields] | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> InstanceAggregationResultList: ...

    def aggregate(
        self,
        aggregate: (
            Aggregations
            | dm.aggregations.MetricAggregation
            | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation]
        ),
        group_by: MainShaftFields | SequenceNotStr[MainShaftFields] | None = None,
        property: MainShaftFields | SequenceNotStr[MainShaftFields] | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> (
        dm.aggregations.AggregatedNumberedValue
        | list[dm.aggregations.AggregatedNumberedValue]
        | InstanceAggregationResultList
    ):
        """Aggregate data across main shafts

        Args:
            aggregate: The aggregation to perform.
            group_by: The property to group by when doing the aggregation.
            property: The property to perform aggregation on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            Aggregation results.

        Examples:

            Count main shafts in space `my_space`:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> result = client.main_shaft.aggregate("count", space="my_space")

        """

        filter_ = _create_main_shaft_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )
        return self._aggregate(
            aggregate=aggregate,
            group_by=group_by,  # type: ignore[arg-type]
            properties=property,  # type: ignore[arg-type]
            query=None,
            search_properties=None,
            limit=limit,
            filter=filter_,
        )

    def histogram(
        self,
        property: MainShaftFields,
        interval: float,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> dm.aggregations.HistogramValue:
        """Produces histograms for main shafts

        Args:
            property: The property to use as the value in the histogram.
            interval: The interval to use for the histogram bins.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            Bucketed histogram results.

        """
        filter_ = _create_main_shaft_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )
        return self._histogram(
            property,
            interval,
            None,
            None,
            limit,
            filter_,
        )

    def query(self) -> MainShaftQuery:
        """Start a query for main shafts."""
        warnings.warn("The .query is in alpha and is subject to breaking changes without notice.")
        return MainShaftQuery(self._client)

    def list(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
        sort_by: MainShaftFields | Sequence[MainShaftFields] | None = None,
        direction: Literal["ascending", "descending"] = "ascending",
        sort: InstanceSort | list[InstanceSort] | None = None,
    ) -> MainShaftList:
        """List/filter main shafts

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
            sort_by: The property to sort by.
            direction: The direction to sort by, either 'ascending' or 'descending'.
            sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
                This will override the sort_by and direction. This allowos you to sort by multiple fields and
                specify the direction for each field as well as how to handle null values.

        Returns:
            List of requested main shafts

        Examples:

            List main shafts and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> main_shafts = client.main_shaft.list(limit=5)

        """
        filter_ = _create_main_shaft_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )

        return self._list(
            limit=limit,
            filter=filter_,
            sort_by=sort_by,  # type: ignore[arg-type]
            direction=direction,
            sort=sort,
        )

__call__(external_id_prefix=None, space=None, limit=DEFAULT_QUERY_LIMIT, filter=None)

Query starting at main shafts.

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_QUERY_LIMIT
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
MainShaftQueryAPI[MainShaftList]

A query API for main shafts.

Source code in examples/windmill/_api/main_shaft.py
def __call__(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_QUERY_LIMIT,
    filter: dm.Filter | None = None,
) -> MainShaftQueryAPI[MainShaftList]:
    """Query starting at main shafts.

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query API for main shafts.

    """
    has_data = dm.filters.HasData(views=[self._view_id])
    filter_ = _create_main_shaft_filter(
        self._view_id,
        external_id_prefix,
        space,
        (filter and dm.filters.And(filter, has_data)) or has_data,
    )
    builder = QueryBuilder(MainShaftList)
    return MainShaftQueryAPI(self._client, builder, filter_, limit)

aggregate(aggregate, group_by=None, property=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

aggregate(aggregate: Aggregations | dm.aggregations.MetricAggregation, group_by: None = None, property: MainShaftFields | SequenceNotStr[MainShaftFields] | None = None, external_id_prefix: str | None = None, space: str | list[str] | None = None, limit: int = DEFAULT_LIMIT_READ, filter: dm.Filter | None = None) -> dm.aggregations.AggregatedNumberedValue
aggregate(aggregate: SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation], group_by: None = None, property: MainShaftFields | SequenceNotStr[MainShaftFields] | None = None, external_id_prefix: str | None = None, space: str | list[str] | None = None, limit: int = DEFAULT_LIMIT_READ, filter: dm.Filter | None = None) -> list[dm.aggregations.AggregatedNumberedValue]
aggregate(aggregate: Aggregations | dm.aggregations.MetricAggregation | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation], group_by: MainShaftFields | SequenceNotStr[MainShaftFields], property: MainShaftFields | SequenceNotStr[MainShaftFields] | None = None, external_id_prefix: str | None = None, space: str | list[str] | None = None, limit: int = DEFAULT_LIMIT_READ, filter: dm.Filter | None = None) -> InstanceAggregationResultList

Aggregate data across main shafts

Parameters:

Name Type Description Default
aggregate Aggregations | MetricAggregation | SequenceNotStr[Aggregations | MetricAggregation]

The aggregation to perform.

required
group_by MainShaftFields | SequenceNotStr[MainShaftFields] | None

The property to group by when doing the aggregation.

None
property MainShaftFields | SequenceNotStr[MainShaftFields] | None

The property to perform aggregation on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
AggregatedNumberedValue | list[AggregatedNumberedValue] | InstanceAggregationResultList

Aggregation results.

Examples:

Count main shafts in space `my_space`:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> result = client.main_shaft.aggregate("count", space="my_space")
Source code in examples/windmill/_api/main_shaft.py
def aggregate(
    self,
    aggregate: (
        Aggregations
        | dm.aggregations.MetricAggregation
        | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation]
    ),
    group_by: MainShaftFields | SequenceNotStr[MainShaftFields] | None = None,
    property: MainShaftFields | SequenceNotStr[MainShaftFields] | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> (
    dm.aggregations.AggregatedNumberedValue
    | list[dm.aggregations.AggregatedNumberedValue]
    | InstanceAggregationResultList
):
    """Aggregate data across main shafts

    Args:
        aggregate: The aggregation to perform.
        group_by: The property to group by when doing the aggregation.
        property: The property to perform aggregation on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        Aggregation results.

    Examples:

        Count main shafts in space `my_space`:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> result = client.main_shaft.aggregate("count", space="my_space")

    """

    filter_ = _create_main_shaft_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )
    return self._aggregate(
        aggregate=aggregate,
        group_by=group_by,  # type: ignore[arg-type]
        properties=property,  # type: ignore[arg-type]
        query=None,
        search_properties=None,
        limit=limit,
        filter=filter_,
    )

apply(main_shaft, replace=False, write_none=False)

Add or update (upsert) main shafts.

Parameters:

Name Type Description Default
main_shaft MainShaftWrite | Sequence[MainShaftWrite]

Main shaft or sequence of main shafts to upsert.

required
replace bool

How do we behave when a property value exists? Do we replace all matching and existing values with the supplied values (true)? Or should we merge in new values for properties together with the existing values (false)? Note: This setting applies for all nodes or edges specified in the ingestion call.

False
write_none bool

This method, will by default, skip properties that are set to None. However, if you want to set properties to None, you can set this parameter to True. Note this only applies to properties that are nullable.

False

Returns: Created instance(s), i.e., nodes, edges, and time series.

Examples:

Create a new main_shaft:

    >>> from windmill import WindmillClient
    >>> from windmill.data_classes import MainShaftWrite
    >>> client = WindmillClient()
    >>> main_shaft = MainShaftWrite(external_id="my_main_shaft", ...)
    >>> result = client.main_shaft.apply(main_shaft)
Source code in examples/windmill/_api/main_shaft.py
def apply(
    self,
    main_shaft: MainShaftWrite | Sequence[MainShaftWrite],
    replace: bool = False,
    write_none: bool = False,
) -> ResourcesWriteResult:
    """Add or update (upsert) main shafts.

    Args:
        main_shaft: Main shaft or sequence of main shafts to upsert.
        replace (bool): How do we behave when a property value exists? Do we replace all matching and existing values with the supplied values (true)?
            Or should we merge in new values for properties together with the existing values (false)? Note: This setting applies for all nodes or edges specified in the ingestion call.
        write_none (bool): This method, will by default, skip properties that are set to None. However, if you want to set properties to None,
            you can set this parameter to True. Note this only applies to properties that are nullable.
    Returns:
        Created instance(s), i.e., nodes, edges, and time series.

    Examples:

        Create a new main_shaft:

            >>> from windmill import WindmillClient
            >>> from windmill.data_classes import MainShaftWrite
            >>> client = WindmillClient()
            >>> main_shaft = MainShaftWrite(external_id="my_main_shaft", ...)
            >>> result = client.main_shaft.apply(main_shaft)

    """
    warnings.warn(
        "The .apply method is deprecated and will be removed in v1.0. "
        "Please use the .upsert method on the client instead. This means instead of "
        "`my_client.main_shaft.apply(my_items)` please use `my_client.upsert(my_items)`."
        "The motivation is that all apply methods are the same, and having one apply method per API "
        " class encourages users to create items in small batches, which is inefficient."
        "In addition, .upsert method is more descriptive of what the method does.",
        UserWarning,
        stacklevel=2,
    )
    return self._apply(main_shaft, replace, write_none)

delete(external_id, space=DEFAULT_INSTANCE_SPACE)

Delete one or more main shaft.

Parameters:

Name Type Description Default
external_id str | SequenceNotStr[str]

External id of the main shaft to delete.

required
space str

The space where all the main shaft are located.

DEFAULT_INSTANCE_SPACE

Returns:

Type Description
InstancesDeleteResult

The instance(s), i.e., nodes and edges which has been deleted. Empty list if nothing was deleted.

Examples:

Delete main_shaft by id:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> client.main_shaft.delete("my_main_shaft")
Source code in examples/windmill/_api/main_shaft.py
def delete(
    self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
) -> dm.InstancesDeleteResult:
    """Delete one or more main shaft.

    Args:
        external_id: External id of the main shaft to delete.
        space: The space where all the main shaft are located.

    Returns:
        The instance(s), i.e., nodes and edges which has been deleted. Empty list if nothing was deleted.

    Examples:

        Delete main_shaft by id:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> client.main_shaft.delete("my_main_shaft")
    """
    warnings.warn(
        "The .delete method is deprecated and will be removed in v1.0. "
        "Please use the .delete method on the client instead. This means instead of "
        "`my_client.main_shaft.delete(my_ids)` please use `my_client.delete(my_ids)`."
        "The motivation is that all delete methods are the same, and having one delete method per API "
        " class encourages users to delete items in small batches, which is inefficient.",
        UserWarning,
        stacklevel=2,
    )
    return self._delete(external_id, space)

histogram(property, interval, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Produces histograms for main shafts

Parameters:

Name Type Description Default
property MainShaftFields

The property to use as the value in the histogram.

required
interval float

The interval to use for the histogram bins.

required
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
HistogramValue

Bucketed histogram results.

Source code in examples/windmill/_api/main_shaft.py
def histogram(
    self,
    property: MainShaftFields,
    interval: float,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> dm.aggregations.HistogramValue:
    """Produces histograms for main shafts

    Args:
        property: The property to use as the value in the histogram.
        interval: The interval to use for the histogram bins.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        Bucketed histogram results.

    """
    filter_ = _create_main_shaft_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )
    return self._histogram(
        property,
        interval,
        None,
        None,
        limit,
        filter_,
    )

list(external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None, sort_by=None, direction='ascending', sort=None)

List/filter main shafts

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None
sort_by MainShaftFields | Sequence[MainShaftFields] | None

The property to sort by.

None
direction Literal['ascending', 'descending']

The direction to sort by, either 'ascending' or 'descending'.

'ascending'
sort InstanceSort | list[InstanceSort] | None

(Advanced) If sort_by and direction are not sufficient, you can write your own sorting. This will override the sort_by and direction. This allowos you to sort by multiple fields and specify the direction for each field as well as how to handle null values.

None

Returns:

Type Description
MainShaftList

List of requested main shafts

Examples:

List main shafts and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> main_shafts = client.main_shaft.list(limit=5)
Source code in examples/windmill/_api/main_shaft.py
def list(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
    sort_by: MainShaftFields | Sequence[MainShaftFields] | None = None,
    direction: Literal["ascending", "descending"] = "ascending",
    sort: InstanceSort | list[InstanceSort] | None = None,
) -> MainShaftList:
    """List/filter main shafts

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
        sort_by: The property to sort by.
        direction: The direction to sort by, either 'ascending' or 'descending'.
        sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
            This will override the sort_by and direction. This allowos you to sort by multiple fields and
            specify the direction for each field as well as how to handle null values.

    Returns:
        List of requested main shafts

    Examples:

        List main shafts and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> main_shafts = client.main_shaft.list(limit=5)

    """
    filter_ = _create_main_shaft_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )

    return self._list(
        limit=limit,
        filter=filter_,
        sort_by=sort_by,  # type: ignore[arg-type]
        direction=direction,
        sort=sort,
    )

query()

Start a query for main shafts.

Source code in examples/windmill/_api/main_shaft.py
def query(self) -> MainShaftQuery:
    """Start a query for main shafts."""
    warnings.warn("The .query is in alpha and is subject to breaking changes without notice.")
    return MainShaftQuery(self._client)

retrieve(external_id, space=DEFAULT_INSTANCE_SPACE)

retrieve(external_id: str, space: str = DEFAULT_INSTANCE_SPACE) -> MainShaft | None
retrieve(external_id: SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE) -> MainShaftList

Retrieve one or more main shafts by id(s).

Parameters:

Name Type Description Default
external_id str | SequenceNotStr[str]

External id or list of external ids of the main shafts.

required
space str

The space where all the main shafts are located.

DEFAULT_INSTANCE_SPACE

Returns:

Type Description
MainShaft | MainShaftList | None

The requested main shafts.

Examples:

Retrieve main_shaft by id:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> main_shaft = client.main_shaft.retrieve("my_main_shaft")
Source code in examples/windmill/_api/main_shaft.py
def retrieve(
    self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
) -> MainShaft | MainShaftList | None:
    """Retrieve one or more main shafts by id(s).

    Args:
        external_id: External id or list of external ids of the main shafts.
        space: The space where all the main shafts are located.

    Returns:
        The requested main shafts.

    Examples:

        Retrieve main_shaft by id:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> main_shaft = client.main_shaft.retrieve("my_main_shaft")

    """
    return self._retrieve(external_id, space)

search(query, properties=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None, sort_by=None, direction='ascending', sort=None)

Search main shafts

Parameters:

Name Type Description Default
query str

The search query,

required
properties MainShaftTextFields | SequenceNotStr[MainShaftTextFields] | None

The property to search, if nothing is passed all text fields will be searched.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None
sort_by MainShaftFields | SequenceNotStr[MainShaftFields] | None

The property to sort by.

None
direction Literal['ascending', 'descending']

The direction to sort by, either 'ascending' or 'descending'.

'ascending'
sort InstanceSort | list[InstanceSort] | None

(Advanced) If sort_by and direction are not sufficient, you can write your own sorting. This will override the sort_by and direction. This allowos you to sort by multiple fields and specify the direction for each field as well as how to handle null values.

None

Returns:

Type Description
MainShaftList

Search results main shafts matching the query.

Examples:

Search for 'my_main_shaft' in all text properties:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> main_shafts = client.main_shaft.search('my_main_shaft')
Source code in examples/windmill/_api/main_shaft.py
def search(
    self,
    query: str,
    properties: MainShaftTextFields | SequenceNotStr[MainShaftTextFields] | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
    sort_by: MainShaftFields | SequenceNotStr[MainShaftFields] | None = None,
    direction: Literal["ascending", "descending"] = "ascending",
    sort: InstanceSort | list[InstanceSort] | None = None,
) -> MainShaftList:
    """Search main shafts

    Args:
        query: The search query,
        properties: The property to search, if nothing is passed all text fields will be searched.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
        sort_by: The property to sort by.
        direction: The direction to sort by, either 'ascending' or 'descending'.
        sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
            This will override the sort_by and direction. This allowos you to sort by multiple fields and
            specify the direction for each field as well as how to handle null values.

    Returns:
        Search results main shafts matching the query.

    Examples:

       Search for 'my_main_shaft' in all text properties:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> main_shafts = client.main_shaft.search('my_main_shaft')

    """
    filter_ = _create_main_shaft_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )
    return self._search(
        query=query,
        properties=properties,
        filter_=filter_,
        limit=limit,
        sort_by=sort_by,  # type: ignore[arg-type]
        direction=direction,
        sort=sort,
    )

MainShaftBendingXAPI

Source code in examples/windmill/_api/main_shaft_bending_x.py
class MainShaftBendingXAPI:
    def __init__(self, client: CogniteClient, view_id: dm.ViewId):
        self._client = client
        self._view_id = view_id

    def __call__(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> MainShaftBendingXQuery:
        """Query timeseries `main_shaft.bending_x`

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query object that can be used to retrieve datapoins for the main_shaft.bending_x timeseries
            selected in this method.

        Examples:

            Retrieve all data for 5 main_shaft.bending_x timeseries:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> main_shafts = client.main_shaft.bending_x(limit=5).retrieve()

        """
        filter_ = _create_main_shaft_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )

        return MainShaftBendingXQuery(
            client=self._client,
            view_id=self._view_id,
            timeseries_limit=limit,
            filter=filter_,
        )

    def list(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> TimeSeriesList:
        """List timeseries `main_shaft.bending_x`

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            List of Timeseries main_shaft.bending_x.

        Examples:

            List main_shaft.bending_x and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> main_shafts = client.main_shaft.bending_x.list(limit=5)

        """
        filter_ = _create_main_shaft_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )
        external_ids = _retrieve_timeseries_external_ids_with_extra_bending_x(
            self._client, self._view_id, filter_, limit
        )
        if external_ids:
            return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
        else:
            return TimeSeriesList([])

__call__(external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Query timeseries main_shaft.bending_x

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
MainShaftBendingXQuery

A query object that can be used to retrieve datapoins for the main_shaft.bending_x timeseries

MainShaftBendingXQuery

selected in this method.

Examples:

Retrieve all data for 5 main_shaft.bending_x timeseries:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> main_shafts = client.main_shaft.bending_x(limit=5).retrieve()
Source code in examples/windmill/_api/main_shaft_bending_x.py
def __call__(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> MainShaftBendingXQuery:
    """Query timeseries `main_shaft.bending_x`

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query object that can be used to retrieve datapoins for the main_shaft.bending_x timeseries
        selected in this method.

    Examples:

        Retrieve all data for 5 main_shaft.bending_x timeseries:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> main_shafts = client.main_shaft.bending_x(limit=5).retrieve()

    """
    filter_ = _create_main_shaft_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )

    return MainShaftBendingXQuery(
        client=self._client,
        view_id=self._view_id,
        timeseries_limit=limit,
        filter=filter_,
    )

list(external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

List timeseries main_shaft.bending_x

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
TimeSeriesList

List of Timeseries main_shaft.bending_x.

Examples:

List main_shaft.bending_x and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> main_shafts = client.main_shaft.bending_x.list(limit=5)
Source code in examples/windmill/_api/main_shaft_bending_x.py
def list(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> TimeSeriesList:
    """List timeseries `main_shaft.bending_x`

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        List of Timeseries main_shaft.bending_x.

    Examples:

        List main_shaft.bending_x and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> main_shafts = client.main_shaft.bending_x.list(limit=5)

    """
    filter_ = _create_main_shaft_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )
    external_ids = _retrieve_timeseries_external_ids_with_extra_bending_x(
        self._client, self._view_id, filter_, limit
    )
    if external_ids:
        return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
    else:
        return TimeSeriesList([])

MainShaftBendingYAPI

Source code in examples/windmill/_api/main_shaft_bending_y.py
class MainShaftBendingYAPI:
    def __init__(self, client: CogniteClient, view_id: dm.ViewId):
        self._client = client
        self._view_id = view_id

    def __call__(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> MainShaftBendingYQuery:
        """Query timeseries `main_shaft.bending_y`

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query object that can be used to retrieve datapoins for the main_shaft.bending_y timeseries
            selected in this method.

        Examples:

            Retrieve all data for 5 main_shaft.bending_y timeseries:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> main_shafts = client.main_shaft.bending_y(limit=5).retrieve()

        """
        filter_ = _create_main_shaft_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )

        return MainShaftBendingYQuery(
            client=self._client,
            view_id=self._view_id,
            timeseries_limit=limit,
            filter=filter_,
        )

    def list(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> TimeSeriesList:
        """List timeseries `main_shaft.bending_y`

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            List of Timeseries main_shaft.bending_y.

        Examples:

            List main_shaft.bending_y and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> main_shafts = client.main_shaft.bending_y.list(limit=5)

        """
        filter_ = _create_main_shaft_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )
        external_ids = _retrieve_timeseries_external_ids_with_extra_bending_y(
            self._client, self._view_id, filter_, limit
        )
        if external_ids:
            return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
        else:
            return TimeSeriesList([])

__call__(external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Query timeseries main_shaft.bending_y

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
MainShaftBendingYQuery

A query object that can be used to retrieve datapoins for the main_shaft.bending_y timeseries

MainShaftBendingYQuery

selected in this method.

Examples:

Retrieve all data for 5 main_shaft.bending_y timeseries:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> main_shafts = client.main_shaft.bending_y(limit=5).retrieve()
Source code in examples/windmill/_api/main_shaft_bending_y.py
def __call__(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> MainShaftBendingYQuery:
    """Query timeseries `main_shaft.bending_y`

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query object that can be used to retrieve datapoins for the main_shaft.bending_y timeseries
        selected in this method.

    Examples:

        Retrieve all data for 5 main_shaft.bending_y timeseries:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> main_shafts = client.main_shaft.bending_y(limit=5).retrieve()

    """
    filter_ = _create_main_shaft_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )

    return MainShaftBendingYQuery(
        client=self._client,
        view_id=self._view_id,
        timeseries_limit=limit,
        filter=filter_,
    )

list(external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

List timeseries main_shaft.bending_y

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
TimeSeriesList

List of Timeseries main_shaft.bending_y.

Examples:

List main_shaft.bending_y and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> main_shafts = client.main_shaft.bending_y.list(limit=5)
Source code in examples/windmill/_api/main_shaft_bending_y.py
def list(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> TimeSeriesList:
    """List timeseries `main_shaft.bending_y`

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        List of Timeseries main_shaft.bending_y.

    Examples:

        List main_shaft.bending_y and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> main_shafts = client.main_shaft.bending_y.list(limit=5)

    """
    filter_ = _create_main_shaft_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )
    external_ids = _retrieve_timeseries_external_ids_with_extra_bending_y(
        self._client, self._view_id, filter_, limit
    )
    if external_ids:
        return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
    else:
        return TimeSeriesList([])

MainShaftCalculatedTiltMomentAPI

Source code in examples/windmill/_api/main_shaft_calculated_tilt_moment.py
class MainShaftCalculatedTiltMomentAPI:
    def __init__(self, client: CogniteClient, view_id: dm.ViewId):
        self._client = client
        self._view_id = view_id

    def __call__(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> MainShaftCalculatedTiltMomentQuery:
        """Query timeseries `main_shaft.calculated_tilt_moment`

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query object that can be used to retrieve datapoins for the main_shaft.calculated_tilt_moment timeseries
            selected in this method.

        Examples:

            Retrieve all data for 5 main_shaft.calculated_tilt_moment timeseries:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> main_shafts = client.main_shaft.calculated_tilt_moment(limit=5).retrieve()

        """
        filter_ = _create_main_shaft_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )

        return MainShaftCalculatedTiltMomentQuery(
            client=self._client,
            view_id=self._view_id,
            timeseries_limit=limit,
            filter=filter_,
        )

    def list(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> TimeSeriesList:
        """List timeseries `main_shaft.calculated_tilt_moment`

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            List of Timeseries main_shaft.calculated_tilt_moment.

        Examples:

            List main_shaft.calculated_tilt_moment and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> main_shafts = client.main_shaft.calculated_tilt_moment.list(limit=5)

        """
        filter_ = _create_main_shaft_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )
        external_ids = _retrieve_timeseries_external_ids_with_extra_calculated_tilt_moment(
            self._client, self._view_id, filter_, limit
        )
        if external_ids:
            return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
        else:
            return TimeSeriesList([])

__call__(external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Query timeseries main_shaft.calculated_tilt_moment

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
MainShaftCalculatedTiltMomentQuery

A query object that can be used to retrieve datapoins for the main_shaft.calculated_tilt_moment timeseries

MainShaftCalculatedTiltMomentQuery

selected in this method.

Examples:

Retrieve all data for 5 main_shaft.calculated_tilt_moment timeseries:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> main_shafts = client.main_shaft.calculated_tilt_moment(limit=5).retrieve()
Source code in examples/windmill/_api/main_shaft_calculated_tilt_moment.py
def __call__(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> MainShaftCalculatedTiltMomentQuery:
    """Query timeseries `main_shaft.calculated_tilt_moment`

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query object that can be used to retrieve datapoins for the main_shaft.calculated_tilt_moment timeseries
        selected in this method.

    Examples:

        Retrieve all data for 5 main_shaft.calculated_tilt_moment timeseries:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> main_shafts = client.main_shaft.calculated_tilt_moment(limit=5).retrieve()

    """
    filter_ = _create_main_shaft_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )

    return MainShaftCalculatedTiltMomentQuery(
        client=self._client,
        view_id=self._view_id,
        timeseries_limit=limit,
        filter=filter_,
    )

list(external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

List timeseries main_shaft.calculated_tilt_moment

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
TimeSeriesList

List of Timeseries main_shaft.calculated_tilt_moment.

Examples:

List main_shaft.calculated_tilt_moment and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> main_shafts = client.main_shaft.calculated_tilt_moment.list(limit=5)
Source code in examples/windmill/_api/main_shaft_calculated_tilt_moment.py
def list(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> TimeSeriesList:
    """List timeseries `main_shaft.calculated_tilt_moment`

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        List of Timeseries main_shaft.calculated_tilt_moment.

    Examples:

        List main_shaft.calculated_tilt_moment and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> main_shafts = client.main_shaft.calculated_tilt_moment.list(limit=5)

    """
    filter_ = _create_main_shaft_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )
    external_ids = _retrieve_timeseries_external_ids_with_extra_calculated_tilt_moment(
        self._client, self._view_id, filter_, limit
    )
    if external_ids:
        return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
    else:
        return TimeSeriesList([])

MainShaftCalculatedYawMomentAPI

Source code in examples/windmill/_api/main_shaft_calculated_yaw_moment.py
class MainShaftCalculatedYawMomentAPI:
    def __init__(self, client: CogniteClient, view_id: dm.ViewId):
        self._client = client
        self._view_id = view_id

    def __call__(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> MainShaftCalculatedYawMomentQuery:
        """Query timeseries `main_shaft.calculated_yaw_moment`

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query object that can be used to retrieve datapoins for the main_shaft.calculated_yaw_moment timeseries
            selected in this method.

        Examples:

            Retrieve all data for 5 main_shaft.calculated_yaw_moment timeseries:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> main_shafts = client.main_shaft.calculated_yaw_moment(limit=5).retrieve()

        """
        filter_ = _create_main_shaft_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )

        return MainShaftCalculatedYawMomentQuery(
            client=self._client,
            view_id=self._view_id,
            timeseries_limit=limit,
            filter=filter_,
        )

    def list(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> TimeSeriesList:
        """List timeseries `main_shaft.calculated_yaw_moment`

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            List of Timeseries main_shaft.calculated_yaw_moment.

        Examples:

            List main_shaft.calculated_yaw_moment and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> main_shafts = client.main_shaft.calculated_yaw_moment.list(limit=5)

        """
        filter_ = _create_main_shaft_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )
        external_ids = _retrieve_timeseries_external_ids_with_extra_calculated_yaw_moment(
            self._client, self._view_id, filter_, limit
        )
        if external_ids:
            return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
        else:
            return TimeSeriesList([])

__call__(external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Query timeseries main_shaft.calculated_yaw_moment

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
MainShaftCalculatedYawMomentQuery

A query object that can be used to retrieve datapoins for the main_shaft.calculated_yaw_moment timeseries

MainShaftCalculatedYawMomentQuery

selected in this method.

Examples:

Retrieve all data for 5 main_shaft.calculated_yaw_moment timeseries:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> main_shafts = client.main_shaft.calculated_yaw_moment(limit=5).retrieve()
Source code in examples/windmill/_api/main_shaft_calculated_yaw_moment.py
def __call__(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> MainShaftCalculatedYawMomentQuery:
    """Query timeseries `main_shaft.calculated_yaw_moment`

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query object that can be used to retrieve datapoins for the main_shaft.calculated_yaw_moment timeseries
        selected in this method.

    Examples:

        Retrieve all data for 5 main_shaft.calculated_yaw_moment timeseries:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> main_shafts = client.main_shaft.calculated_yaw_moment(limit=5).retrieve()

    """
    filter_ = _create_main_shaft_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )

    return MainShaftCalculatedYawMomentQuery(
        client=self._client,
        view_id=self._view_id,
        timeseries_limit=limit,
        filter=filter_,
    )

list(external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

List timeseries main_shaft.calculated_yaw_moment

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
TimeSeriesList

List of Timeseries main_shaft.calculated_yaw_moment.

Examples:

List main_shaft.calculated_yaw_moment and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> main_shafts = client.main_shaft.calculated_yaw_moment.list(limit=5)
Source code in examples/windmill/_api/main_shaft_calculated_yaw_moment.py
def list(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> TimeSeriesList:
    """List timeseries `main_shaft.calculated_yaw_moment`

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        List of Timeseries main_shaft.calculated_yaw_moment.

    Examples:

        List main_shaft.calculated_yaw_moment and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> main_shafts = client.main_shaft.calculated_yaw_moment.list(limit=5)

    """
    filter_ = _create_main_shaft_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )
    external_ids = _retrieve_timeseries_external_ids_with_extra_calculated_yaw_moment(
        self._client, self._view_id, filter_, limit
    )
    if external_ids:
        return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
    else:
        return TimeSeriesList([])

MainShaftQueryAPI

Bases: QueryAPI[T_DomainModelList]

Source code in examples/windmill/_api/main_shaft_query.py
class MainShaftQueryAPI(QueryAPI[T_DomainModelList]):
    _view_id = dm.ViewId("power-models", "MainShaft", "1")

    def __init__(
        self,
        client: CogniteClient,
        builder: QueryBuilder[T_DomainModelList],
        filter_: dm.filters.Filter | None = None,
        limit: int = DEFAULT_QUERY_LIMIT,
    ):
        super().__init__(client, builder)
        from_ = self._builder.get_from()
        self._builder.append(
            NodeQueryStep(
                name=self._builder.create_name(from_),
                expression=dm.query.NodeResultSetExpression(
                    from_=from_,
                    filter=filter_,
                ),
                result_cls=MainShaft,
                max_retrieve_limit=limit,
            )
        )

    def query(
        self,
    ) -> T_DomainModelList:
        """Execute query and return the result.

        Returns:
            The list of the source nodes of the query.

        """
        return self._query()

query()

Execute query and return the result.

Returns:

Type Description
T_DomainModelList

The list of the source nodes of the query.

Source code in examples/windmill/_api/main_shaft_query.py
def query(
    self,
) -> T_DomainModelList:
    """Execute query and return the result.

    Returns:
        The list of the source nodes of the query.

    """
    return self._query()

MainShaftTorqueAPI

Source code in examples/windmill/_api/main_shaft_torque.py
class MainShaftTorqueAPI:
    def __init__(self, client: CogniteClient, view_id: dm.ViewId):
        self._client = client
        self._view_id = view_id

    def __call__(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> MainShaftTorqueQuery:
        """Query timeseries `main_shaft.torque`

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query object that can be used to retrieve datapoins for the main_shaft.torque timeseries
            selected in this method.

        Examples:

            Retrieve all data for 5 main_shaft.torque timeseries:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> main_shafts = client.main_shaft.torque(limit=5).retrieve()

        """
        filter_ = _create_main_shaft_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )

        return MainShaftTorqueQuery(
            client=self._client,
            view_id=self._view_id,
            timeseries_limit=limit,
            filter=filter_,
        )

    def list(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> TimeSeriesList:
        """List timeseries `main_shaft.torque`

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            List of Timeseries main_shaft.torque.

        Examples:

            List main_shaft.torque and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> main_shafts = client.main_shaft.torque.list(limit=5)

        """
        filter_ = _create_main_shaft_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )
        external_ids = _retrieve_timeseries_external_ids_with_extra_torque(self._client, self._view_id, filter_, limit)
        if external_ids:
            return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
        else:
            return TimeSeriesList([])

__call__(external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Query timeseries main_shaft.torque

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
MainShaftTorqueQuery

A query object that can be used to retrieve datapoins for the main_shaft.torque timeseries

MainShaftTorqueQuery

selected in this method.

Examples:

Retrieve all data for 5 main_shaft.torque timeseries:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> main_shafts = client.main_shaft.torque(limit=5).retrieve()
Source code in examples/windmill/_api/main_shaft_torque.py
def __call__(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> MainShaftTorqueQuery:
    """Query timeseries `main_shaft.torque`

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query object that can be used to retrieve datapoins for the main_shaft.torque timeseries
        selected in this method.

    Examples:

        Retrieve all data for 5 main_shaft.torque timeseries:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> main_shafts = client.main_shaft.torque(limit=5).retrieve()

    """
    filter_ = _create_main_shaft_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )

    return MainShaftTorqueQuery(
        client=self._client,
        view_id=self._view_id,
        timeseries_limit=limit,
        filter=filter_,
    )

list(external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

List timeseries main_shaft.torque

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
TimeSeriesList

List of Timeseries main_shaft.torque.

Examples:

List main_shaft.torque and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> main_shafts = client.main_shaft.torque.list(limit=5)
Source code in examples/windmill/_api/main_shaft_torque.py
def list(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> TimeSeriesList:
    """List timeseries `main_shaft.torque`

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of main shafts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        List of Timeseries main_shaft.torque.

    Examples:

        List main_shaft.torque and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> main_shafts = client.main_shaft.torque.list(limit=5)

    """
    filter_ = _create_main_shaft_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )
    external_ids = _retrieve_timeseries_external_ids_with_extra_torque(self._client, self._view_id, filter_, limit)
    if external_ids:
        return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
    else:
        return TimeSeriesList([])

MetmastAPI

Bases: NodeAPI[Metmast, MetmastWrite, MetmastList, MetmastWriteList]

Source code in examples/windmill/_api/metmast.py
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
class MetmastAPI(NodeAPI[Metmast, MetmastWrite, MetmastList, MetmastWriteList]):
    _view_id = dm.ViewId("power-models", "Metmast", "1")
    _properties_by_field = _METMAST_PROPERTIES_BY_FIELD
    _class_type = Metmast
    _class_list = MetmastList
    _class_write_list = MetmastWriteList

    def __init__(self, client: CogniteClient):
        super().__init__(client=client)

        self.temperature = MetmastTemperatureAPI(client, self._view_id)
        self.tilt_angle = MetmastTiltAngleAPI(client, self._view_id)
        self.wind_speed = MetmastWindSpeedAPI(client, self._view_id)

    def __call__(
        self,
        min_position: float | None = None,
        max_position: float | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_QUERY_LIMIT,
        filter: dm.Filter | None = None,
    ) -> MetmastQueryAPI[MetmastList]:
        """Query starting at metmasts.

        Args:
            min_position: The minimum value of the position to filter on.
            max_position: The maximum value of the position to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of metmasts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query API for metmasts.

        """
        has_data = dm.filters.HasData(views=[self._view_id])
        filter_ = _create_metmast_filter(
            self._view_id,
            min_position,
            max_position,
            external_id_prefix,
            space,
            (filter and dm.filters.And(filter, has_data)) or has_data,
        )
        builder = QueryBuilder(MetmastList)
        return MetmastQueryAPI(self._client, builder, filter_, limit)

    def apply(
        self,
        metmast: MetmastWrite | Sequence[MetmastWrite],
        replace: bool = False,
        write_none: bool = False,
    ) -> ResourcesWriteResult:
        """Add or update (upsert) metmasts.

        Args:
            metmast: Metmast or sequence of metmasts to upsert.
            replace (bool): How do we behave when a property value exists? Do we replace all matching and existing values with the supplied values (true)?
                Or should we merge in new values for properties together with the existing values (false)? Note: This setting applies for all nodes or edges specified in the ingestion call.
            write_none (bool): This method, will by default, skip properties that are set to None. However, if you want to set properties to None,
                you can set this parameter to True. Note this only applies to properties that are nullable.
        Returns:
            Created instance(s), i.e., nodes, edges, and time series.

        Examples:

            Create a new metmast:

                >>> from windmill import WindmillClient
                >>> from windmill.data_classes import MetmastWrite
                >>> client = WindmillClient()
                >>> metmast = MetmastWrite(external_id="my_metmast", ...)
                >>> result = client.metmast.apply(metmast)

        """
        warnings.warn(
            "The .apply method is deprecated and will be removed in v1.0. "
            "Please use the .upsert method on the client instead. This means instead of "
            "`my_client.metmast.apply(my_items)` please use `my_client.upsert(my_items)`."
            "The motivation is that all apply methods are the same, and having one apply method per API "
            " class encourages users to create items in small batches, which is inefficient."
            "In addition, .upsert method is more descriptive of what the method does.",
            UserWarning,
            stacklevel=2,
        )
        return self._apply(metmast, replace, write_none)

    def delete(
        self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
    ) -> dm.InstancesDeleteResult:
        """Delete one or more metmast.

        Args:
            external_id: External id of the metmast to delete.
            space: The space where all the metmast are located.

        Returns:
            The instance(s), i.e., nodes and edges which has been deleted. Empty list if nothing was deleted.

        Examples:

            Delete metmast by id:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> client.metmast.delete("my_metmast")
        """
        warnings.warn(
            "The .delete method is deprecated and will be removed in v1.0. "
            "Please use the .delete method on the client instead. This means instead of "
            "`my_client.metmast.delete(my_ids)` please use `my_client.delete(my_ids)`."
            "The motivation is that all delete methods are the same, and having one delete method per API "
            " class encourages users to delete items in small batches, which is inefficient.",
            UserWarning,
            stacklevel=2,
        )
        return self._delete(external_id, space)

    @overload
    def retrieve(self, external_id: str, space: str = DEFAULT_INSTANCE_SPACE) -> Metmast | None: ...

    @overload
    def retrieve(self, external_id: SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE) -> MetmastList: ...

    def retrieve(
        self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
    ) -> Metmast | MetmastList | None:
        """Retrieve one or more metmasts by id(s).

        Args:
            external_id: External id or list of external ids of the metmasts.
            space: The space where all the metmasts are located.

        Returns:
            The requested metmasts.

        Examples:

            Retrieve metmast by id:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> metmast = client.metmast.retrieve("my_metmast")

        """
        return self._retrieve(external_id, space)

    def search(
        self,
        query: str,
        properties: MetmastTextFields | SequenceNotStr[MetmastTextFields] | None = None,
        min_position: float | None = None,
        max_position: float | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
        sort_by: MetmastFields | SequenceNotStr[MetmastFields] | None = None,
        direction: Literal["ascending", "descending"] = "ascending",
        sort: InstanceSort | list[InstanceSort] | None = None,
    ) -> MetmastList:
        """Search metmasts

        Args:
            query: The search query,
            properties: The property to search, if nothing is passed all text fields will be searched.
            min_position: The minimum value of the position to filter on.
            max_position: The maximum value of the position to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of metmasts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
            sort_by: The property to sort by.
            direction: The direction to sort by, either 'ascending' or 'descending'.
            sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
                This will override the sort_by and direction. This allowos you to sort by multiple fields and
                specify the direction for each field as well as how to handle null values.

        Returns:
            Search results metmasts matching the query.

        Examples:

           Search for 'my_metmast' in all text properties:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> metmasts = client.metmast.search('my_metmast')

        """
        filter_ = _create_metmast_filter(
            self._view_id,
            min_position,
            max_position,
            external_id_prefix,
            space,
            filter,
        )
        return self._search(
            query=query,
            properties=properties,
            filter_=filter_,
            limit=limit,
            sort_by=sort_by,  # type: ignore[arg-type]
            direction=direction,
            sort=sort,
        )

    @overload
    def aggregate(
        self,
        aggregate: Aggregations | dm.aggregations.MetricAggregation,
        group_by: None = None,
        property: MetmastFields | SequenceNotStr[MetmastFields] | None = None,
        min_position: float | None = None,
        max_position: float | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> dm.aggregations.AggregatedNumberedValue: ...

    @overload
    def aggregate(
        self,
        aggregate: SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation],
        group_by: None = None,
        property: MetmastFields | SequenceNotStr[MetmastFields] | None = None,
        min_position: float | None = None,
        max_position: float | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> list[dm.aggregations.AggregatedNumberedValue]: ...

    @overload
    def aggregate(
        self,
        aggregate: (
            Aggregations
            | dm.aggregations.MetricAggregation
            | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation]
        ),
        group_by: MetmastFields | SequenceNotStr[MetmastFields],
        property: MetmastFields | SequenceNotStr[MetmastFields] | None = None,
        min_position: float | None = None,
        max_position: float | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> InstanceAggregationResultList: ...

    def aggregate(
        self,
        aggregate: (
            Aggregations
            | dm.aggregations.MetricAggregation
            | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation]
        ),
        group_by: MetmastFields | SequenceNotStr[MetmastFields] | None = None,
        property: MetmastFields | SequenceNotStr[MetmastFields] | None = None,
        min_position: float | None = None,
        max_position: float | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> (
        dm.aggregations.AggregatedNumberedValue
        | list[dm.aggregations.AggregatedNumberedValue]
        | InstanceAggregationResultList
    ):
        """Aggregate data across metmasts

        Args:
            aggregate: The aggregation to perform.
            group_by: The property to group by when doing the aggregation.
            property: The property to perform aggregation on.
            min_position: The minimum value of the position to filter on.
            max_position: The maximum value of the position to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of metmasts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            Aggregation results.

        Examples:

            Count metmasts in space `my_space`:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> result = client.metmast.aggregate("count", space="my_space")

        """

        filter_ = _create_metmast_filter(
            self._view_id,
            min_position,
            max_position,
            external_id_prefix,
            space,
            filter,
        )
        return self._aggregate(
            aggregate=aggregate,
            group_by=group_by,  # type: ignore[arg-type]
            properties=property,  # type: ignore[arg-type]
            query=None,
            search_properties=None,
            limit=limit,
            filter=filter_,
        )

    def histogram(
        self,
        property: MetmastFields,
        interval: float,
        min_position: float | None = None,
        max_position: float | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> dm.aggregations.HistogramValue:
        """Produces histograms for metmasts

        Args:
            property: The property to use as the value in the histogram.
            interval: The interval to use for the histogram bins.
            min_position: The minimum value of the position to filter on.
            max_position: The maximum value of the position to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of metmasts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            Bucketed histogram results.

        """
        filter_ = _create_metmast_filter(
            self._view_id,
            min_position,
            max_position,
            external_id_prefix,
            space,
            filter,
        )
        return self._histogram(
            property,
            interval,
            None,
            None,
            limit,
            filter_,
        )

    def query(self) -> MetmastQuery:
        """Start a query for metmasts."""
        warnings.warn("The .query is in alpha and is subject to breaking changes without notice.")
        return MetmastQuery(self._client)

    def list(
        self,
        min_position: float | None = None,
        max_position: float | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
        sort_by: MetmastFields | Sequence[MetmastFields] | None = None,
        direction: Literal["ascending", "descending"] = "ascending",
        sort: InstanceSort | list[InstanceSort] | None = None,
    ) -> MetmastList:
        """List/filter metmasts

        Args:
            min_position: The minimum value of the position to filter on.
            max_position: The maximum value of the position to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of metmasts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
            sort_by: The property to sort by.
            direction: The direction to sort by, either 'ascending' or 'descending'.
            sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
                This will override the sort_by and direction. This allowos you to sort by multiple fields and
                specify the direction for each field as well as how to handle null values.

        Returns:
            List of requested metmasts

        Examples:

            List metmasts and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> metmasts = client.metmast.list(limit=5)

        """
        filter_ = _create_metmast_filter(
            self._view_id,
            min_position,
            max_position,
            external_id_prefix,
            space,
            filter,
        )

        return self._list(
            limit=limit,
            filter=filter_,
            sort_by=sort_by,  # type: ignore[arg-type]
            direction=direction,
            sort=sort,
        )

__call__(min_position=None, max_position=None, external_id_prefix=None, space=None, limit=DEFAULT_QUERY_LIMIT, filter=None)

Query starting at metmasts.

Parameters:

Name Type Description Default
min_position float | None

The minimum value of the position to filter on.

None
max_position float | None

The maximum value of the position to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of metmasts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_QUERY_LIMIT
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
MetmastQueryAPI[MetmastList]

A query API for metmasts.

Source code in examples/windmill/_api/metmast.py
def __call__(
    self,
    min_position: float | None = None,
    max_position: float | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_QUERY_LIMIT,
    filter: dm.Filter | None = None,
) -> MetmastQueryAPI[MetmastList]:
    """Query starting at metmasts.

    Args:
        min_position: The minimum value of the position to filter on.
        max_position: The maximum value of the position to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of metmasts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query API for metmasts.

    """
    has_data = dm.filters.HasData(views=[self._view_id])
    filter_ = _create_metmast_filter(
        self._view_id,
        min_position,
        max_position,
        external_id_prefix,
        space,
        (filter and dm.filters.And(filter, has_data)) or has_data,
    )
    builder = QueryBuilder(MetmastList)
    return MetmastQueryAPI(self._client, builder, filter_, limit)

aggregate(aggregate, group_by=None, property=None, min_position=None, max_position=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

aggregate(aggregate: Aggregations | dm.aggregations.MetricAggregation, group_by: None = None, property: MetmastFields | SequenceNotStr[MetmastFields] | None = None, min_position: float | None = None, max_position: float | None = None, external_id_prefix: str | None = None, space: str | list[str] | None = None, limit: int = DEFAULT_LIMIT_READ, filter: dm.Filter | None = None) -> dm.aggregations.AggregatedNumberedValue
aggregate(aggregate: SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation], group_by: None = None, property: MetmastFields | SequenceNotStr[MetmastFields] | None = None, min_position: float | None = None, max_position: float | None = None, external_id_prefix: str | None = None, space: str | list[str] | None = None, limit: int = DEFAULT_LIMIT_READ, filter: dm.Filter | None = None) -> list[dm.aggregations.AggregatedNumberedValue]
aggregate(aggregate: Aggregations | dm.aggregations.MetricAggregation | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation], group_by: MetmastFields | SequenceNotStr[MetmastFields], property: MetmastFields | SequenceNotStr[MetmastFields] | None = None, min_position: float | None = None, max_position: float | None = None, external_id_prefix: str | None = None, space: str | list[str] | None = None, limit: int = DEFAULT_LIMIT_READ, filter: dm.Filter | None = None) -> InstanceAggregationResultList

Aggregate data across metmasts

Parameters:

Name Type Description Default
aggregate Aggregations | MetricAggregation | SequenceNotStr[Aggregations | MetricAggregation]

The aggregation to perform.

required
group_by MetmastFields | SequenceNotStr[MetmastFields] | None

The property to group by when doing the aggregation.

None
property MetmastFields | SequenceNotStr[MetmastFields] | None

The property to perform aggregation on.

None
min_position float | None

The minimum value of the position to filter on.

None
max_position float | None

The maximum value of the position to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of metmasts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
AggregatedNumberedValue | list[AggregatedNumberedValue] | InstanceAggregationResultList

Aggregation results.

Examples:

Count metmasts in space `my_space`:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> result = client.metmast.aggregate("count", space="my_space")
Source code in examples/windmill/_api/metmast.py
def aggregate(
    self,
    aggregate: (
        Aggregations
        | dm.aggregations.MetricAggregation
        | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation]
    ),
    group_by: MetmastFields | SequenceNotStr[MetmastFields] | None = None,
    property: MetmastFields | SequenceNotStr[MetmastFields] | None = None,
    min_position: float | None = None,
    max_position: float | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> (
    dm.aggregations.AggregatedNumberedValue
    | list[dm.aggregations.AggregatedNumberedValue]
    | InstanceAggregationResultList
):
    """Aggregate data across metmasts

    Args:
        aggregate: The aggregation to perform.
        group_by: The property to group by when doing the aggregation.
        property: The property to perform aggregation on.
        min_position: The minimum value of the position to filter on.
        max_position: The maximum value of the position to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of metmasts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        Aggregation results.

    Examples:

        Count metmasts in space `my_space`:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> result = client.metmast.aggregate("count", space="my_space")

    """

    filter_ = _create_metmast_filter(
        self._view_id,
        min_position,
        max_position,
        external_id_prefix,
        space,
        filter,
    )
    return self._aggregate(
        aggregate=aggregate,
        group_by=group_by,  # type: ignore[arg-type]
        properties=property,  # type: ignore[arg-type]
        query=None,
        search_properties=None,
        limit=limit,
        filter=filter_,
    )

apply(metmast, replace=False, write_none=False)

Add or update (upsert) metmasts.

Parameters:

Name Type Description Default
metmast MetmastWrite | Sequence[MetmastWrite]

Metmast or sequence of metmasts to upsert.

required
replace bool

How do we behave when a property value exists? Do we replace all matching and existing values with the supplied values (true)? Or should we merge in new values for properties together with the existing values (false)? Note: This setting applies for all nodes or edges specified in the ingestion call.

False
write_none bool

This method, will by default, skip properties that are set to None. However, if you want to set properties to None, you can set this parameter to True. Note this only applies to properties that are nullable.

False

Returns: Created instance(s), i.e., nodes, edges, and time series.

Examples:

Create a new metmast:

    >>> from windmill import WindmillClient
    >>> from windmill.data_classes import MetmastWrite
    >>> client = WindmillClient()
    >>> metmast = MetmastWrite(external_id="my_metmast", ...)
    >>> result = client.metmast.apply(metmast)
Source code in examples/windmill/_api/metmast.py
def apply(
    self,
    metmast: MetmastWrite | Sequence[MetmastWrite],
    replace: bool = False,
    write_none: bool = False,
) -> ResourcesWriteResult:
    """Add or update (upsert) metmasts.

    Args:
        metmast: Metmast or sequence of metmasts to upsert.
        replace (bool): How do we behave when a property value exists? Do we replace all matching and existing values with the supplied values (true)?
            Or should we merge in new values for properties together with the existing values (false)? Note: This setting applies for all nodes or edges specified in the ingestion call.
        write_none (bool): This method, will by default, skip properties that are set to None. However, if you want to set properties to None,
            you can set this parameter to True. Note this only applies to properties that are nullable.
    Returns:
        Created instance(s), i.e., nodes, edges, and time series.

    Examples:

        Create a new metmast:

            >>> from windmill import WindmillClient
            >>> from windmill.data_classes import MetmastWrite
            >>> client = WindmillClient()
            >>> metmast = MetmastWrite(external_id="my_metmast", ...)
            >>> result = client.metmast.apply(metmast)

    """
    warnings.warn(
        "The .apply method is deprecated and will be removed in v1.0. "
        "Please use the .upsert method on the client instead. This means instead of "
        "`my_client.metmast.apply(my_items)` please use `my_client.upsert(my_items)`."
        "The motivation is that all apply methods are the same, and having one apply method per API "
        " class encourages users to create items in small batches, which is inefficient."
        "In addition, .upsert method is more descriptive of what the method does.",
        UserWarning,
        stacklevel=2,
    )
    return self._apply(metmast, replace, write_none)

delete(external_id, space=DEFAULT_INSTANCE_SPACE)

Delete one or more metmast.

Parameters:

Name Type Description Default
external_id str | SequenceNotStr[str]

External id of the metmast to delete.

required
space str

The space where all the metmast are located.

DEFAULT_INSTANCE_SPACE

Returns:

Type Description
InstancesDeleteResult

The instance(s), i.e., nodes and edges which has been deleted. Empty list if nothing was deleted.

Examples:

Delete metmast by id:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> client.metmast.delete("my_metmast")
Source code in examples/windmill/_api/metmast.py
def delete(
    self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
) -> dm.InstancesDeleteResult:
    """Delete one or more metmast.

    Args:
        external_id: External id of the metmast to delete.
        space: The space where all the metmast are located.

    Returns:
        The instance(s), i.e., nodes and edges which has been deleted. Empty list if nothing was deleted.

    Examples:

        Delete metmast by id:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> client.metmast.delete("my_metmast")
    """
    warnings.warn(
        "The .delete method is deprecated and will be removed in v1.0. "
        "Please use the .delete method on the client instead. This means instead of "
        "`my_client.metmast.delete(my_ids)` please use `my_client.delete(my_ids)`."
        "The motivation is that all delete methods are the same, and having one delete method per API "
        " class encourages users to delete items in small batches, which is inefficient.",
        UserWarning,
        stacklevel=2,
    )
    return self._delete(external_id, space)

histogram(property, interval, min_position=None, max_position=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Produces histograms for metmasts

Parameters:

Name Type Description Default
property MetmastFields

The property to use as the value in the histogram.

required
interval float

The interval to use for the histogram bins.

required
min_position float | None

The minimum value of the position to filter on.

None
max_position float | None

The maximum value of the position to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of metmasts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
HistogramValue

Bucketed histogram results.

Source code in examples/windmill/_api/metmast.py
def histogram(
    self,
    property: MetmastFields,
    interval: float,
    min_position: float | None = None,
    max_position: float | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> dm.aggregations.HistogramValue:
    """Produces histograms for metmasts

    Args:
        property: The property to use as the value in the histogram.
        interval: The interval to use for the histogram bins.
        min_position: The minimum value of the position to filter on.
        max_position: The maximum value of the position to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of metmasts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        Bucketed histogram results.

    """
    filter_ = _create_metmast_filter(
        self._view_id,
        min_position,
        max_position,
        external_id_prefix,
        space,
        filter,
    )
    return self._histogram(
        property,
        interval,
        None,
        None,
        limit,
        filter_,
    )

list(min_position=None, max_position=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None, sort_by=None, direction='ascending', sort=None)

List/filter metmasts

Parameters:

Name Type Description Default
min_position float | None

The minimum value of the position to filter on.

None
max_position float | None

The maximum value of the position to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of metmasts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None
sort_by MetmastFields | Sequence[MetmastFields] | None

The property to sort by.

None
direction Literal['ascending', 'descending']

The direction to sort by, either 'ascending' or 'descending'.

'ascending'
sort InstanceSort | list[InstanceSort] | None

(Advanced) If sort_by and direction are not sufficient, you can write your own sorting. This will override the sort_by and direction. This allowos you to sort by multiple fields and specify the direction for each field as well as how to handle null values.

None

Returns:

Type Description
MetmastList

List of requested metmasts

Examples:

List metmasts and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> metmasts = client.metmast.list(limit=5)
Source code in examples/windmill/_api/metmast.py
def list(
    self,
    min_position: float | None = None,
    max_position: float | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
    sort_by: MetmastFields | Sequence[MetmastFields] | None = None,
    direction: Literal["ascending", "descending"] = "ascending",
    sort: InstanceSort | list[InstanceSort] | None = None,
) -> MetmastList:
    """List/filter metmasts

    Args:
        min_position: The minimum value of the position to filter on.
        max_position: The maximum value of the position to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of metmasts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
        sort_by: The property to sort by.
        direction: The direction to sort by, either 'ascending' or 'descending'.
        sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
            This will override the sort_by and direction. This allowos you to sort by multiple fields and
            specify the direction for each field as well as how to handle null values.

    Returns:
        List of requested metmasts

    Examples:

        List metmasts and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> metmasts = client.metmast.list(limit=5)

    """
    filter_ = _create_metmast_filter(
        self._view_id,
        min_position,
        max_position,
        external_id_prefix,
        space,
        filter,
    )

    return self._list(
        limit=limit,
        filter=filter_,
        sort_by=sort_by,  # type: ignore[arg-type]
        direction=direction,
        sort=sort,
    )

query()

Start a query for metmasts.

Source code in examples/windmill/_api/metmast.py
def query(self) -> MetmastQuery:
    """Start a query for metmasts."""
    warnings.warn("The .query is in alpha and is subject to breaking changes without notice.")
    return MetmastQuery(self._client)

retrieve(external_id, space=DEFAULT_INSTANCE_SPACE)

retrieve(external_id: str, space: str = DEFAULT_INSTANCE_SPACE) -> Metmast | None
retrieve(external_id: SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE) -> MetmastList

Retrieve one or more metmasts by id(s).

Parameters:

Name Type Description Default
external_id str | SequenceNotStr[str]

External id or list of external ids of the metmasts.

required
space str

The space where all the metmasts are located.

DEFAULT_INSTANCE_SPACE

Returns:

Type Description
Metmast | MetmastList | None

The requested metmasts.

Examples:

Retrieve metmast by id:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> metmast = client.metmast.retrieve("my_metmast")
Source code in examples/windmill/_api/metmast.py
def retrieve(
    self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
) -> Metmast | MetmastList | None:
    """Retrieve one or more metmasts by id(s).

    Args:
        external_id: External id or list of external ids of the metmasts.
        space: The space where all the metmasts are located.

    Returns:
        The requested metmasts.

    Examples:

        Retrieve metmast by id:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> metmast = client.metmast.retrieve("my_metmast")

    """
    return self._retrieve(external_id, space)

search(query, properties=None, min_position=None, max_position=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None, sort_by=None, direction='ascending', sort=None)

Search metmasts

Parameters:

Name Type Description Default
query str

The search query,

required
properties MetmastTextFields | SequenceNotStr[MetmastTextFields] | None

The property to search, if nothing is passed all text fields will be searched.

None
min_position float | None

The minimum value of the position to filter on.

None
max_position float | None

The maximum value of the position to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of metmasts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None
sort_by MetmastFields | SequenceNotStr[MetmastFields] | None

The property to sort by.

None
direction Literal['ascending', 'descending']

The direction to sort by, either 'ascending' or 'descending'.

'ascending'
sort InstanceSort | list[InstanceSort] | None

(Advanced) If sort_by and direction are not sufficient, you can write your own sorting. This will override the sort_by and direction. This allowos you to sort by multiple fields and specify the direction for each field as well as how to handle null values.

None

Returns:

Type Description
MetmastList

Search results metmasts matching the query.

Examples:

Search for 'my_metmast' in all text properties:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> metmasts = client.metmast.search('my_metmast')
Source code in examples/windmill/_api/metmast.py
def search(
    self,
    query: str,
    properties: MetmastTextFields | SequenceNotStr[MetmastTextFields] | None = None,
    min_position: float | None = None,
    max_position: float | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
    sort_by: MetmastFields | SequenceNotStr[MetmastFields] | None = None,
    direction: Literal["ascending", "descending"] = "ascending",
    sort: InstanceSort | list[InstanceSort] | None = None,
) -> MetmastList:
    """Search metmasts

    Args:
        query: The search query,
        properties: The property to search, if nothing is passed all text fields will be searched.
        min_position: The minimum value of the position to filter on.
        max_position: The maximum value of the position to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of metmasts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
        sort_by: The property to sort by.
        direction: The direction to sort by, either 'ascending' or 'descending'.
        sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
            This will override the sort_by and direction. This allowos you to sort by multiple fields and
            specify the direction for each field as well as how to handle null values.

    Returns:
        Search results metmasts matching the query.

    Examples:

       Search for 'my_metmast' in all text properties:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> metmasts = client.metmast.search('my_metmast')

    """
    filter_ = _create_metmast_filter(
        self._view_id,
        min_position,
        max_position,
        external_id_prefix,
        space,
        filter,
    )
    return self._search(
        query=query,
        properties=properties,
        filter_=filter_,
        limit=limit,
        sort_by=sort_by,  # type: ignore[arg-type]
        direction=direction,
        sort=sort,
    )

MetmastQueryAPI

Bases: QueryAPI[T_DomainModelList]

Source code in examples/windmill/_api/metmast_query.py
class MetmastQueryAPI(QueryAPI[T_DomainModelList]):
    _view_id = dm.ViewId("power-models", "Metmast", "1")

    def __init__(
        self,
        client: CogniteClient,
        builder: QueryBuilder[T_DomainModelList],
        filter_: dm.filters.Filter | None = None,
        limit: int = DEFAULT_QUERY_LIMIT,
    ):
        super().__init__(client, builder)
        from_ = self._builder.get_from()
        self._builder.append(
            NodeQueryStep(
                name=self._builder.create_name(from_),
                expression=dm.query.NodeResultSetExpression(
                    from_=from_,
                    filter=filter_,
                ),
                result_cls=Metmast,
                max_retrieve_limit=limit,
            )
        )

    def query(
        self,
    ) -> T_DomainModelList:
        """Execute query and return the result.

        Returns:
            The list of the source nodes of the query.

        """
        return self._query()

query()

Execute query and return the result.

Returns:

Type Description
T_DomainModelList

The list of the source nodes of the query.

Source code in examples/windmill/_api/metmast_query.py
def query(
    self,
) -> T_DomainModelList:
    """Execute query and return the result.

    Returns:
        The list of the source nodes of the query.

    """
    return self._query()

MetmastTemperatureAPI

Source code in examples/windmill/_api/metmast_temperature.py
class MetmastTemperatureAPI:
    def __init__(self, client: CogniteClient, view_id: dm.ViewId):
        self._client = client
        self._view_id = view_id

    def __call__(
        self,
        min_position: float | None = None,
        max_position: float | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> MetmastTemperatureQuery:
        """Query timeseries `metmast.temperature`

        Args:
            min_position: The minimum value of the position to filter on.
            max_position: The maximum value of the position to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of metmasts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query object that can be used to retrieve datapoins for the metmast.temperature timeseries
            selected in this method.

        Examples:

            Retrieve all data for 5 metmast.temperature timeseries:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> metmasts = client.metmast.temperature(limit=5).retrieve()

        """
        filter_ = _create_metmast_filter(
            self._view_id,
            min_position,
            max_position,
            external_id_prefix,
            space,
            filter,
        )

        return MetmastTemperatureQuery(
            client=self._client,
            view_id=self._view_id,
            timeseries_limit=limit,
            filter=filter_,
        )

    def list(
        self,
        min_position: float | None = None,
        max_position: float | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> TimeSeriesList:
        """List timeseries `metmast.temperature`

        Args:
            min_position: The minimum value of the position to filter on.
            max_position: The maximum value of the position to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of metmasts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            List of Timeseries metmast.temperature.

        Examples:

            List metmast.temperature and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> metmasts = client.metmast.temperature.list(limit=5)

        """
        filter_ = _create_metmast_filter(
            self._view_id,
            min_position,
            max_position,
            external_id_prefix,
            space,
            filter,
        )
        external_ids = _retrieve_timeseries_external_ids_with_extra_temperature(
            self._client, self._view_id, filter_, limit
        )
        if external_ids:
            return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
        else:
            return TimeSeriesList([])

__call__(min_position=None, max_position=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Query timeseries metmast.temperature

Parameters:

Name Type Description Default
min_position float | None

The minimum value of the position to filter on.

None
max_position float | None

The maximum value of the position to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of metmasts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
MetmastTemperatureQuery

A query object that can be used to retrieve datapoins for the metmast.temperature timeseries

MetmastTemperatureQuery

selected in this method.

Examples:

Retrieve all data for 5 metmast.temperature timeseries:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> metmasts = client.metmast.temperature(limit=5).retrieve()
Source code in examples/windmill/_api/metmast_temperature.py
def __call__(
    self,
    min_position: float | None = None,
    max_position: float | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> MetmastTemperatureQuery:
    """Query timeseries `metmast.temperature`

    Args:
        min_position: The minimum value of the position to filter on.
        max_position: The maximum value of the position to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of metmasts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query object that can be used to retrieve datapoins for the metmast.temperature timeseries
        selected in this method.

    Examples:

        Retrieve all data for 5 metmast.temperature timeseries:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> metmasts = client.metmast.temperature(limit=5).retrieve()

    """
    filter_ = _create_metmast_filter(
        self._view_id,
        min_position,
        max_position,
        external_id_prefix,
        space,
        filter,
    )

    return MetmastTemperatureQuery(
        client=self._client,
        view_id=self._view_id,
        timeseries_limit=limit,
        filter=filter_,
    )

list(min_position=None, max_position=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

List timeseries metmast.temperature

Parameters:

Name Type Description Default
min_position float | None

The minimum value of the position to filter on.

None
max_position float | None

The maximum value of the position to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of metmasts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
TimeSeriesList

List of Timeseries metmast.temperature.

Examples:

List metmast.temperature and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> metmasts = client.metmast.temperature.list(limit=5)
Source code in examples/windmill/_api/metmast_temperature.py
def list(
    self,
    min_position: float | None = None,
    max_position: float | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> TimeSeriesList:
    """List timeseries `metmast.temperature`

    Args:
        min_position: The minimum value of the position to filter on.
        max_position: The maximum value of the position to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of metmasts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        List of Timeseries metmast.temperature.

    Examples:

        List metmast.temperature and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> metmasts = client.metmast.temperature.list(limit=5)

    """
    filter_ = _create_metmast_filter(
        self._view_id,
        min_position,
        max_position,
        external_id_prefix,
        space,
        filter,
    )
    external_ids = _retrieve_timeseries_external_ids_with_extra_temperature(
        self._client, self._view_id, filter_, limit
    )
    if external_ids:
        return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
    else:
        return TimeSeriesList([])

MetmastTiltAngleAPI

Source code in examples/windmill/_api/metmast_tilt_angle.py
class MetmastTiltAngleAPI:
    def __init__(self, client: CogniteClient, view_id: dm.ViewId):
        self._client = client
        self._view_id = view_id

    def __call__(
        self,
        min_position: float | None = None,
        max_position: float | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> MetmastTiltAngleQuery:
        """Query timeseries `metmast.tilt_angle`

        Args:
            min_position: The minimum value of the position to filter on.
            max_position: The maximum value of the position to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of metmasts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query object that can be used to retrieve datapoins for the metmast.tilt_angle timeseries
            selected in this method.

        Examples:

            Retrieve all data for 5 metmast.tilt_angle timeseries:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> metmasts = client.metmast.tilt_angle(limit=5).retrieve()

        """
        filter_ = _create_metmast_filter(
            self._view_id,
            min_position,
            max_position,
            external_id_prefix,
            space,
            filter,
        )

        return MetmastTiltAngleQuery(
            client=self._client,
            view_id=self._view_id,
            timeseries_limit=limit,
            filter=filter_,
        )

    def list(
        self,
        min_position: float | None = None,
        max_position: float | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> TimeSeriesList:
        """List timeseries `metmast.tilt_angle`

        Args:
            min_position: The minimum value of the position to filter on.
            max_position: The maximum value of the position to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of metmasts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            List of Timeseries metmast.tilt_angle.

        Examples:

            List metmast.tilt_angle and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> metmasts = client.metmast.tilt_angle.list(limit=5)

        """
        filter_ = _create_metmast_filter(
            self._view_id,
            min_position,
            max_position,
            external_id_prefix,
            space,
            filter,
        )
        external_ids = _retrieve_timeseries_external_ids_with_extra_tilt_angle(
            self._client, self._view_id, filter_, limit
        )
        if external_ids:
            return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
        else:
            return TimeSeriesList([])

__call__(min_position=None, max_position=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Query timeseries metmast.tilt_angle

Parameters:

Name Type Description Default
min_position float | None

The minimum value of the position to filter on.

None
max_position float | None

The maximum value of the position to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of metmasts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
MetmastTiltAngleQuery

A query object that can be used to retrieve datapoins for the metmast.tilt_angle timeseries

MetmastTiltAngleQuery

selected in this method.

Examples:

Retrieve all data for 5 metmast.tilt_angle timeseries:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> metmasts = client.metmast.tilt_angle(limit=5).retrieve()
Source code in examples/windmill/_api/metmast_tilt_angle.py
def __call__(
    self,
    min_position: float | None = None,
    max_position: float | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> MetmastTiltAngleQuery:
    """Query timeseries `metmast.tilt_angle`

    Args:
        min_position: The minimum value of the position to filter on.
        max_position: The maximum value of the position to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of metmasts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query object that can be used to retrieve datapoins for the metmast.tilt_angle timeseries
        selected in this method.

    Examples:

        Retrieve all data for 5 metmast.tilt_angle timeseries:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> metmasts = client.metmast.tilt_angle(limit=5).retrieve()

    """
    filter_ = _create_metmast_filter(
        self._view_id,
        min_position,
        max_position,
        external_id_prefix,
        space,
        filter,
    )

    return MetmastTiltAngleQuery(
        client=self._client,
        view_id=self._view_id,
        timeseries_limit=limit,
        filter=filter_,
    )

list(min_position=None, max_position=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

List timeseries metmast.tilt_angle

Parameters:

Name Type Description Default
min_position float | None

The minimum value of the position to filter on.

None
max_position float | None

The maximum value of the position to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of metmasts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
TimeSeriesList

List of Timeseries metmast.tilt_angle.

Examples:

List metmast.tilt_angle and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> metmasts = client.metmast.tilt_angle.list(limit=5)
Source code in examples/windmill/_api/metmast_tilt_angle.py
def list(
    self,
    min_position: float | None = None,
    max_position: float | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> TimeSeriesList:
    """List timeseries `metmast.tilt_angle`

    Args:
        min_position: The minimum value of the position to filter on.
        max_position: The maximum value of the position to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of metmasts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        List of Timeseries metmast.tilt_angle.

    Examples:

        List metmast.tilt_angle and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> metmasts = client.metmast.tilt_angle.list(limit=5)

    """
    filter_ = _create_metmast_filter(
        self._view_id,
        min_position,
        max_position,
        external_id_prefix,
        space,
        filter,
    )
    external_ids = _retrieve_timeseries_external_ids_with_extra_tilt_angle(
        self._client, self._view_id, filter_, limit
    )
    if external_ids:
        return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
    else:
        return TimeSeriesList([])

MetmastWindSpeedAPI

Source code in examples/windmill/_api/metmast_wind_speed.py
class MetmastWindSpeedAPI:
    def __init__(self, client: CogniteClient, view_id: dm.ViewId):
        self._client = client
        self._view_id = view_id

    def __call__(
        self,
        min_position: float | None = None,
        max_position: float | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> MetmastWindSpeedQuery:
        """Query timeseries `metmast.wind_speed`

        Args:
            min_position: The minimum value of the position to filter on.
            max_position: The maximum value of the position to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of metmasts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query object that can be used to retrieve datapoins for the metmast.wind_speed timeseries
            selected in this method.

        Examples:

            Retrieve all data for 5 metmast.wind_speed timeseries:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> metmasts = client.metmast.wind_speed(limit=5).retrieve()

        """
        filter_ = _create_metmast_filter(
            self._view_id,
            min_position,
            max_position,
            external_id_prefix,
            space,
            filter,
        )

        return MetmastWindSpeedQuery(
            client=self._client,
            view_id=self._view_id,
            timeseries_limit=limit,
            filter=filter_,
        )

    def list(
        self,
        min_position: float | None = None,
        max_position: float | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> TimeSeriesList:
        """List timeseries `metmast.wind_speed`

        Args:
            min_position: The minimum value of the position to filter on.
            max_position: The maximum value of the position to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of metmasts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            List of Timeseries metmast.wind_speed.

        Examples:

            List metmast.wind_speed and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> metmasts = client.metmast.wind_speed.list(limit=5)

        """
        filter_ = _create_metmast_filter(
            self._view_id,
            min_position,
            max_position,
            external_id_prefix,
            space,
            filter,
        )
        external_ids = _retrieve_timeseries_external_ids_with_extra_wind_speed(
            self._client, self._view_id, filter_, limit
        )
        if external_ids:
            return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
        else:
            return TimeSeriesList([])

__call__(min_position=None, max_position=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Query timeseries metmast.wind_speed

Parameters:

Name Type Description Default
min_position float | None

The minimum value of the position to filter on.

None
max_position float | None

The maximum value of the position to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of metmasts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
MetmastWindSpeedQuery

A query object that can be used to retrieve datapoins for the metmast.wind_speed timeseries

MetmastWindSpeedQuery

selected in this method.

Examples:

Retrieve all data for 5 metmast.wind_speed timeseries:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> metmasts = client.metmast.wind_speed(limit=5).retrieve()
Source code in examples/windmill/_api/metmast_wind_speed.py
def __call__(
    self,
    min_position: float | None = None,
    max_position: float | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> MetmastWindSpeedQuery:
    """Query timeseries `metmast.wind_speed`

    Args:
        min_position: The minimum value of the position to filter on.
        max_position: The maximum value of the position to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of metmasts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query object that can be used to retrieve datapoins for the metmast.wind_speed timeseries
        selected in this method.

    Examples:

        Retrieve all data for 5 metmast.wind_speed timeseries:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> metmasts = client.metmast.wind_speed(limit=5).retrieve()

    """
    filter_ = _create_metmast_filter(
        self._view_id,
        min_position,
        max_position,
        external_id_prefix,
        space,
        filter,
    )

    return MetmastWindSpeedQuery(
        client=self._client,
        view_id=self._view_id,
        timeseries_limit=limit,
        filter=filter_,
    )

list(min_position=None, max_position=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

List timeseries metmast.wind_speed

Parameters:

Name Type Description Default
min_position float | None

The minimum value of the position to filter on.

None
max_position float | None

The maximum value of the position to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of metmasts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
TimeSeriesList

List of Timeseries metmast.wind_speed.

Examples:

List metmast.wind_speed and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> metmasts = client.metmast.wind_speed.list(limit=5)
Source code in examples/windmill/_api/metmast_wind_speed.py
def list(
    self,
    min_position: float | None = None,
    max_position: float | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> TimeSeriesList:
    """List timeseries `metmast.wind_speed`

    Args:
        min_position: The minimum value of the position to filter on.
        max_position: The maximum value of the position to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of metmasts to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        List of Timeseries metmast.wind_speed.

    Examples:

        List metmast.wind_speed and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> metmasts = client.metmast.wind_speed.list(limit=5)

    """
    filter_ = _create_metmast_filter(
        self._view_id,
        min_position,
        max_position,
        external_id_prefix,
        space,
        filter,
    )
    external_ids = _retrieve_timeseries_external_ids_with_extra_wind_speed(
        self._client, self._view_id, filter_, limit
    )
    if external_ids:
        return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
    else:
        return TimeSeriesList([])

NacelleAPI

Bases: NodeAPI[Nacelle, NacelleWrite, NacelleList, NacelleWriteList]

Source code in examples/windmill/_api/nacelle.py
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
class NacelleAPI(NodeAPI[Nacelle, NacelleWrite, NacelleList, NacelleWriteList]):
    _view_id = dm.ViewId("power-models", "Nacelle", "1")
    _properties_by_field = _NACELLE_PROPERTIES_BY_FIELD
    _class_type = Nacelle
    _class_list = NacelleList
    _class_write_list = NacelleWriteList

    def __init__(self, client: CogniteClient):
        super().__init__(client=client)

        self.acc_from_back_side_x = NacelleAccFromBackSideXAPI(client, self._view_id)
        self.acc_from_back_side_y = NacelleAccFromBackSideYAPI(client, self._view_id)
        self.acc_from_back_side_z = NacelleAccFromBackSideZAPI(client, self._view_id)
        self.yaw_direction = NacelleYawDirectionAPI(client, self._view_id)
        self.yaw_error = NacelleYawErrorAPI(client, self._view_id)

    def __call__(
        self,
        gearbox: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        generator: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        high_speed_shaft: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        main_shaft: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        power_inverter: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_QUERY_LIMIT,
        filter: dm.Filter | None = None,
    ) -> NacelleQueryAPI[NacelleList]:
        """Query starting at nacelles.

        Args:
            gearbox: The gearbox to filter on.
            generator: The generator to filter on.
            high_speed_shaft: The high speed shaft to filter on.
            main_shaft: The main shaft to filter on.
            power_inverter: The power inverter to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query API for nacelles.

        """
        has_data = dm.filters.HasData(views=[self._view_id])
        filter_ = _create_nacelle_filter(
            self._view_id,
            gearbox,
            generator,
            high_speed_shaft,
            main_shaft,
            power_inverter,
            external_id_prefix,
            space,
            (filter and dm.filters.And(filter, has_data)) or has_data,
        )
        builder = QueryBuilder(NacelleList)
        return NacelleQueryAPI(self._client, builder, filter_, limit)

    def apply(
        self,
        nacelle: NacelleWrite | Sequence[NacelleWrite],
        replace: bool = False,
        write_none: bool = False,
    ) -> ResourcesWriteResult:
        """Add or update (upsert) nacelles.

        Note: This method iterates through all nodes and timeseries linked to nacelle and creates them including the edges
        between the nodes. For example, if any of `gearbox`, `generator`, `high_speed_shaft`, `main_shaft` or `power_inverter` are set, then these
        nodes as well as any nodes linked to them, and all the edges linking these nodes will be created.

        Args:
            nacelle: Nacelle or sequence of nacelles to upsert.
            replace (bool): How do we behave when a property value exists? Do we replace all matching and existing values with the supplied values (true)?
                Or should we merge in new values for properties together with the existing values (false)? Note: This setting applies for all nodes or edges specified in the ingestion call.
            write_none (bool): This method, will by default, skip properties that are set to None. However, if you want to set properties to None,
                you can set this parameter to True. Note this only applies to properties that are nullable.
        Returns:
            Created instance(s), i.e., nodes, edges, and time series.

        Examples:

            Create a new nacelle:

                >>> from windmill import WindmillClient
                >>> from windmill.data_classes import NacelleWrite
                >>> client = WindmillClient()
                >>> nacelle = NacelleWrite(external_id="my_nacelle", ...)
                >>> result = client.nacelle.apply(nacelle)

        """
        warnings.warn(
            "The .apply method is deprecated and will be removed in v1.0. "
            "Please use the .upsert method on the client instead. This means instead of "
            "`my_client.nacelle.apply(my_items)` please use `my_client.upsert(my_items)`."
            "The motivation is that all apply methods are the same, and having one apply method per API "
            " class encourages users to create items in small batches, which is inefficient."
            "In addition, .upsert method is more descriptive of what the method does.",
            UserWarning,
            stacklevel=2,
        )
        return self._apply(nacelle, replace, write_none)

    def delete(
        self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
    ) -> dm.InstancesDeleteResult:
        """Delete one or more nacelle.

        Args:
            external_id: External id of the nacelle to delete.
            space: The space where all the nacelle are located.

        Returns:
            The instance(s), i.e., nodes and edges which has been deleted. Empty list if nothing was deleted.

        Examples:

            Delete nacelle by id:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> client.nacelle.delete("my_nacelle")
        """
        warnings.warn(
            "The .delete method is deprecated and will be removed in v1.0. "
            "Please use the .delete method on the client instead. This means instead of "
            "`my_client.nacelle.delete(my_ids)` please use `my_client.delete(my_ids)`."
            "The motivation is that all delete methods are the same, and having one delete method per API "
            " class encourages users to delete items in small batches, which is inefficient.",
            UserWarning,
            stacklevel=2,
        )
        return self._delete(external_id, space)

    @overload
    def retrieve(self, external_id: str, space: str = DEFAULT_INSTANCE_SPACE) -> Nacelle | None: ...

    @overload
    def retrieve(self, external_id: SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE) -> NacelleList: ...

    def retrieve(
        self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
    ) -> Nacelle | NacelleList | None:
        """Retrieve one or more nacelles by id(s).

        Args:
            external_id: External id or list of external ids of the nacelles.
            space: The space where all the nacelles are located.

        Returns:
            The requested nacelles.

        Examples:

            Retrieve nacelle by id:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> nacelle = client.nacelle.retrieve("my_nacelle")

        """
        return self._retrieve(external_id, space)

    def search(
        self,
        query: str,
        properties: NacelleTextFields | SequenceNotStr[NacelleTextFields] | None = None,
        gearbox: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        generator: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        high_speed_shaft: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        main_shaft: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        power_inverter: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
        sort_by: NacelleFields | SequenceNotStr[NacelleFields] | None = None,
        direction: Literal["ascending", "descending"] = "ascending",
        sort: InstanceSort | list[InstanceSort] | None = None,
    ) -> NacelleList:
        """Search nacelles

        Args:
            query: The search query,
            properties: The property to search, if nothing is passed all text fields will be searched.
            gearbox: The gearbox to filter on.
            generator: The generator to filter on.
            high_speed_shaft: The high speed shaft to filter on.
            main_shaft: The main shaft to filter on.
            power_inverter: The power inverter to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
            sort_by: The property to sort by.
            direction: The direction to sort by, either 'ascending' or 'descending'.
            sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
                This will override the sort_by and direction. This allowos you to sort by multiple fields and
                specify the direction for each field as well as how to handle null values.

        Returns:
            Search results nacelles matching the query.

        Examples:

           Search for 'my_nacelle' in all text properties:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> nacelles = client.nacelle.search('my_nacelle')

        """
        filter_ = _create_nacelle_filter(
            self._view_id,
            gearbox,
            generator,
            high_speed_shaft,
            main_shaft,
            power_inverter,
            external_id_prefix,
            space,
            filter,
        )
        return self._search(
            query=query,
            properties=properties,
            filter_=filter_,
            limit=limit,
            sort_by=sort_by,  # type: ignore[arg-type]
            direction=direction,
            sort=sort,
        )

    @overload
    def aggregate(
        self,
        aggregate: Aggregations | dm.aggregations.MetricAggregation,
        group_by: None = None,
        property: NacelleFields | SequenceNotStr[NacelleFields] | None = None,
        gearbox: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        generator: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        high_speed_shaft: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        main_shaft: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        power_inverter: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> dm.aggregations.AggregatedNumberedValue: ...

    @overload
    def aggregate(
        self,
        aggregate: SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation],
        group_by: None = None,
        property: NacelleFields | SequenceNotStr[NacelleFields] | None = None,
        gearbox: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        generator: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        high_speed_shaft: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        main_shaft: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        power_inverter: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> list[dm.aggregations.AggregatedNumberedValue]: ...

    @overload
    def aggregate(
        self,
        aggregate: (
            Aggregations
            | dm.aggregations.MetricAggregation
            | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation]
        ),
        group_by: NacelleFields | SequenceNotStr[NacelleFields],
        property: NacelleFields | SequenceNotStr[NacelleFields] | None = None,
        gearbox: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        generator: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        high_speed_shaft: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        main_shaft: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        power_inverter: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> InstanceAggregationResultList: ...

    def aggregate(
        self,
        aggregate: (
            Aggregations
            | dm.aggregations.MetricAggregation
            | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation]
        ),
        group_by: NacelleFields | SequenceNotStr[NacelleFields] | None = None,
        property: NacelleFields | SequenceNotStr[NacelleFields] | None = None,
        gearbox: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        generator: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        high_speed_shaft: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        main_shaft: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        power_inverter: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> (
        dm.aggregations.AggregatedNumberedValue
        | list[dm.aggregations.AggregatedNumberedValue]
        | InstanceAggregationResultList
    ):
        """Aggregate data across nacelles

        Args:
            aggregate: The aggregation to perform.
            group_by: The property to group by when doing the aggregation.
            property: The property to perform aggregation on.
            gearbox: The gearbox to filter on.
            generator: The generator to filter on.
            high_speed_shaft: The high speed shaft to filter on.
            main_shaft: The main shaft to filter on.
            power_inverter: The power inverter to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            Aggregation results.

        Examples:

            Count nacelles in space `my_space`:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> result = client.nacelle.aggregate("count", space="my_space")

        """

        filter_ = _create_nacelle_filter(
            self._view_id,
            gearbox,
            generator,
            high_speed_shaft,
            main_shaft,
            power_inverter,
            external_id_prefix,
            space,
            filter,
        )
        return self._aggregate(
            aggregate=aggregate,
            group_by=group_by,  # type: ignore[arg-type]
            properties=property,  # type: ignore[arg-type]
            query=None,
            search_properties=None,
            limit=limit,
            filter=filter_,
        )

    def histogram(
        self,
        property: NacelleFields,
        interval: float,
        gearbox: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        generator: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        high_speed_shaft: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        main_shaft: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        power_inverter: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> dm.aggregations.HistogramValue:
        """Produces histograms for nacelles

        Args:
            property: The property to use as the value in the histogram.
            interval: The interval to use for the histogram bins.
            gearbox: The gearbox to filter on.
            generator: The generator to filter on.
            high_speed_shaft: The high speed shaft to filter on.
            main_shaft: The main shaft to filter on.
            power_inverter: The power inverter to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            Bucketed histogram results.

        """
        filter_ = _create_nacelle_filter(
            self._view_id,
            gearbox,
            generator,
            high_speed_shaft,
            main_shaft,
            power_inverter,
            external_id_prefix,
            space,
            filter,
        )
        return self._histogram(
            property,
            interval,
            None,
            None,
            limit,
            filter_,
        )

    def query(self) -> NacelleQuery:
        """Start a query for nacelles."""
        warnings.warn("The .query is in alpha and is subject to breaking changes without notice.")
        return NacelleQuery(self._client)

    def list(
        self,
        gearbox: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        generator: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        high_speed_shaft: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        main_shaft: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        power_inverter: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
        sort_by: NacelleFields | Sequence[NacelleFields] | None = None,
        direction: Literal["ascending", "descending"] = "ascending",
        sort: InstanceSort | list[InstanceSort] | None = None,
        retrieve_connections: Literal["skip", "identifier", "full"] = "skip",
    ) -> NacelleList:
        """List/filter nacelles

        Args:
            gearbox: The gearbox to filter on.
            generator: The generator to filter on.
            high_speed_shaft: The high speed shaft to filter on.
            main_shaft: The main shaft to filter on.
            power_inverter: The power inverter to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
            sort_by: The property to sort by.
            direction: The direction to sort by, either 'ascending' or 'descending'.
            sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
                This will override the sort_by and direction. This allowos you to sort by multiple fields and
                specify the direction for each field as well as how to handle null values.
            retrieve_connections: Whether to retrieve `gearbox`, `generator`, `high_speed_shaft`, `main_shaft` and `power_inverter` for the nacelles. Defaults to 'skip'.
                'skip' will not retrieve any connections, 'identifier' will only retrieve the identifier of the connected items, and 'full' will retrieve the full connected items.

        Returns:
            List of requested nacelles

        Examples:

            List nacelles and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> nacelles = client.nacelle.list(limit=5)

        """
        filter_ = _create_nacelle_filter(
            self._view_id,
            gearbox,
            generator,
            high_speed_shaft,
            main_shaft,
            power_inverter,
            external_id_prefix,
            space,
            filter,
        )

        if retrieve_connections == "skip":
            return self._list(
                limit=limit,
                filter=filter_,
                sort_by=sort_by,  # type: ignore[arg-type]
                direction=direction,
                sort=sort,
            )

        builder = QueryBuilder(NacelleList)
        has_data = dm.filters.HasData(views=[self._view_id])
        builder.append(
            NodeQueryStep(
                builder.create_name(None),
                dm.query.NodeResultSetExpression(
                    filter=dm.filters.And(filter_, has_data) if filter_ else has_data,
                    sort=self._create_sort(sort_by, direction, sort),  # type: ignore[arg-type]
                ),
                Nacelle,
                max_retrieve_limit=limit,
            )
        )
        from_root = builder.get_from()
        if retrieve_connections == "full":
            builder.append(
                NodeQueryStep(
                    builder.create_name(from_root),
                    dm.query.NodeResultSetExpression(
                        from_=from_root,
                        filter=dm.filters.HasData(views=[Gearbox._view_id]),
                        direction="outwards",
                        through=self._view_id.as_property_ref("gearbox"),
                    ),
                    Gearbox,
                )
            )
            builder.append(
                NodeQueryStep(
                    builder.create_name(from_root),
                    dm.query.NodeResultSetExpression(
                        from_=from_root,
                        filter=dm.filters.HasData(views=[Generator._view_id]),
                        direction="outwards",
                        through=self._view_id.as_property_ref("generator"),
                    ),
                    Generator,
                )
            )
            builder.append(
                NodeQueryStep(
                    builder.create_name(from_root),
                    dm.query.NodeResultSetExpression(
                        from_=from_root,
                        filter=dm.filters.HasData(views=[HighSpeedShaft._view_id]),
                        direction="outwards",
                        through=self._view_id.as_property_ref("high_speed_shaft"),
                    ),
                    HighSpeedShaft,
                )
            )
            builder.append(
                NodeQueryStep(
                    builder.create_name(from_root),
                    dm.query.NodeResultSetExpression(
                        from_=from_root,
                        filter=dm.filters.HasData(views=[MainShaft._view_id]),
                        direction="outwards",
                        through=self._view_id.as_property_ref("main_shaft"),
                    ),
                    MainShaft,
                )
            )
            builder.append(
                NodeQueryStep(
                    builder.create_name(from_root),
                    dm.query.NodeResultSetExpression(
                        from_=from_root,
                        filter=dm.filters.HasData(views=[PowerInverter._view_id]),
                        direction="outwards",
                        through=self._view_id.as_property_ref("power_inverter"),
                    ),
                    PowerInverter,
                )
            )

        return builder.execute(self._client)

__call__(gearbox=None, generator=None, high_speed_shaft=None, main_shaft=None, power_inverter=None, external_id_prefix=None, space=None, limit=DEFAULT_QUERY_LIMIT, filter=None)

Query starting at nacelles.

Parameters:

Name Type Description Default
gearbox str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The gearbox to filter on.

None
generator str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The generator to filter on.

None
high_speed_shaft str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The high speed shaft to filter on.

None
main_shaft str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The main shaft to filter on.

None
power_inverter str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The power inverter to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_QUERY_LIMIT
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
NacelleQueryAPI[NacelleList]

A query API for nacelles.

Source code in examples/windmill/_api/nacelle.py
def __call__(
    self,
    gearbox: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    generator: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    high_speed_shaft: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    main_shaft: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    power_inverter: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_QUERY_LIMIT,
    filter: dm.Filter | None = None,
) -> NacelleQueryAPI[NacelleList]:
    """Query starting at nacelles.

    Args:
        gearbox: The gearbox to filter on.
        generator: The generator to filter on.
        high_speed_shaft: The high speed shaft to filter on.
        main_shaft: The main shaft to filter on.
        power_inverter: The power inverter to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query API for nacelles.

    """
    has_data = dm.filters.HasData(views=[self._view_id])
    filter_ = _create_nacelle_filter(
        self._view_id,
        gearbox,
        generator,
        high_speed_shaft,
        main_shaft,
        power_inverter,
        external_id_prefix,
        space,
        (filter and dm.filters.And(filter, has_data)) or has_data,
    )
    builder = QueryBuilder(NacelleList)
    return NacelleQueryAPI(self._client, builder, filter_, limit)

aggregate(aggregate, group_by=None, property=None, gearbox=None, generator=None, high_speed_shaft=None, main_shaft=None, power_inverter=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

aggregate(aggregate: Aggregations | dm.aggregations.MetricAggregation, group_by: None = None, property: NacelleFields | SequenceNotStr[NacelleFields] | None = None, gearbox: str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference] | None = None, generator: str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference] | None = None, high_speed_shaft: str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference] | None = None, main_shaft: str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference] | None = None, power_inverter: str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference] | None = None, external_id_prefix: str | None = None, space: str | list[str] | None = None, limit: int = DEFAULT_LIMIT_READ, filter: dm.Filter | None = None) -> dm.aggregations.AggregatedNumberedValue
aggregate(aggregate: SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation], group_by: None = None, property: NacelleFields | SequenceNotStr[NacelleFields] | None = None, gearbox: str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference] | None = None, generator: str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference] | None = None, high_speed_shaft: str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference] | None = None, main_shaft: str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference] | None = None, power_inverter: str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference] | None = None, external_id_prefix: str | None = None, space: str | list[str] | None = None, limit: int = DEFAULT_LIMIT_READ, filter: dm.Filter | None = None) -> list[dm.aggregations.AggregatedNumberedValue]
aggregate(aggregate: Aggregations | dm.aggregations.MetricAggregation | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation], group_by: NacelleFields | SequenceNotStr[NacelleFields], property: NacelleFields | SequenceNotStr[NacelleFields] | None = None, gearbox: str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference] | None = None, generator: str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference] | None = None, high_speed_shaft: str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference] | None = None, main_shaft: str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference] | None = None, power_inverter: str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference] | None = None, external_id_prefix: str | None = None, space: str | list[str] | None = None, limit: int = DEFAULT_LIMIT_READ, filter: dm.Filter | None = None) -> InstanceAggregationResultList

Aggregate data across nacelles

Parameters:

Name Type Description Default
aggregate Aggregations | MetricAggregation | SequenceNotStr[Aggregations | MetricAggregation]

The aggregation to perform.

required
group_by NacelleFields | SequenceNotStr[NacelleFields] | None

The property to group by when doing the aggregation.

None
property NacelleFields | SequenceNotStr[NacelleFields] | None

The property to perform aggregation on.

None
gearbox str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The gearbox to filter on.

None
generator str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The generator to filter on.

None
high_speed_shaft str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The high speed shaft to filter on.

None
main_shaft str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The main shaft to filter on.

None
power_inverter str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The power inverter to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
AggregatedNumberedValue | list[AggregatedNumberedValue] | InstanceAggregationResultList

Aggregation results.

Examples:

Count nacelles in space `my_space`:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> result = client.nacelle.aggregate("count", space="my_space")
Source code in examples/windmill/_api/nacelle.py
def aggregate(
    self,
    aggregate: (
        Aggregations
        | dm.aggregations.MetricAggregation
        | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation]
    ),
    group_by: NacelleFields | SequenceNotStr[NacelleFields] | None = None,
    property: NacelleFields | SequenceNotStr[NacelleFields] | None = None,
    gearbox: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    generator: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    high_speed_shaft: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    main_shaft: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    power_inverter: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> (
    dm.aggregations.AggregatedNumberedValue
    | list[dm.aggregations.AggregatedNumberedValue]
    | InstanceAggregationResultList
):
    """Aggregate data across nacelles

    Args:
        aggregate: The aggregation to perform.
        group_by: The property to group by when doing the aggregation.
        property: The property to perform aggregation on.
        gearbox: The gearbox to filter on.
        generator: The generator to filter on.
        high_speed_shaft: The high speed shaft to filter on.
        main_shaft: The main shaft to filter on.
        power_inverter: The power inverter to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        Aggregation results.

    Examples:

        Count nacelles in space `my_space`:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> result = client.nacelle.aggregate("count", space="my_space")

    """

    filter_ = _create_nacelle_filter(
        self._view_id,
        gearbox,
        generator,
        high_speed_shaft,
        main_shaft,
        power_inverter,
        external_id_prefix,
        space,
        filter,
    )
    return self._aggregate(
        aggregate=aggregate,
        group_by=group_by,  # type: ignore[arg-type]
        properties=property,  # type: ignore[arg-type]
        query=None,
        search_properties=None,
        limit=limit,
        filter=filter_,
    )

apply(nacelle, replace=False, write_none=False)

Add or update (upsert) nacelles.

Note: This method iterates through all nodes and timeseries linked to nacelle and creates them including the edges between the nodes. For example, if any of gearbox, generator, high_speed_shaft, main_shaft or power_inverter are set, then these nodes as well as any nodes linked to them, and all the edges linking these nodes will be created.

Parameters:

Name Type Description Default
nacelle NacelleWrite | Sequence[NacelleWrite]

Nacelle or sequence of nacelles to upsert.

required
replace bool

How do we behave when a property value exists? Do we replace all matching and existing values with the supplied values (true)? Or should we merge in new values for properties together with the existing values (false)? Note: This setting applies for all nodes or edges specified in the ingestion call.

False
write_none bool

This method, will by default, skip properties that are set to None. However, if you want to set properties to None, you can set this parameter to True. Note this only applies to properties that are nullable.

False

Returns: Created instance(s), i.e., nodes, edges, and time series.

Examples:

Create a new nacelle:

    >>> from windmill import WindmillClient
    >>> from windmill.data_classes import NacelleWrite
    >>> client = WindmillClient()
    >>> nacelle = NacelleWrite(external_id="my_nacelle", ...)
    >>> result = client.nacelle.apply(nacelle)
Source code in examples/windmill/_api/nacelle.py
def apply(
    self,
    nacelle: NacelleWrite | Sequence[NacelleWrite],
    replace: bool = False,
    write_none: bool = False,
) -> ResourcesWriteResult:
    """Add or update (upsert) nacelles.

    Note: This method iterates through all nodes and timeseries linked to nacelle and creates them including the edges
    between the nodes. For example, if any of `gearbox`, `generator`, `high_speed_shaft`, `main_shaft` or `power_inverter` are set, then these
    nodes as well as any nodes linked to them, and all the edges linking these nodes will be created.

    Args:
        nacelle: Nacelle or sequence of nacelles to upsert.
        replace (bool): How do we behave when a property value exists? Do we replace all matching and existing values with the supplied values (true)?
            Or should we merge in new values for properties together with the existing values (false)? Note: This setting applies for all nodes or edges specified in the ingestion call.
        write_none (bool): This method, will by default, skip properties that are set to None. However, if you want to set properties to None,
            you can set this parameter to True. Note this only applies to properties that are nullable.
    Returns:
        Created instance(s), i.e., nodes, edges, and time series.

    Examples:

        Create a new nacelle:

            >>> from windmill import WindmillClient
            >>> from windmill.data_classes import NacelleWrite
            >>> client = WindmillClient()
            >>> nacelle = NacelleWrite(external_id="my_nacelle", ...)
            >>> result = client.nacelle.apply(nacelle)

    """
    warnings.warn(
        "The .apply method is deprecated and will be removed in v1.0. "
        "Please use the .upsert method on the client instead. This means instead of "
        "`my_client.nacelle.apply(my_items)` please use `my_client.upsert(my_items)`."
        "The motivation is that all apply methods are the same, and having one apply method per API "
        " class encourages users to create items in small batches, which is inefficient."
        "In addition, .upsert method is more descriptive of what the method does.",
        UserWarning,
        stacklevel=2,
    )
    return self._apply(nacelle, replace, write_none)

delete(external_id, space=DEFAULT_INSTANCE_SPACE)

Delete one or more nacelle.

Parameters:

Name Type Description Default
external_id str | SequenceNotStr[str]

External id of the nacelle to delete.

required
space str

The space where all the nacelle are located.

DEFAULT_INSTANCE_SPACE

Returns:

Type Description
InstancesDeleteResult

The instance(s), i.e., nodes and edges which has been deleted. Empty list if nothing was deleted.

Examples:

Delete nacelle by id:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> client.nacelle.delete("my_nacelle")
Source code in examples/windmill/_api/nacelle.py
def delete(
    self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
) -> dm.InstancesDeleteResult:
    """Delete one or more nacelle.

    Args:
        external_id: External id of the nacelle to delete.
        space: The space where all the nacelle are located.

    Returns:
        The instance(s), i.e., nodes and edges which has been deleted. Empty list if nothing was deleted.

    Examples:

        Delete nacelle by id:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> client.nacelle.delete("my_nacelle")
    """
    warnings.warn(
        "The .delete method is deprecated and will be removed in v1.0. "
        "Please use the .delete method on the client instead. This means instead of "
        "`my_client.nacelle.delete(my_ids)` please use `my_client.delete(my_ids)`."
        "The motivation is that all delete methods are the same, and having one delete method per API "
        " class encourages users to delete items in small batches, which is inefficient.",
        UserWarning,
        stacklevel=2,
    )
    return self._delete(external_id, space)

histogram(property, interval, gearbox=None, generator=None, high_speed_shaft=None, main_shaft=None, power_inverter=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Produces histograms for nacelles

Parameters:

Name Type Description Default
property NacelleFields

The property to use as the value in the histogram.

required
interval float

The interval to use for the histogram bins.

required
gearbox str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The gearbox to filter on.

None
generator str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The generator to filter on.

None
high_speed_shaft str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The high speed shaft to filter on.

None
main_shaft str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The main shaft to filter on.

None
power_inverter str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The power inverter to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
HistogramValue

Bucketed histogram results.

Source code in examples/windmill/_api/nacelle.py
def histogram(
    self,
    property: NacelleFields,
    interval: float,
    gearbox: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    generator: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    high_speed_shaft: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    main_shaft: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    power_inverter: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> dm.aggregations.HistogramValue:
    """Produces histograms for nacelles

    Args:
        property: The property to use as the value in the histogram.
        interval: The interval to use for the histogram bins.
        gearbox: The gearbox to filter on.
        generator: The generator to filter on.
        high_speed_shaft: The high speed shaft to filter on.
        main_shaft: The main shaft to filter on.
        power_inverter: The power inverter to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        Bucketed histogram results.

    """
    filter_ = _create_nacelle_filter(
        self._view_id,
        gearbox,
        generator,
        high_speed_shaft,
        main_shaft,
        power_inverter,
        external_id_prefix,
        space,
        filter,
    )
    return self._histogram(
        property,
        interval,
        None,
        None,
        limit,
        filter_,
    )

list(gearbox=None, generator=None, high_speed_shaft=None, main_shaft=None, power_inverter=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None, sort_by=None, direction='ascending', sort=None, retrieve_connections='skip')

List/filter nacelles

Parameters:

Name Type Description Default
gearbox str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The gearbox to filter on.

None
generator str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The generator to filter on.

None
high_speed_shaft str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The high speed shaft to filter on.

None
main_shaft str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The main shaft to filter on.

None
power_inverter str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The power inverter to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None
sort_by NacelleFields | Sequence[NacelleFields] | None

The property to sort by.

None
direction Literal['ascending', 'descending']

The direction to sort by, either 'ascending' or 'descending'.

'ascending'
sort InstanceSort | list[InstanceSort] | None

(Advanced) If sort_by and direction are not sufficient, you can write your own sorting. This will override the sort_by and direction. This allowos you to sort by multiple fields and specify the direction for each field as well as how to handle null values.

None
retrieve_connections Literal['skip', 'identifier', 'full']

Whether to retrieve gearbox, generator, high_speed_shaft, main_shaft and power_inverter for the nacelles. Defaults to 'skip'. 'skip' will not retrieve any connections, 'identifier' will only retrieve the identifier of the connected items, and 'full' will retrieve the full connected items.

'skip'

Returns:

Type Description
NacelleList

List of requested nacelles

Examples:

List nacelles and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> nacelles = client.nacelle.list(limit=5)
Source code in examples/windmill/_api/nacelle.py
def list(
    self,
    gearbox: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    generator: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    high_speed_shaft: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    main_shaft: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    power_inverter: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
    sort_by: NacelleFields | Sequence[NacelleFields] | None = None,
    direction: Literal["ascending", "descending"] = "ascending",
    sort: InstanceSort | list[InstanceSort] | None = None,
    retrieve_connections: Literal["skip", "identifier", "full"] = "skip",
) -> NacelleList:
    """List/filter nacelles

    Args:
        gearbox: The gearbox to filter on.
        generator: The generator to filter on.
        high_speed_shaft: The high speed shaft to filter on.
        main_shaft: The main shaft to filter on.
        power_inverter: The power inverter to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
        sort_by: The property to sort by.
        direction: The direction to sort by, either 'ascending' or 'descending'.
        sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
            This will override the sort_by and direction. This allowos you to sort by multiple fields and
            specify the direction for each field as well as how to handle null values.
        retrieve_connections: Whether to retrieve `gearbox`, `generator`, `high_speed_shaft`, `main_shaft` and `power_inverter` for the nacelles. Defaults to 'skip'.
            'skip' will not retrieve any connections, 'identifier' will only retrieve the identifier of the connected items, and 'full' will retrieve the full connected items.

    Returns:
        List of requested nacelles

    Examples:

        List nacelles and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> nacelles = client.nacelle.list(limit=5)

    """
    filter_ = _create_nacelle_filter(
        self._view_id,
        gearbox,
        generator,
        high_speed_shaft,
        main_shaft,
        power_inverter,
        external_id_prefix,
        space,
        filter,
    )

    if retrieve_connections == "skip":
        return self._list(
            limit=limit,
            filter=filter_,
            sort_by=sort_by,  # type: ignore[arg-type]
            direction=direction,
            sort=sort,
        )

    builder = QueryBuilder(NacelleList)
    has_data = dm.filters.HasData(views=[self._view_id])
    builder.append(
        NodeQueryStep(
            builder.create_name(None),
            dm.query.NodeResultSetExpression(
                filter=dm.filters.And(filter_, has_data) if filter_ else has_data,
                sort=self._create_sort(sort_by, direction, sort),  # type: ignore[arg-type]
            ),
            Nacelle,
            max_retrieve_limit=limit,
        )
    )
    from_root = builder.get_from()
    if retrieve_connections == "full":
        builder.append(
            NodeQueryStep(
                builder.create_name(from_root),
                dm.query.NodeResultSetExpression(
                    from_=from_root,
                    filter=dm.filters.HasData(views=[Gearbox._view_id]),
                    direction="outwards",
                    through=self._view_id.as_property_ref("gearbox"),
                ),
                Gearbox,
            )
        )
        builder.append(
            NodeQueryStep(
                builder.create_name(from_root),
                dm.query.NodeResultSetExpression(
                    from_=from_root,
                    filter=dm.filters.HasData(views=[Generator._view_id]),
                    direction="outwards",
                    through=self._view_id.as_property_ref("generator"),
                ),
                Generator,
            )
        )
        builder.append(
            NodeQueryStep(
                builder.create_name(from_root),
                dm.query.NodeResultSetExpression(
                    from_=from_root,
                    filter=dm.filters.HasData(views=[HighSpeedShaft._view_id]),
                    direction="outwards",
                    through=self._view_id.as_property_ref("high_speed_shaft"),
                ),
                HighSpeedShaft,
            )
        )
        builder.append(
            NodeQueryStep(
                builder.create_name(from_root),
                dm.query.NodeResultSetExpression(
                    from_=from_root,
                    filter=dm.filters.HasData(views=[MainShaft._view_id]),
                    direction="outwards",
                    through=self._view_id.as_property_ref("main_shaft"),
                ),
                MainShaft,
            )
        )
        builder.append(
            NodeQueryStep(
                builder.create_name(from_root),
                dm.query.NodeResultSetExpression(
                    from_=from_root,
                    filter=dm.filters.HasData(views=[PowerInverter._view_id]),
                    direction="outwards",
                    through=self._view_id.as_property_ref("power_inverter"),
                ),
                PowerInverter,
            )
        )

    return builder.execute(self._client)

query()

Start a query for nacelles.

Source code in examples/windmill/_api/nacelle.py
def query(self) -> NacelleQuery:
    """Start a query for nacelles."""
    warnings.warn("The .query is in alpha and is subject to breaking changes without notice.")
    return NacelleQuery(self._client)

retrieve(external_id, space=DEFAULT_INSTANCE_SPACE)

retrieve(external_id: str, space: str = DEFAULT_INSTANCE_SPACE) -> Nacelle | None
retrieve(external_id: SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE) -> NacelleList

Retrieve one or more nacelles by id(s).

Parameters:

Name Type Description Default
external_id str | SequenceNotStr[str]

External id or list of external ids of the nacelles.

required
space str

The space where all the nacelles are located.

DEFAULT_INSTANCE_SPACE

Returns:

Type Description
Nacelle | NacelleList | None

The requested nacelles.

Examples:

Retrieve nacelle by id:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> nacelle = client.nacelle.retrieve("my_nacelle")
Source code in examples/windmill/_api/nacelle.py
def retrieve(
    self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
) -> Nacelle | NacelleList | None:
    """Retrieve one or more nacelles by id(s).

    Args:
        external_id: External id or list of external ids of the nacelles.
        space: The space where all the nacelles are located.

    Returns:
        The requested nacelles.

    Examples:

        Retrieve nacelle by id:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> nacelle = client.nacelle.retrieve("my_nacelle")

    """
    return self._retrieve(external_id, space)

search(query, properties=None, gearbox=None, generator=None, high_speed_shaft=None, main_shaft=None, power_inverter=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None, sort_by=None, direction='ascending', sort=None)

Search nacelles

Parameters:

Name Type Description Default
query str

The search query,

required
properties NacelleTextFields | SequenceNotStr[NacelleTextFields] | None

The property to search, if nothing is passed all text fields will be searched.

None
gearbox str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The gearbox to filter on.

None
generator str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The generator to filter on.

None
high_speed_shaft str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The high speed shaft to filter on.

None
main_shaft str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The main shaft to filter on.

None
power_inverter str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The power inverter to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None
sort_by NacelleFields | SequenceNotStr[NacelleFields] | None

The property to sort by.

None
direction Literal['ascending', 'descending']

The direction to sort by, either 'ascending' or 'descending'.

'ascending'
sort InstanceSort | list[InstanceSort] | None

(Advanced) If sort_by and direction are not sufficient, you can write your own sorting. This will override the sort_by and direction. This allowos you to sort by multiple fields and specify the direction for each field as well as how to handle null values.

None

Returns:

Type Description
NacelleList

Search results nacelles matching the query.

Examples:

Search for 'my_nacelle' in all text properties:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> nacelles = client.nacelle.search('my_nacelle')
Source code in examples/windmill/_api/nacelle.py
def search(
    self,
    query: str,
    properties: NacelleTextFields | SequenceNotStr[NacelleTextFields] | None = None,
    gearbox: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    generator: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    high_speed_shaft: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    main_shaft: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    power_inverter: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
    sort_by: NacelleFields | SequenceNotStr[NacelleFields] | None = None,
    direction: Literal["ascending", "descending"] = "ascending",
    sort: InstanceSort | list[InstanceSort] | None = None,
) -> NacelleList:
    """Search nacelles

    Args:
        query: The search query,
        properties: The property to search, if nothing is passed all text fields will be searched.
        gearbox: The gearbox to filter on.
        generator: The generator to filter on.
        high_speed_shaft: The high speed shaft to filter on.
        main_shaft: The main shaft to filter on.
        power_inverter: The power inverter to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
        sort_by: The property to sort by.
        direction: The direction to sort by, either 'ascending' or 'descending'.
        sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
            This will override the sort_by and direction. This allowos you to sort by multiple fields and
            specify the direction for each field as well as how to handle null values.

    Returns:
        Search results nacelles matching the query.

    Examples:

       Search for 'my_nacelle' in all text properties:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> nacelles = client.nacelle.search('my_nacelle')

    """
    filter_ = _create_nacelle_filter(
        self._view_id,
        gearbox,
        generator,
        high_speed_shaft,
        main_shaft,
        power_inverter,
        external_id_prefix,
        space,
        filter,
    )
    return self._search(
        query=query,
        properties=properties,
        filter_=filter_,
        limit=limit,
        sort_by=sort_by,  # type: ignore[arg-type]
        direction=direction,
        sort=sort,
    )

NacelleAccFromBackSideXAPI

Source code in examples/windmill/_api/nacelle_acc_from_back_side_x.py
class NacelleAccFromBackSideXAPI:
    def __init__(self, client: CogniteClient, view_id: dm.ViewId):
        self._client = client
        self._view_id = view_id

    def __call__(
        self,
        gearbox: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        generator: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        high_speed_shaft: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        main_shaft: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        power_inverter: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> NacelleAccFromBackSideXQuery:
        """Query timeseries `nacelle.acc_from_back_side_x`

        Args:
            gearbox: The gearbox to filter on.
            generator: The generator to filter on.
            high_speed_shaft: The high speed shaft to filter on.
            main_shaft: The main shaft to filter on.
            power_inverter: The power inverter to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query object that can be used to retrieve datapoins for the nacelle.acc_from_back_side_x timeseries
            selected in this method.

        Examples:

            Retrieve all data for 5 nacelle.acc_from_back_side_x timeseries:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> nacelles = client.nacelle.acc_from_back_side_x(limit=5).retrieve()

        """
        filter_ = _create_nacelle_filter(
            self._view_id,
            gearbox,
            generator,
            high_speed_shaft,
            main_shaft,
            power_inverter,
            external_id_prefix,
            space,
            filter,
        )

        return NacelleAccFromBackSideXQuery(
            client=self._client,
            view_id=self._view_id,
            timeseries_limit=limit,
            filter=filter_,
        )

    def list(
        self,
        gearbox: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        generator: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        high_speed_shaft: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        main_shaft: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        power_inverter: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> TimeSeriesList:
        """List timeseries `nacelle.acc_from_back_side_x`

        Args:
            gearbox: The gearbox to filter on.
            generator: The generator to filter on.
            high_speed_shaft: The high speed shaft to filter on.
            main_shaft: The main shaft to filter on.
            power_inverter: The power inverter to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            List of Timeseries nacelle.acc_from_back_side_x.

        Examples:

            List nacelle.acc_from_back_side_x and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> nacelles = client.nacelle.acc_from_back_side_x.list(limit=5)

        """
        filter_ = _create_nacelle_filter(
            self._view_id,
            gearbox,
            generator,
            high_speed_shaft,
            main_shaft,
            power_inverter,
            external_id_prefix,
            space,
            filter,
        )
        external_ids = _retrieve_timeseries_external_ids_with_extra_acc_from_back_side_x(
            self._client, self._view_id, filter_, limit
        )
        if external_ids:
            return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
        else:
            return TimeSeriesList([])

__call__(gearbox=None, generator=None, high_speed_shaft=None, main_shaft=None, power_inverter=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Query timeseries nacelle.acc_from_back_side_x

Parameters:

Name Type Description Default
gearbox str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The gearbox to filter on.

None
generator str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The generator to filter on.

None
high_speed_shaft str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The high speed shaft to filter on.

None
main_shaft str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The main shaft to filter on.

None
power_inverter str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The power inverter to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
NacelleAccFromBackSideXQuery

A query object that can be used to retrieve datapoins for the nacelle.acc_from_back_side_x timeseries

NacelleAccFromBackSideXQuery

selected in this method.

Examples:

Retrieve all data for 5 nacelle.acc_from_back_side_x timeseries:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> nacelles = client.nacelle.acc_from_back_side_x(limit=5).retrieve()
Source code in examples/windmill/_api/nacelle_acc_from_back_side_x.py
def __call__(
    self,
    gearbox: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    generator: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    high_speed_shaft: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    main_shaft: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    power_inverter: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> NacelleAccFromBackSideXQuery:
    """Query timeseries `nacelle.acc_from_back_side_x`

    Args:
        gearbox: The gearbox to filter on.
        generator: The generator to filter on.
        high_speed_shaft: The high speed shaft to filter on.
        main_shaft: The main shaft to filter on.
        power_inverter: The power inverter to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query object that can be used to retrieve datapoins for the nacelle.acc_from_back_side_x timeseries
        selected in this method.

    Examples:

        Retrieve all data for 5 nacelle.acc_from_back_side_x timeseries:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> nacelles = client.nacelle.acc_from_back_side_x(limit=5).retrieve()

    """
    filter_ = _create_nacelle_filter(
        self._view_id,
        gearbox,
        generator,
        high_speed_shaft,
        main_shaft,
        power_inverter,
        external_id_prefix,
        space,
        filter,
    )

    return NacelleAccFromBackSideXQuery(
        client=self._client,
        view_id=self._view_id,
        timeseries_limit=limit,
        filter=filter_,
    )

list(gearbox=None, generator=None, high_speed_shaft=None, main_shaft=None, power_inverter=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

List timeseries nacelle.acc_from_back_side_x

Parameters:

Name Type Description Default
gearbox str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The gearbox to filter on.

None
generator str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The generator to filter on.

None
high_speed_shaft str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The high speed shaft to filter on.

None
main_shaft str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The main shaft to filter on.

None
power_inverter str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The power inverter to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
TimeSeriesList

List of Timeseries nacelle.acc_from_back_side_x.

Examples:

List nacelle.acc_from_back_side_x and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> nacelles = client.nacelle.acc_from_back_side_x.list(limit=5)
Source code in examples/windmill/_api/nacelle_acc_from_back_side_x.py
def list(
    self,
    gearbox: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    generator: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    high_speed_shaft: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    main_shaft: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    power_inverter: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> TimeSeriesList:
    """List timeseries `nacelle.acc_from_back_side_x`

    Args:
        gearbox: The gearbox to filter on.
        generator: The generator to filter on.
        high_speed_shaft: The high speed shaft to filter on.
        main_shaft: The main shaft to filter on.
        power_inverter: The power inverter to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        List of Timeseries nacelle.acc_from_back_side_x.

    Examples:

        List nacelle.acc_from_back_side_x and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> nacelles = client.nacelle.acc_from_back_side_x.list(limit=5)

    """
    filter_ = _create_nacelle_filter(
        self._view_id,
        gearbox,
        generator,
        high_speed_shaft,
        main_shaft,
        power_inverter,
        external_id_prefix,
        space,
        filter,
    )
    external_ids = _retrieve_timeseries_external_ids_with_extra_acc_from_back_side_x(
        self._client, self._view_id, filter_, limit
    )
    if external_ids:
        return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
    else:
        return TimeSeriesList([])

NacelleAccFromBackSideYAPI

Source code in examples/windmill/_api/nacelle_acc_from_back_side_y.py
class NacelleAccFromBackSideYAPI:
    def __init__(self, client: CogniteClient, view_id: dm.ViewId):
        self._client = client
        self._view_id = view_id

    def __call__(
        self,
        gearbox: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        generator: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        high_speed_shaft: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        main_shaft: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        power_inverter: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> NacelleAccFromBackSideYQuery:
        """Query timeseries `nacelle.acc_from_back_side_y`

        Args:
            gearbox: The gearbox to filter on.
            generator: The generator to filter on.
            high_speed_shaft: The high speed shaft to filter on.
            main_shaft: The main shaft to filter on.
            power_inverter: The power inverter to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query object that can be used to retrieve datapoins for the nacelle.acc_from_back_side_y timeseries
            selected in this method.

        Examples:

            Retrieve all data for 5 nacelle.acc_from_back_side_y timeseries:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> nacelles = client.nacelle.acc_from_back_side_y(limit=5).retrieve()

        """
        filter_ = _create_nacelle_filter(
            self._view_id,
            gearbox,
            generator,
            high_speed_shaft,
            main_shaft,
            power_inverter,
            external_id_prefix,
            space,
            filter,
        )

        return NacelleAccFromBackSideYQuery(
            client=self._client,
            view_id=self._view_id,
            timeseries_limit=limit,
            filter=filter_,
        )

    def list(
        self,
        gearbox: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        generator: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        high_speed_shaft: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        main_shaft: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        power_inverter: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> TimeSeriesList:
        """List timeseries `nacelle.acc_from_back_side_y`

        Args:
            gearbox: The gearbox to filter on.
            generator: The generator to filter on.
            high_speed_shaft: The high speed shaft to filter on.
            main_shaft: The main shaft to filter on.
            power_inverter: The power inverter to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            List of Timeseries nacelle.acc_from_back_side_y.

        Examples:

            List nacelle.acc_from_back_side_y and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> nacelles = client.nacelle.acc_from_back_side_y.list(limit=5)

        """
        filter_ = _create_nacelle_filter(
            self._view_id,
            gearbox,
            generator,
            high_speed_shaft,
            main_shaft,
            power_inverter,
            external_id_prefix,
            space,
            filter,
        )
        external_ids = _retrieve_timeseries_external_ids_with_extra_acc_from_back_side_y(
            self._client, self._view_id, filter_, limit
        )
        if external_ids:
            return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
        else:
            return TimeSeriesList([])

__call__(gearbox=None, generator=None, high_speed_shaft=None, main_shaft=None, power_inverter=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Query timeseries nacelle.acc_from_back_side_y

Parameters:

Name Type Description Default
gearbox str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The gearbox to filter on.

None
generator str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The generator to filter on.

None
high_speed_shaft str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The high speed shaft to filter on.

None
main_shaft str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The main shaft to filter on.

None
power_inverter str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The power inverter to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
NacelleAccFromBackSideYQuery

A query object that can be used to retrieve datapoins for the nacelle.acc_from_back_side_y timeseries

NacelleAccFromBackSideYQuery

selected in this method.

Examples:

Retrieve all data for 5 nacelle.acc_from_back_side_y timeseries:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> nacelles = client.nacelle.acc_from_back_side_y(limit=5).retrieve()
Source code in examples/windmill/_api/nacelle_acc_from_back_side_y.py
def __call__(
    self,
    gearbox: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    generator: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    high_speed_shaft: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    main_shaft: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    power_inverter: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> NacelleAccFromBackSideYQuery:
    """Query timeseries `nacelle.acc_from_back_side_y`

    Args:
        gearbox: The gearbox to filter on.
        generator: The generator to filter on.
        high_speed_shaft: The high speed shaft to filter on.
        main_shaft: The main shaft to filter on.
        power_inverter: The power inverter to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query object that can be used to retrieve datapoins for the nacelle.acc_from_back_side_y timeseries
        selected in this method.

    Examples:

        Retrieve all data for 5 nacelle.acc_from_back_side_y timeseries:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> nacelles = client.nacelle.acc_from_back_side_y(limit=5).retrieve()

    """
    filter_ = _create_nacelle_filter(
        self._view_id,
        gearbox,
        generator,
        high_speed_shaft,
        main_shaft,
        power_inverter,
        external_id_prefix,
        space,
        filter,
    )

    return NacelleAccFromBackSideYQuery(
        client=self._client,
        view_id=self._view_id,
        timeseries_limit=limit,
        filter=filter_,
    )

list(gearbox=None, generator=None, high_speed_shaft=None, main_shaft=None, power_inverter=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

List timeseries nacelle.acc_from_back_side_y

Parameters:

Name Type Description Default
gearbox str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The gearbox to filter on.

None
generator str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The generator to filter on.

None
high_speed_shaft str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The high speed shaft to filter on.

None
main_shaft str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The main shaft to filter on.

None
power_inverter str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The power inverter to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
TimeSeriesList

List of Timeseries nacelle.acc_from_back_side_y.

Examples:

List nacelle.acc_from_back_side_y and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> nacelles = client.nacelle.acc_from_back_side_y.list(limit=5)
Source code in examples/windmill/_api/nacelle_acc_from_back_side_y.py
def list(
    self,
    gearbox: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    generator: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    high_speed_shaft: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    main_shaft: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    power_inverter: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> TimeSeriesList:
    """List timeseries `nacelle.acc_from_back_side_y`

    Args:
        gearbox: The gearbox to filter on.
        generator: The generator to filter on.
        high_speed_shaft: The high speed shaft to filter on.
        main_shaft: The main shaft to filter on.
        power_inverter: The power inverter to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        List of Timeseries nacelle.acc_from_back_side_y.

    Examples:

        List nacelle.acc_from_back_side_y and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> nacelles = client.nacelle.acc_from_back_side_y.list(limit=5)

    """
    filter_ = _create_nacelle_filter(
        self._view_id,
        gearbox,
        generator,
        high_speed_shaft,
        main_shaft,
        power_inverter,
        external_id_prefix,
        space,
        filter,
    )
    external_ids = _retrieve_timeseries_external_ids_with_extra_acc_from_back_side_y(
        self._client, self._view_id, filter_, limit
    )
    if external_ids:
        return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
    else:
        return TimeSeriesList([])

NacelleAccFromBackSideZAPI

Source code in examples/windmill/_api/nacelle_acc_from_back_side_z.py
class NacelleAccFromBackSideZAPI:
    def __init__(self, client: CogniteClient, view_id: dm.ViewId):
        self._client = client
        self._view_id = view_id

    def __call__(
        self,
        gearbox: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        generator: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        high_speed_shaft: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        main_shaft: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        power_inverter: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> NacelleAccFromBackSideZQuery:
        """Query timeseries `nacelle.acc_from_back_side_z`

        Args:
            gearbox: The gearbox to filter on.
            generator: The generator to filter on.
            high_speed_shaft: The high speed shaft to filter on.
            main_shaft: The main shaft to filter on.
            power_inverter: The power inverter to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query object that can be used to retrieve datapoins for the nacelle.acc_from_back_side_z timeseries
            selected in this method.

        Examples:

            Retrieve all data for 5 nacelle.acc_from_back_side_z timeseries:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> nacelles = client.nacelle.acc_from_back_side_z(limit=5).retrieve()

        """
        filter_ = _create_nacelle_filter(
            self._view_id,
            gearbox,
            generator,
            high_speed_shaft,
            main_shaft,
            power_inverter,
            external_id_prefix,
            space,
            filter,
        )

        return NacelleAccFromBackSideZQuery(
            client=self._client,
            view_id=self._view_id,
            timeseries_limit=limit,
            filter=filter_,
        )

    def list(
        self,
        gearbox: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        generator: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        high_speed_shaft: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        main_shaft: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        power_inverter: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> TimeSeriesList:
        """List timeseries `nacelle.acc_from_back_side_z`

        Args:
            gearbox: The gearbox to filter on.
            generator: The generator to filter on.
            high_speed_shaft: The high speed shaft to filter on.
            main_shaft: The main shaft to filter on.
            power_inverter: The power inverter to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            List of Timeseries nacelle.acc_from_back_side_z.

        Examples:

            List nacelle.acc_from_back_side_z and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> nacelles = client.nacelle.acc_from_back_side_z.list(limit=5)

        """
        filter_ = _create_nacelle_filter(
            self._view_id,
            gearbox,
            generator,
            high_speed_shaft,
            main_shaft,
            power_inverter,
            external_id_prefix,
            space,
            filter,
        )
        external_ids = _retrieve_timeseries_external_ids_with_extra_acc_from_back_side_z(
            self._client, self._view_id, filter_, limit
        )
        if external_ids:
            return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
        else:
            return TimeSeriesList([])

__call__(gearbox=None, generator=None, high_speed_shaft=None, main_shaft=None, power_inverter=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Query timeseries nacelle.acc_from_back_side_z

Parameters:

Name Type Description Default
gearbox str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The gearbox to filter on.

None
generator str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The generator to filter on.

None
high_speed_shaft str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The high speed shaft to filter on.

None
main_shaft str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The main shaft to filter on.

None
power_inverter str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The power inverter to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
NacelleAccFromBackSideZQuery

A query object that can be used to retrieve datapoins for the nacelle.acc_from_back_side_z timeseries

NacelleAccFromBackSideZQuery

selected in this method.

Examples:

Retrieve all data for 5 nacelle.acc_from_back_side_z timeseries:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> nacelles = client.nacelle.acc_from_back_side_z(limit=5).retrieve()
Source code in examples/windmill/_api/nacelle_acc_from_back_side_z.py
def __call__(
    self,
    gearbox: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    generator: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    high_speed_shaft: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    main_shaft: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    power_inverter: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> NacelleAccFromBackSideZQuery:
    """Query timeseries `nacelle.acc_from_back_side_z`

    Args:
        gearbox: The gearbox to filter on.
        generator: The generator to filter on.
        high_speed_shaft: The high speed shaft to filter on.
        main_shaft: The main shaft to filter on.
        power_inverter: The power inverter to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query object that can be used to retrieve datapoins for the nacelle.acc_from_back_side_z timeseries
        selected in this method.

    Examples:

        Retrieve all data for 5 nacelle.acc_from_back_side_z timeseries:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> nacelles = client.nacelle.acc_from_back_side_z(limit=5).retrieve()

    """
    filter_ = _create_nacelle_filter(
        self._view_id,
        gearbox,
        generator,
        high_speed_shaft,
        main_shaft,
        power_inverter,
        external_id_prefix,
        space,
        filter,
    )

    return NacelleAccFromBackSideZQuery(
        client=self._client,
        view_id=self._view_id,
        timeseries_limit=limit,
        filter=filter_,
    )

list(gearbox=None, generator=None, high_speed_shaft=None, main_shaft=None, power_inverter=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

List timeseries nacelle.acc_from_back_side_z

Parameters:

Name Type Description Default
gearbox str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The gearbox to filter on.

None
generator str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The generator to filter on.

None
high_speed_shaft str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The high speed shaft to filter on.

None
main_shaft str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The main shaft to filter on.

None
power_inverter str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The power inverter to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
TimeSeriesList

List of Timeseries nacelle.acc_from_back_side_z.

Examples:

List nacelle.acc_from_back_side_z and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> nacelles = client.nacelle.acc_from_back_side_z.list(limit=5)
Source code in examples/windmill/_api/nacelle_acc_from_back_side_z.py
def list(
    self,
    gearbox: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    generator: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    high_speed_shaft: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    main_shaft: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    power_inverter: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> TimeSeriesList:
    """List timeseries `nacelle.acc_from_back_side_z`

    Args:
        gearbox: The gearbox to filter on.
        generator: The generator to filter on.
        high_speed_shaft: The high speed shaft to filter on.
        main_shaft: The main shaft to filter on.
        power_inverter: The power inverter to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        List of Timeseries nacelle.acc_from_back_side_z.

    Examples:

        List nacelle.acc_from_back_side_z and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> nacelles = client.nacelle.acc_from_back_side_z.list(limit=5)

    """
    filter_ = _create_nacelle_filter(
        self._view_id,
        gearbox,
        generator,
        high_speed_shaft,
        main_shaft,
        power_inverter,
        external_id_prefix,
        space,
        filter,
    )
    external_ids = _retrieve_timeseries_external_ids_with_extra_acc_from_back_side_z(
        self._client, self._view_id, filter_, limit
    )
    if external_ids:
        return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
    else:
        return TimeSeriesList([])

NacelleQueryAPI

Bases: QueryAPI[T_DomainModelList]

Source code in examples/windmill/_api/nacelle_query.py
class NacelleQueryAPI(QueryAPI[T_DomainModelList]):
    _view_id = dm.ViewId("power-models", "Nacelle", "1")

    def __init__(
        self,
        client: CogniteClient,
        builder: QueryBuilder[T_DomainModelList],
        filter_: dm.filters.Filter | None = None,
        limit: int = DEFAULT_QUERY_LIMIT,
    ):
        super().__init__(client, builder)
        from_ = self._builder.get_from()
        self._builder.append(
            NodeQueryStep(
                name=self._builder.create_name(from_),
                expression=dm.query.NodeResultSetExpression(
                    from_=from_,
                    filter=filter_,
                ),
                result_cls=Nacelle,
                max_retrieve_limit=limit,
            )
        )

    def query(
        self,
        retrieve_gearbox: bool = False,
        retrieve_generator: bool = False,
        retrieve_high_speed_shaft: bool = False,
        retrieve_main_shaft: bool = False,
        retrieve_power_inverter: bool = False,
    ) -> T_DomainModelList:
        """Execute query and return the result.

        Args:
            retrieve_gearbox: Whether to retrieve the gearbox for each nacelle or not.
            retrieve_generator: Whether to retrieve the generator for each nacelle or not.
            retrieve_high_speed_shaft: Whether to retrieve the high speed shaft for each nacelle or not.
            retrieve_main_shaft: Whether to retrieve the main shaft for each nacelle or not.
            retrieve_power_inverter: Whether to retrieve the power inverter for each nacelle or not.

        Returns:
            The list of the source nodes of the query.

        """
        from_ = self._builder[-1].name
        if retrieve_gearbox:
            self._query_append_gearbox(from_)
        if retrieve_generator:
            self._query_append_generator(from_)
        if retrieve_high_speed_shaft:
            self._query_append_high_speed_shaft(from_)
        if retrieve_main_shaft:
            self._query_append_main_shaft(from_)
        if retrieve_power_inverter:
            self._query_append_power_inverter(from_)
        return self._query()

    def _query_append_gearbox(self, from_: str) -> None:
        self._builder.append(
            NodeQueryStep(
                name=self._builder.create_name(from_),
                expression=dm.query.NodeResultSetExpression(
                    from_=from_,
                    through=self._view_id.as_property_ref("gearbox"),
                    direction="outwards",
                    filter=dm.filters.HasData(views=[Gearbox._view_id]),
                ),
                result_cls=Gearbox,
            ),
        )

    def _query_append_generator(self, from_: str) -> None:
        self._builder.append(
            NodeQueryStep(
                name=self._builder.create_name(from_),
                expression=dm.query.NodeResultSetExpression(
                    from_=from_,
                    through=self._view_id.as_property_ref("generator"),
                    direction="outwards",
                    filter=dm.filters.HasData(views=[Generator._view_id]),
                ),
                result_cls=Generator,
            ),
        )

    def _query_append_high_speed_shaft(self, from_: str) -> None:
        self._builder.append(
            NodeQueryStep(
                name=self._builder.create_name(from_),
                expression=dm.query.NodeResultSetExpression(
                    from_=from_,
                    through=self._view_id.as_property_ref("high_speed_shaft"),
                    direction="outwards",
                    filter=dm.filters.HasData(views=[HighSpeedShaft._view_id]),
                ),
                result_cls=HighSpeedShaft,
            ),
        )

    def _query_append_main_shaft(self, from_: str) -> None:
        self._builder.append(
            NodeQueryStep(
                name=self._builder.create_name(from_),
                expression=dm.query.NodeResultSetExpression(
                    from_=from_,
                    through=self._view_id.as_property_ref("main_shaft"),
                    direction="outwards",
                    filter=dm.filters.HasData(views=[MainShaft._view_id]),
                ),
                result_cls=MainShaft,
            ),
        )

    def _query_append_power_inverter(self, from_: str) -> None:
        self._builder.append(
            NodeQueryStep(
                name=self._builder.create_name(from_),
                expression=dm.query.NodeResultSetExpression(
                    from_=from_,
                    through=self._view_id.as_property_ref("power_inverter"),
                    direction="outwards",
                    filter=dm.filters.HasData(views=[PowerInverter._view_id]),
                ),
                result_cls=PowerInverter,
            ),
        )

query(retrieve_gearbox=False, retrieve_generator=False, retrieve_high_speed_shaft=False, retrieve_main_shaft=False, retrieve_power_inverter=False)

Execute query and return the result.

Parameters:

Name Type Description Default
retrieve_gearbox bool

Whether to retrieve the gearbox for each nacelle or not.

False
retrieve_generator bool

Whether to retrieve the generator for each nacelle or not.

False
retrieve_high_speed_shaft bool

Whether to retrieve the high speed shaft for each nacelle or not.

False
retrieve_main_shaft bool

Whether to retrieve the main shaft for each nacelle or not.

False
retrieve_power_inverter bool

Whether to retrieve the power inverter for each nacelle or not.

False

Returns:

Type Description
T_DomainModelList

The list of the source nodes of the query.

Source code in examples/windmill/_api/nacelle_query.py
def query(
    self,
    retrieve_gearbox: bool = False,
    retrieve_generator: bool = False,
    retrieve_high_speed_shaft: bool = False,
    retrieve_main_shaft: bool = False,
    retrieve_power_inverter: bool = False,
) -> T_DomainModelList:
    """Execute query and return the result.

    Args:
        retrieve_gearbox: Whether to retrieve the gearbox for each nacelle or not.
        retrieve_generator: Whether to retrieve the generator for each nacelle or not.
        retrieve_high_speed_shaft: Whether to retrieve the high speed shaft for each nacelle or not.
        retrieve_main_shaft: Whether to retrieve the main shaft for each nacelle or not.
        retrieve_power_inverter: Whether to retrieve the power inverter for each nacelle or not.

    Returns:
        The list of the source nodes of the query.

    """
    from_ = self._builder[-1].name
    if retrieve_gearbox:
        self._query_append_gearbox(from_)
    if retrieve_generator:
        self._query_append_generator(from_)
    if retrieve_high_speed_shaft:
        self._query_append_high_speed_shaft(from_)
    if retrieve_main_shaft:
        self._query_append_main_shaft(from_)
    if retrieve_power_inverter:
        self._query_append_power_inverter(from_)
    return self._query()

NacelleYawDirectionAPI

Source code in examples/windmill/_api/nacelle_yaw_direction.py
class NacelleYawDirectionAPI:
    def __init__(self, client: CogniteClient, view_id: dm.ViewId):
        self._client = client
        self._view_id = view_id

    def __call__(
        self,
        gearbox: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        generator: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        high_speed_shaft: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        main_shaft: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        power_inverter: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> NacelleYawDirectionQuery:
        """Query timeseries `nacelle.yaw_direction`

        Args:
            gearbox: The gearbox to filter on.
            generator: The generator to filter on.
            high_speed_shaft: The high speed shaft to filter on.
            main_shaft: The main shaft to filter on.
            power_inverter: The power inverter to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query object that can be used to retrieve datapoins for the nacelle.yaw_direction timeseries
            selected in this method.

        Examples:

            Retrieve all data for 5 nacelle.yaw_direction timeseries:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> nacelles = client.nacelle.yaw_direction(limit=5).retrieve()

        """
        filter_ = _create_nacelle_filter(
            self._view_id,
            gearbox,
            generator,
            high_speed_shaft,
            main_shaft,
            power_inverter,
            external_id_prefix,
            space,
            filter,
        )

        return NacelleYawDirectionQuery(
            client=self._client,
            view_id=self._view_id,
            timeseries_limit=limit,
            filter=filter_,
        )

    def list(
        self,
        gearbox: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        generator: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        high_speed_shaft: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        main_shaft: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        power_inverter: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> TimeSeriesList:
        """List timeseries `nacelle.yaw_direction`

        Args:
            gearbox: The gearbox to filter on.
            generator: The generator to filter on.
            high_speed_shaft: The high speed shaft to filter on.
            main_shaft: The main shaft to filter on.
            power_inverter: The power inverter to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            List of Timeseries nacelle.yaw_direction.

        Examples:

            List nacelle.yaw_direction and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> nacelles = client.nacelle.yaw_direction.list(limit=5)

        """
        filter_ = _create_nacelle_filter(
            self._view_id,
            gearbox,
            generator,
            high_speed_shaft,
            main_shaft,
            power_inverter,
            external_id_prefix,
            space,
            filter,
        )
        external_ids = _retrieve_timeseries_external_ids_with_extra_yaw_direction(
            self._client, self._view_id, filter_, limit
        )
        if external_ids:
            return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
        else:
            return TimeSeriesList([])

__call__(gearbox=None, generator=None, high_speed_shaft=None, main_shaft=None, power_inverter=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Query timeseries nacelle.yaw_direction

Parameters:

Name Type Description Default
gearbox str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The gearbox to filter on.

None
generator str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The generator to filter on.

None
high_speed_shaft str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The high speed shaft to filter on.

None
main_shaft str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The main shaft to filter on.

None
power_inverter str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The power inverter to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
NacelleYawDirectionQuery

A query object that can be used to retrieve datapoins for the nacelle.yaw_direction timeseries

NacelleYawDirectionQuery

selected in this method.

Examples:

Retrieve all data for 5 nacelle.yaw_direction timeseries:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> nacelles = client.nacelle.yaw_direction(limit=5).retrieve()
Source code in examples/windmill/_api/nacelle_yaw_direction.py
def __call__(
    self,
    gearbox: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    generator: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    high_speed_shaft: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    main_shaft: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    power_inverter: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> NacelleYawDirectionQuery:
    """Query timeseries `nacelle.yaw_direction`

    Args:
        gearbox: The gearbox to filter on.
        generator: The generator to filter on.
        high_speed_shaft: The high speed shaft to filter on.
        main_shaft: The main shaft to filter on.
        power_inverter: The power inverter to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query object that can be used to retrieve datapoins for the nacelle.yaw_direction timeseries
        selected in this method.

    Examples:

        Retrieve all data for 5 nacelle.yaw_direction timeseries:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> nacelles = client.nacelle.yaw_direction(limit=5).retrieve()

    """
    filter_ = _create_nacelle_filter(
        self._view_id,
        gearbox,
        generator,
        high_speed_shaft,
        main_shaft,
        power_inverter,
        external_id_prefix,
        space,
        filter,
    )

    return NacelleYawDirectionQuery(
        client=self._client,
        view_id=self._view_id,
        timeseries_limit=limit,
        filter=filter_,
    )

list(gearbox=None, generator=None, high_speed_shaft=None, main_shaft=None, power_inverter=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

List timeseries nacelle.yaw_direction

Parameters:

Name Type Description Default
gearbox str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The gearbox to filter on.

None
generator str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The generator to filter on.

None
high_speed_shaft str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The high speed shaft to filter on.

None
main_shaft str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The main shaft to filter on.

None
power_inverter str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The power inverter to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
TimeSeriesList

List of Timeseries nacelle.yaw_direction.

Examples:

List nacelle.yaw_direction and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> nacelles = client.nacelle.yaw_direction.list(limit=5)
Source code in examples/windmill/_api/nacelle_yaw_direction.py
def list(
    self,
    gearbox: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    generator: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    high_speed_shaft: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    main_shaft: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    power_inverter: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> TimeSeriesList:
    """List timeseries `nacelle.yaw_direction`

    Args:
        gearbox: The gearbox to filter on.
        generator: The generator to filter on.
        high_speed_shaft: The high speed shaft to filter on.
        main_shaft: The main shaft to filter on.
        power_inverter: The power inverter to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        List of Timeseries nacelle.yaw_direction.

    Examples:

        List nacelle.yaw_direction and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> nacelles = client.nacelle.yaw_direction.list(limit=5)

    """
    filter_ = _create_nacelle_filter(
        self._view_id,
        gearbox,
        generator,
        high_speed_shaft,
        main_shaft,
        power_inverter,
        external_id_prefix,
        space,
        filter,
    )
    external_ids = _retrieve_timeseries_external_ids_with_extra_yaw_direction(
        self._client, self._view_id, filter_, limit
    )
    if external_ids:
        return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
    else:
        return TimeSeriesList([])

NacelleYawErrorAPI

Source code in examples/windmill/_api/nacelle_yaw_error.py
class NacelleYawErrorAPI:
    def __init__(self, client: CogniteClient, view_id: dm.ViewId):
        self._client = client
        self._view_id = view_id

    def __call__(
        self,
        gearbox: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        generator: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        high_speed_shaft: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        main_shaft: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        power_inverter: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> NacelleYawErrorQuery:
        """Query timeseries `nacelle.yaw_error`

        Args:
            gearbox: The gearbox to filter on.
            generator: The generator to filter on.
            high_speed_shaft: The high speed shaft to filter on.
            main_shaft: The main shaft to filter on.
            power_inverter: The power inverter to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query object that can be used to retrieve datapoins for the nacelle.yaw_error timeseries
            selected in this method.

        Examples:

            Retrieve all data for 5 nacelle.yaw_error timeseries:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> nacelles = client.nacelle.yaw_error(limit=5).retrieve()

        """
        filter_ = _create_nacelle_filter(
            self._view_id,
            gearbox,
            generator,
            high_speed_shaft,
            main_shaft,
            power_inverter,
            external_id_prefix,
            space,
            filter,
        )

        return NacelleYawErrorQuery(
            client=self._client,
            view_id=self._view_id,
            timeseries_limit=limit,
            filter=filter_,
        )

    def list(
        self,
        gearbox: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        generator: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        high_speed_shaft: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        main_shaft: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        power_inverter: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> TimeSeriesList:
        """List timeseries `nacelle.yaw_error`

        Args:
            gearbox: The gearbox to filter on.
            generator: The generator to filter on.
            high_speed_shaft: The high speed shaft to filter on.
            main_shaft: The main shaft to filter on.
            power_inverter: The power inverter to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            List of Timeseries nacelle.yaw_error.

        Examples:

            List nacelle.yaw_error and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> nacelles = client.nacelle.yaw_error.list(limit=5)

        """
        filter_ = _create_nacelle_filter(
            self._view_id,
            gearbox,
            generator,
            high_speed_shaft,
            main_shaft,
            power_inverter,
            external_id_prefix,
            space,
            filter,
        )
        external_ids = _retrieve_timeseries_external_ids_with_extra_yaw_error(
            self._client, self._view_id, filter_, limit
        )
        if external_ids:
            return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
        else:
            return TimeSeriesList([])

__call__(gearbox=None, generator=None, high_speed_shaft=None, main_shaft=None, power_inverter=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Query timeseries nacelle.yaw_error

Parameters:

Name Type Description Default
gearbox str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The gearbox to filter on.

None
generator str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The generator to filter on.

None
high_speed_shaft str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The high speed shaft to filter on.

None
main_shaft str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The main shaft to filter on.

None
power_inverter str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The power inverter to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
NacelleYawErrorQuery

A query object that can be used to retrieve datapoins for the nacelle.yaw_error timeseries

NacelleYawErrorQuery

selected in this method.

Examples:

Retrieve all data for 5 nacelle.yaw_error timeseries:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> nacelles = client.nacelle.yaw_error(limit=5).retrieve()
Source code in examples/windmill/_api/nacelle_yaw_error.py
def __call__(
    self,
    gearbox: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    generator: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    high_speed_shaft: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    main_shaft: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    power_inverter: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> NacelleYawErrorQuery:
    """Query timeseries `nacelle.yaw_error`

    Args:
        gearbox: The gearbox to filter on.
        generator: The generator to filter on.
        high_speed_shaft: The high speed shaft to filter on.
        main_shaft: The main shaft to filter on.
        power_inverter: The power inverter to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query object that can be used to retrieve datapoins for the nacelle.yaw_error timeseries
        selected in this method.

    Examples:

        Retrieve all data for 5 nacelle.yaw_error timeseries:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> nacelles = client.nacelle.yaw_error(limit=5).retrieve()

    """
    filter_ = _create_nacelle_filter(
        self._view_id,
        gearbox,
        generator,
        high_speed_shaft,
        main_shaft,
        power_inverter,
        external_id_prefix,
        space,
        filter,
    )

    return NacelleYawErrorQuery(
        client=self._client,
        view_id=self._view_id,
        timeseries_limit=limit,
        filter=filter_,
    )

list(gearbox=None, generator=None, high_speed_shaft=None, main_shaft=None, power_inverter=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

List timeseries nacelle.yaw_error

Parameters:

Name Type Description Default
gearbox str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The gearbox to filter on.

None
generator str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The generator to filter on.

None
high_speed_shaft str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The high speed shaft to filter on.

None
main_shaft str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The main shaft to filter on.

None
power_inverter str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The power inverter to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
TimeSeriesList

List of Timeseries nacelle.yaw_error.

Examples:

List nacelle.yaw_error and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> nacelles = client.nacelle.yaw_error.list(limit=5)
Source code in examples/windmill/_api/nacelle_yaw_error.py
def list(
    self,
    gearbox: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    generator: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    high_speed_shaft: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    main_shaft: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    power_inverter: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> TimeSeriesList:
    """List timeseries `nacelle.yaw_error`

    Args:
        gearbox: The gearbox to filter on.
        generator: The generator to filter on.
        high_speed_shaft: The high speed shaft to filter on.
        main_shaft: The main shaft to filter on.
        power_inverter: The power inverter to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of nacelles to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        List of Timeseries nacelle.yaw_error.

    Examples:

        List nacelle.yaw_error and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> nacelles = client.nacelle.yaw_error.list(limit=5)

    """
    filter_ = _create_nacelle_filter(
        self._view_id,
        gearbox,
        generator,
        high_speed_shaft,
        main_shaft,
        power_inverter,
        external_id_prefix,
        space,
        filter,
    )
    external_ids = _retrieve_timeseries_external_ids_with_extra_yaw_error(
        self._client, self._view_id, filter_, limit
    )
    if external_ids:
        return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
    else:
        return TimeSeriesList([])

PowerInverterAPI

Bases: NodeAPI[PowerInverter, PowerInverterWrite, PowerInverterList, PowerInverterWriteList]

Source code in examples/windmill/_api/power_inverter.py
class PowerInverterAPI(NodeAPI[PowerInverter, PowerInverterWrite, PowerInverterList, PowerInverterWriteList]):
    _view_id = dm.ViewId("power-models", "PowerInverter", "1")
    _properties_by_field = _POWERINVERTER_PROPERTIES_BY_FIELD
    _class_type = PowerInverter
    _class_list = PowerInverterList
    _class_write_list = PowerInverterWriteList

    def __init__(self, client: CogniteClient):
        super().__init__(client=client)

        self.active_power_total = PowerInverterActivePowerTotalAPI(client, self._view_id)
        self.apparent_power_total = PowerInverterApparentPowerTotalAPI(client, self._view_id)
        self.reactive_power_total = PowerInverterReactivePowerTotalAPI(client, self._view_id)

    def __call__(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_QUERY_LIMIT,
        filter: dm.Filter | None = None,
    ) -> PowerInverterQueryAPI[PowerInverterList]:
        """Query starting at power inverters.

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of power inverters to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query API for power inverters.

        """
        has_data = dm.filters.HasData(views=[self._view_id])
        filter_ = _create_power_inverter_filter(
            self._view_id,
            external_id_prefix,
            space,
            (filter and dm.filters.And(filter, has_data)) or has_data,
        )
        builder = QueryBuilder(PowerInverterList)
        return PowerInverterQueryAPI(self._client, builder, filter_, limit)

    def apply(
        self,
        power_inverter: PowerInverterWrite | Sequence[PowerInverterWrite],
        replace: bool = False,
        write_none: bool = False,
    ) -> ResourcesWriteResult:
        """Add or update (upsert) power inverters.

        Args:
            power_inverter: Power inverter or sequence of power inverters to upsert.
            replace (bool): How do we behave when a property value exists? Do we replace all matching and existing values with the supplied values (true)?
                Or should we merge in new values for properties together with the existing values (false)? Note: This setting applies for all nodes or edges specified in the ingestion call.
            write_none (bool): This method, will by default, skip properties that are set to None. However, if you want to set properties to None,
                you can set this parameter to True. Note this only applies to properties that are nullable.
        Returns:
            Created instance(s), i.e., nodes, edges, and time series.

        Examples:

            Create a new power_inverter:

                >>> from windmill import WindmillClient
                >>> from windmill.data_classes import PowerInverterWrite
                >>> client = WindmillClient()
                >>> power_inverter = PowerInverterWrite(external_id="my_power_inverter", ...)
                >>> result = client.power_inverter.apply(power_inverter)

        """
        warnings.warn(
            "The .apply method is deprecated and will be removed in v1.0. "
            "Please use the .upsert method on the client instead. This means instead of "
            "`my_client.power_inverter.apply(my_items)` please use `my_client.upsert(my_items)`."
            "The motivation is that all apply methods are the same, and having one apply method per API "
            " class encourages users to create items in small batches, which is inefficient."
            "In addition, .upsert method is more descriptive of what the method does.",
            UserWarning,
            stacklevel=2,
        )
        return self._apply(power_inverter, replace, write_none)

    def delete(
        self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
    ) -> dm.InstancesDeleteResult:
        """Delete one or more power inverter.

        Args:
            external_id: External id of the power inverter to delete.
            space: The space where all the power inverter are located.

        Returns:
            The instance(s), i.e., nodes and edges which has been deleted. Empty list if nothing was deleted.

        Examples:

            Delete power_inverter by id:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> client.power_inverter.delete("my_power_inverter")
        """
        warnings.warn(
            "The .delete method is deprecated and will be removed in v1.0. "
            "Please use the .delete method on the client instead. This means instead of "
            "`my_client.power_inverter.delete(my_ids)` please use `my_client.delete(my_ids)`."
            "The motivation is that all delete methods are the same, and having one delete method per API "
            " class encourages users to delete items in small batches, which is inefficient.",
            UserWarning,
            stacklevel=2,
        )
        return self._delete(external_id, space)

    @overload
    def retrieve(self, external_id: str, space: str = DEFAULT_INSTANCE_SPACE) -> PowerInverter | None: ...

    @overload
    def retrieve(self, external_id: SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE) -> PowerInverterList: ...

    def retrieve(
        self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
    ) -> PowerInverter | PowerInverterList | None:
        """Retrieve one or more power inverters by id(s).

        Args:
            external_id: External id or list of external ids of the power inverters.
            space: The space where all the power inverters are located.

        Returns:
            The requested power inverters.

        Examples:

            Retrieve power_inverter by id:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> power_inverter = client.power_inverter.retrieve("my_power_inverter")

        """
        return self._retrieve(external_id, space)

    def search(
        self,
        query: str,
        properties: PowerInverterTextFields | SequenceNotStr[PowerInverterTextFields] | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
        sort_by: PowerInverterFields | SequenceNotStr[PowerInverterFields] | None = None,
        direction: Literal["ascending", "descending"] = "ascending",
        sort: InstanceSort | list[InstanceSort] | None = None,
    ) -> PowerInverterList:
        """Search power inverters

        Args:
            query: The search query,
            properties: The property to search, if nothing is passed all text fields will be searched.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of power inverters to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
            sort_by: The property to sort by.
            direction: The direction to sort by, either 'ascending' or 'descending'.
            sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
                This will override the sort_by and direction. This allowos you to sort by multiple fields and
                specify the direction for each field as well as how to handle null values.

        Returns:
            Search results power inverters matching the query.

        Examples:

           Search for 'my_power_inverter' in all text properties:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> power_inverters = client.power_inverter.search('my_power_inverter')

        """
        filter_ = _create_power_inverter_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )
        return self._search(
            query=query,
            properties=properties,
            filter_=filter_,
            limit=limit,
            sort_by=sort_by,  # type: ignore[arg-type]
            direction=direction,
            sort=sort,
        )

    @overload
    def aggregate(
        self,
        aggregate: Aggregations | dm.aggregations.MetricAggregation,
        group_by: None = None,
        property: PowerInverterFields | SequenceNotStr[PowerInverterFields] | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> dm.aggregations.AggregatedNumberedValue: ...

    @overload
    def aggregate(
        self,
        aggregate: SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation],
        group_by: None = None,
        property: PowerInverterFields | SequenceNotStr[PowerInverterFields] | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> list[dm.aggregations.AggregatedNumberedValue]: ...

    @overload
    def aggregate(
        self,
        aggregate: (
            Aggregations
            | dm.aggregations.MetricAggregation
            | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation]
        ),
        group_by: PowerInverterFields | SequenceNotStr[PowerInverterFields],
        property: PowerInverterFields | SequenceNotStr[PowerInverterFields] | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> InstanceAggregationResultList: ...

    def aggregate(
        self,
        aggregate: (
            Aggregations
            | dm.aggregations.MetricAggregation
            | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation]
        ),
        group_by: PowerInverterFields | SequenceNotStr[PowerInverterFields] | None = None,
        property: PowerInverterFields | SequenceNotStr[PowerInverterFields] | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> (
        dm.aggregations.AggregatedNumberedValue
        | list[dm.aggregations.AggregatedNumberedValue]
        | InstanceAggregationResultList
    ):
        """Aggregate data across power inverters

        Args:
            aggregate: The aggregation to perform.
            group_by: The property to group by when doing the aggregation.
            property: The property to perform aggregation on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of power inverters to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            Aggregation results.

        Examples:

            Count power inverters in space `my_space`:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> result = client.power_inverter.aggregate("count", space="my_space")

        """

        filter_ = _create_power_inverter_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )
        return self._aggregate(
            aggregate=aggregate,
            group_by=group_by,  # type: ignore[arg-type]
            properties=property,  # type: ignore[arg-type]
            query=None,
            search_properties=None,
            limit=limit,
            filter=filter_,
        )

    def histogram(
        self,
        property: PowerInverterFields,
        interval: float,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> dm.aggregations.HistogramValue:
        """Produces histograms for power inverters

        Args:
            property: The property to use as the value in the histogram.
            interval: The interval to use for the histogram bins.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of power inverters to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            Bucketed histogram results.

        """
        filter_ = _create_power_inverter_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )
        return self._histogram(
            property,
            interval,
            None,
            None,
            limit,
            filter_,
        )

    def query(self) -> PowerInverterQuery:
        """Start a query for power inverters."""
        warnings.warn("The .query is in alpha and is subject to breaking changes without notice.")
        return PowerInverterQuery(self._client)

    def list(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
        sort_by: PowerInverterFields | Sequence[PowerInverterFields] | None = None,
        direction: Literal["ascending", "descending"] = "ascending",
        sort: InstanceSort | list[InstanceSort] | None = None,
    ) -> PowerInverterList:
        """List/filter power inverters

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of power inverters to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
            sort_by: The property to sort by.
            direction: The direction to sort by, either 'ascending' or 'descending'.
            sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
                This will override the sort_by and direction. This allowos you to sort by multiple fields and
                specify the direction for each field as well as how to handle null values.

        Returns:
            List of requested power inverters

        Examples:

            List power inverters and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> power_inverters = client.power_inverter.list(limit=5)

        """
        filter_ = _create_power_inverter_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )

        return self._list(
            limit=limit,
            filter=filter_,
            sort_by=sort_by,  # type: ignore[arg-type]
            direction=direction,
            sort=sort,
        )

__call__(external_id_prefix=None, space=None, limit=DEFAULT_QUERY_LIMIT, filter=None)

Query starting at power inverters.

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of power inverters to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_QUERY_LIMIT
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
PowerInverterQueryAPI[PowerInverterList]

A query API for power inverters.

Source code in examples/windmill/_api/power_inverter.py
def __call__(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_QUERY_LIMIT,
    filter: dm.Filter | None = None,
) -> PowerInverterQueryAPI[PowerInverterList]:
    """Query starting at power inverters.

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of power inverters to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query API for power inverters.

    """
    has_data = dm.filters.HasData(views=[self._view_id])
    filter_ = _create_power_inverter_filter(
        self._view_id,
        external_id_prefix,
        space,
        (filter and dm.filters.And(filter, has_data)) or has_data,
    )
    builder = QueryBuilder(PowerInverterList)
    return PowerInverterQueryAPI(self._client, builder, filter_, limit)

aggregate(aggregate, group_by=None, property=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

aggregate(aggregate: Aggregations | dm.aggregations.MetricAggregation, group_by: None = None, property: PowerInverterFields | SequenceNotStr[PowerInverterFields] | None = None, external_id_prefix: str | None = None, space: str | list[str] | None = None, limit: int = DEFAULT_LIMIT_READ, filter: dm.Filter | None = None) -> dm.aggregations.AggregatedNumberedValue
aggregate(aggregate: SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation], group_by: None = None, property: PowerInverterFields | SequenceNotStr[PowerInverterFields] | None = None, external_id_prefix: str | None = None, space: str | list[str] | None = None, limit: int = DEFAULT_LIMIT_READ, filter: dm.Filter | None = None) -> list[dm.aggregations.AggregatedNumberedValue]
aggregate(aggregate: Aggregations | dm.aggregations.MetricAggregation | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation], group_by: PowerInverterFields | SequenceNotStr[PowerInverterFields], property: PowerInverterFields | SequenceNotStr[PowerInverterFields] | None = None, external_id_prefix: str | None = None, space: str | list[str] | None = None, limit: int = DEFAULT_LIMIT_READ, filter: dm.Filter | None = None) -> InstanceAggregationResultList

Aggregate data across power inverters

Parameters:

Name Type Description Default
aggregate Aggregations | MetricAggregation | SequenceNotStr[Aggregations | MetricAggregation]

The aggregation to perform.

required
group_by PowerInverterFields | SequenceNotStr[PowerInverterFields] | None

The property to group by when doing the aggregation.

None
property PowerInverterFields | SequenceNotStr[PowerInverterFields] | None

The property to perform aggregation on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of power inverters to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
AggregatedNumberedValue | list[AggregatedNumberedValue] | InstanceAggregationResultList

Aggregation results.

Examples:

Count power inverters in space `my_space`:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> result = client.power_inverter.aggregate("count", space="my_space")
Source code in examples/windmill/_api/power_inverter.py
def aggregate(
    self,
    aggregate: (
        Aggregations
        | dm.aggregations.MetricAggregation
        | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation]
    ),
    group_by: PowerInverterFields | SequenceNotStr[PowerInverterFields] | None = None,
    property: PowerInverterFields | SequenceNotStr[PowerInverterFields] | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> (
    dm.aggregations.AggregatedNumberedValue
    | list[dm.aggregations.AggregatedNumberedValue]
    | InstanceAggregationResultList
):
    """Aggregate data across power inverters

    Args:
        aggregate: The aggregation to perform.
        group_by: The property to group by when doing the aggregation.
        property: The property to perform aggregation on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of power inverters to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        Aggregation results.

    Examples:

        Count power inverters in space `my_space`:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> result = client.power_inverter.aggregate("count", space="my_space")

    """

    filter_ = _create_power_inverter_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )
    return self._aggregate(
        aggregate=aggregate,
        group_by=group_by,  # type: ignore[arg-type]
        properties=property,  # type: ignore[arg-type]
        query=None,
        search_properties=None,
        limit=limit,
        filter=filter_,
    )

apply(power_inverter, replace=False, write_none=False)

Add or update (upsert) power inverters.

Parameters:

Name Type Description Default
power_inverter PowerInverterWrite | Sequence[PowerInverterWrite]

Power inverter or sequence of power inverters to upsert.

required
replace bool

How do we behave when a property value exists? Do we replace all matching and existing values with the supplied values (true)? Or should we merge in new values for properties together with the existing values (false)? Note: This setting applies for all nodes or edges specified in the ingestion call.

False
write_none bool

This method, will by default, skip properties that are set to None. However, if you want to set properties to None, you can set this parameter to True. Note this only applies to properties that are nullable.

False

Returns: Created instance(s), i.e., nodes, edges, and time series.

Examples:

Create a new power_inverter:

    >>> from windmill import WindmillClient
    >>> from windmill.data_classes import PowerInverterWrite
    >>> client = WindmillClient()
    >>> power_inverter = PowerInverterWrite(external_id="my_power_inverter", ...)
    >>> result = client.power_inverter.apply(power_inverter)
Source code in examples/windmill/_api/power_inverter.py
def apply(
    self,
    power_inverter: PowerInverterWrite | Sequence[PowerInverterWrite],
    replace: bool = False,
    write_none: bool = False,
) -> ResourcesWriteResult:
    """Add or update (upsert) power inverters.

    Args:
        power_inverter: Power inverter or sequence of power inverters to upsert.
        replace (bool): How do we behave when a property value exists? Do we replace all matching and existing values with the supplied values (true)?
            Or should we merge in new values for properties together with the existing values (false)? Note: This setting applies for all nodes or edges specified in the ingestion call.
        write_none (bool): This method, will by default, skip properties that are set to None. However, if you want to set properties to None,
            you can set this parameter to True. Note this only applies to properties that are nullable.
    Returns:
        Created instance(s), i.e., nodes, edges, and time series.

    Examples:

        Create a new power_inverter:

            >>> from windmill import WindmillClient
            >>> from windmill.data_classes import PowerInverterWrite
            >>> client = WindmillClient()
            >>> power_inverter = PowerInverterWrite(external_id="my_power_inverter", ...)
            >>> result = client.power_inverter.apply(power_inverter)

    """
    warnings.warn(
        "The .apply method is deprecated and will be removed in v1.0. "
        "Please use the .upsert method on the client instead. This means instead of "
        "`my_client.power_inverter.apply(my_items)` please use `my_client.upsert(my_items)`."
        "The motivation is that all apply methods are the same, and having one apply method per API "
        " class encourages users to create items in small batches, which is inefficient."
        "In addition, .upsert method is more descriptive of what the method does.",
        UserWarning,
        stacklevel=2,
    )
    return self._apply(power_inverter, replace, write_none)

delete(external_id, space=DEFAULT_INSTANCE_SPACE)

Delete one or more power inverter.

Parameters:

Name Type Description Default
external_id str | SequenceNotStr[str]

External id of the power inverter to delete.

required
space str

The space where all the power inverter are located.

DEFAULT_INSTANCE_SPACE

Returns:

Type Description
InstancesDeleteResult

The instance(s), i.e., nodes and edges which has been deleted. Empty list if nothing was deleted.

Examples:

Delete power_inverter by id:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> client.power_inverter.delete("my_power_inverter")
Source code in examples/windmill/_api/power_inverter.py
def delete(
    self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
) -> dm.InstancesDeleteResult:
    """Delete one or more power inverter.

    Args:
        external_id: External id of the power inverter to delete.
        space: The space where all the power inverter are located.

    Returns:
        The instance(s), i.e., nodes and edges which has been deleted. Empty list if nothing was deleted.

    Examples:

        Delete power_inverter by id:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> client.power_inverter.delete("my_power_inverter")
    """
    warnings.warn(
        "The .delete method is deprecated and will be removed in v1.0. "
        "Please use the .delete method on the client instead. This means instead of "
        "`my_client.power_inverter.delete(my_ids)` please use `my_client.delete(my_ids)`."
        "The motivation is that all delete methods are the same, and having one delete method per API "
        " class encourages users to delete items in small batches, which is inefficient.",
        UserWarning,
        stacklevel=2,
    )
    return self._delete(external_id, space)

histogram(property, interval, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Produces histograms for power inverters

Parameters:

Name Type Description Default
property PowerInverterFields

The property to use as the value in the histogram.

required
interval float

The interval to use for the histogram bins.

required
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of power inverters to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
HistogramValue

Bucketed histogram results.

Source code in examples/windmill/_api/power_inverter.py
def histogram(
    self,
    property: PowerInverterFields,
    interval: float,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> dm.aggregations.HistogramValue:
    """Produces histograms for power inverters

    Args:
        property: The property to use as the value in the histogram.
        interval: The interval to use for the histogram bins.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of power inverters to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        Bucketed histogram results.

    """
    filter_ = _create_power_inverter_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )
    return self._histogram(
        property,
        interval,
        None,
        None,
        limit,
        filter_,
    )

list(external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None, sort_by=None, direction='ascending', sort=None)

List/filter power inverters

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of power inverters to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None
sort_by PowerInverterFields | Sequence[PowerInverterFields] | None

The property to sort by.

None
direction Literal['ascending', 'descending']

The direction to sort by, either 'ascending' or 'descending'.

'ascending'
sort InstanceSort | list[InstanceSort] | None

(Advanced) If sort_by and direction are not sufficient, you can write your own sorting. This will override the sort_by and direction. This allowos you to sort by multiple fields and specify the direction for each field as well as how to handle null values.

None

Returns:

Type Description
PowerInverterList

List of requested power inverters

Examples:

List power inverters and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> power_inverters = client.power_inverter.list(limit=5)
Source code in examples/windmill/_api/power_inverter.py
def list(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
    sort_by: PowerInverterFields | Sequence[PowerInverterFields] | None = None,
    direction: Literal["ascending", "descending"] = "ascending",
    sort: InstanceSort | list[InstanceSort] | None = None,
) -> PowerInverterList:
    """List/filter power inverters

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of power inverters to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
        sort_by: The property to sort by.
        direction: The direction to sort by, either 'ascending' or 'descending'.
        sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
            This will override the sort_by and direction. This allowos you to sort by multiple fields and
            specify the direction for each field as well as how to handle null values.

    Returns:
        List of requested power inverters

    Examples:

        List power inverters and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> power_inverters = client.power_inverter.list(limit=5)

    """
    filter_ = _create_power_inverter_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )

    return self._list(
        limit=limit,
        filter=filter_,
        sort_by=sort_by,  # type: ignore[arg-type]
        direction=direction,
        sort=sort,
    )

query()

Start a query for power inverters.

Source code in examples/windmill/_api/power_inverter.py
def query(self) -> PowerInverterQuery:
    """Start a query for power inverters."""
    warnings.warn("The .query is in alpha and is subject to breaking changes without notice.")
    return PowerInverterQuery(self._client)

retrieve(external_id, space=DEFAULT_INSTANCE_SPACE)

retrieve(external_id: str, space: str = DEFAULT_INSTANCE_SPACE) -> PowerInverter | None
retrieve(external_id: SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE) -> PowerInverterList

Retrieve one or more power inverters by id(s).

Parameters:

Name Type Description Default
external_id str | SequenceNotStr[str]

External id or list of external ids of the power inverters.

required
space str

The space where all the power inverters are located.

DEFAULT_INSTANCE_SPACE

Returns:

Type Description
PowerInverter | PowerInverterList | None

The requested power inverters.

Examples:

Retrieve power_inverter by id:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> power_inverter = client.power_inverter.retrieve("my_power_inverter")
Source code in examples/windmill/_api/power_inverter.py
def retrieve(
    self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
) -> PowerInverter | PowerInverterList | None:
    """Retrieve one or more power inverters by id(s).

    Args:
        external_id: External id or list of external ids of the power inverters.
        space: The space where all the power inverters are located.

    Returns:
        The requested power inverters.

    Examples:

        Retrieve power_inverter by id:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> power_inverter = client.power_inverter.retrieve("my_power_inverter")

    """
    return self._retrieve(external_id, space)

search(query, properties=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None, sort_by=None, direction='ascending', sort=None)

Search power inverters

Parameters:

Name Type Description Default
query str

The search query,

required
properties PowerInverterTextFields | SequenceNotStr[PowerInverterTextFields] | None

The property to search, if nothing is passed all text fields will be searched.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of power inverters to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None
sort_by PowerInverterFields | SequenceNotStr[PowerInverterFields] | None

The property to sort by.

None
direction Literal['ascending', 'descending']

The direction to sort by, either 'ascending' or 'descending'.

'ascending'
sort InstanceSort | list[InstanceSort] | None

(Advanced) If sort_by and direction are not sufficient, you can write your own sorting. This will override the sort_by and direction. This allowos you to sort by multiple fields and specify the direction for each field as well as how to handle null values.

None

Returns:

Type Description
PowerInverterList

Search results power inverters matching the query.

Examples:

Search for 'my_power_inverter' in all text properties:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> power_inverters = client.power_inverter.search('my_power_inverter')
Source code in examples/windmill/_api/power_inverter.py
def search(
    self,
    query: str,
    properties: PowerInverterTextFields | SequenceNotStr[PowerInverterTextFields] | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
    sort_by: PowerInverterFields | SequenceNotStr[PowerInverterFields] | None = None,
    direction: Literal["ascending", "descending"] = "ascending",
    sort: InstanceSort | list[InstanceSort] | None = None,
) -> PowerInverterList:
    """Search power inverters

    Args:
        query: The search query,
        properties: The property to search, if nothing is passed all text fields will be searched.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of power inverters to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
        sort_by: The property to sort by.
        direction: The direction to sort by, either 'ascending' or 'descending'.
        sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
            This will override the sort_by and direction. This allowos you to sort by multiple fields and
            specify the direction for each field as well as how to handle null values.

    Returns:
        Search results power inverters matching the query.

    Examples:

       Search for 'my_power_inverter' in all text properties:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> power_inverters = client.power_inverter.search('my_power_inverter')

    """
    filter_ = _create_power_inverter_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )
    return self._search(
        query=query,
        properties=properties,
        filter_=filter_,
        limit=limit,
        sort_by=sort_by,  # type: ignore[arg-type]
        direction=direction,
        sort=sort,
    )

PowerInverterActivePowerTotalAPI

Source code in examples/windmill/_api/power_inverter_active_power_total.py
class PowerInverterActivePowerTotalAPI:
    def __init__(self, client: CogniteClient, view_id: dm.ViewId):
        self._client = client
        self._view_id = view_id

    def __call__(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> PowerInverterActivePowerTotalQuery:
        """Query timeseries `power_inverter.active_power_total`

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of power inverters to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query object that can be used to retrieve datapoins for the power_inverter.active_power_total timeseries
            selected in this method.

        Examples:

            Retrieve all data for 5 power_inverter.active_power_total timeseries:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> power_inverters = client.power_inverter.active_power_total(limit=5).retrieve()

        """
        filter_ = _create_power_inverter_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )

        return PowerInverterActivePowerTotalQuery(
            client=self._client,
            view_id=self._view_id,
            timeseries_limit=limit,
            filter=filter_,
        )

    def list(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> TimeSeriesList:
        """List timeseries `power_inverter.active_power_total`

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of power inverters to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            List of Timeseries power_inverter.active_power_total.

        Examples:

            List power_inverter.active_power_total and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> power_inverters = client.power_inverter.active_power_total.list(limit=5)

        """
        filter_ = _create_power_inverter_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )
        external_ids = _retrieve_timeseries_external_ids_with_extra_active_power_total(
            self._client, self._view_id, filter_, limit
        )
        if external_ids:
            return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
        else:
            return TimeSeriesList([])

__call__(external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Query timeseries power_inverter.active_power_total

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of power inverters to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
PowerInverterActivePowerTotalQuery

A query object that can be used to retrieve datapoins for the power_inverter.active_power_total timeseries

PowerInverterActivePowerTotalQuery

selected in this method.

Examples:

Retrieve all data for 5 power_inverter.active_power_total timeseries:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> power_inverters = client.power_inverter.active_power_total(limit=5).retrieve()
Source code in examples/windmill/_api/power_inverter_active_power_total.py
def __call__(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> PowerInverterActivePowerTotalQuery:
    """Query timeseries `power_inverter.active_power_total`

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of power inverters to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query object that can be used to retrieve datapoins for the power_inverter.active_power_total timeseries
        selected in this method.

    Examples:

        Retrieve all data for 5 power_inverter.active_power_total timeseries:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> power_inverters = client.power_inverter.active_power_total(limit=5).retrieve()

    """
    filter_ = _create_power_inverter_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )

    return PowerInverterActivePowerTotalQuery(
        client=self._client,
        view_id=self._view_id,
        timeseries_limit=limit,
        filter=filter_,
    )

list(external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

List timeseries power_inverter.active_power_total

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of power inverters to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
TimeSeriesList

List of Timeseries power_inverter.active_power_total.

Examples:

List power_inverter.active_power_total and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> power_inverters = client.power_inverter.active_power_total.list(limit=5)
Source code in examples/windmill/_api/power_inverter_active_power_total.py
def list(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> TimeSeriesList:
    """List timeseries `power_inverter.active_power_total`

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of power inverters to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        List of Timeseries power_inverter.active_power_total.

    Examples:

        List power_inverter.active_power_total and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> power_inverters = client.power_inverter.active_power_total.list(limit=5)

    """
    filter_ = _create_power_inverter_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )
    external_ids = _retrieve_timeseries_external_ids_with_extra_active_power_total(
        self._client, self._view_id, filter_, limit
    )
    if external_ids:
        return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
    else:
        return TimeSeriesList([])

PowerInverterApparentPowerTotalAPI

Source code in examples/windmill/_api/power_inverter_apparent_power_total.py
class PowerInverterApparentPowerTotalAPI:
    def __init__(self, client: CogniteClient, view_id: dm.ViewId):
        self._client = client
        self._view_id = view_id

    def __call__(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> PowerInverterApparentPowerTotalQuery:
        """Query timeseries `power_inverter.apparent_power_total`

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of power inverters to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query object that can be used to retrieve datapoins for the power_inverter.apparent_power_total timeseries
            selected in this method.

        Examples:

            Retrieve all data for 5 power_inverter.apparent_power_total timeseries:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> power_inverters = client.power_inverter.apparent_power_total(limit=5).retrieve()

        """
        filter_ = _create_power_inverter_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )

        return PowerInverterApparentPowerTotalQuery(
            client=self._client,
            view_id=self._view_id,
            timeseries_limit=limit,
            filter=filter_,
        )

    def list(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> TimeSeriesList:
        """List timeseries `power_inverter.apparent_power_total`

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of power inverters to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            List of Timeseries power_inverter.apparent_power_total.

        Examples:

            List power_inverter.apparent_power_total and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> power_inverters = client.power_inverter.apparent_power_total.list(limit=5)

        """
        filter_ = _create_power_inverter_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )
        external_ids = _retrieve_timeseries_external_ids_with_extra_apparent_power_total(
            self._client, self._view_id, filter_, limit
        )
        if external_ids:
            return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
        else:
            return TimeSeriesList([])

__call__(external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Query timeseries power_inverter.apparent_power_total

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of power inverters to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
PowerInverterApparentPowerTotalQuery

A query object that can be used to retrieve datapoins for the power_inverter.apparent_power_total timeseries

PowerInverterApparentPowerTotalQuery

selected in this method.

Examples:

Retrieve all data for 5 power_inverter.apparent_power_total timeseries:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> power_inverters = client.power_inverter.apparent_power_total(limit=5).retrieve()
Source code in examples/windmill/_api/power_inverter_apparent_power_total.py
def __call__(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> PowerInverterApparentPowerTotalQuery:
    """Query timeseries `power_inverter.apparent_power_total`

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of power inverters to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query object that can be used to retrieve datapoins for the power_inverter.apparent_power_total timeseries
        selected in this method.

    Examples:

        Retrieve all data for 5 power_inverter.apparent_power_total timeseries:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> power_inverters = client.power_inverter.apparent_power_total(limit=5).retrieve()

    """
    filter_ = _create_power_inverter_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )

    return PowerInverterApparentPowerTotalQuery(
        client=self._client,
        view_id=self._view_id,
        timeseries_limit=limit,
        filter=filter_,
    )

list(external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

List timeseries power_inverter.apparent_power_total

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of power inverters to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
TimeSeriesList

List of Timeseries power_inverter.apparent_power_total.

Examples:

List power_inverter.apparent_power_total and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> power_inverters = client.power_inverter.apparent_power_total.list(limit=5)
Source code in examples/windmill/_api/power_inverter_apparent_power_total.py
def list(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> TimeSeriesList:
    """List timeseries `power_inverter.apparent_power_total`

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of power inverters to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        List of Timeseries power_inverter.apparent_power_total.

    Examples:

        List power_inverter.apparent_power_total and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> power_inverters = client.power_inverter.apparent_power_total.list(limit=5)

    """
    filter_ = _create_power_inverter_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )
    external_ids = _retrieve_timeseries_external_ids_with_extra_apparent_power_total(
        self._client, self._view_id, filter_, limit
    )
    if external_ids:
        return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
    else:
        return TimeSeriesList([])

PowerInverterQueryAPI

Bases: QueryAPI[T_DomainModelList]

Source code in examples/windmill/_api/power_inverter_query.py
class PowerInverterQueryAPI(QueryAPI[T_DomainModelList]):
    _view_id = dm.ViewId("power-models", "PowerInverter", "1")

    def __init__(
        self,
        client: CogniteClient,
        builder: QueryBuilder[T_DomainModelList],
        filter_: dm.filters.Filter | None = None,
        limit: int = DEFAULT_QUERY_LIMIT,
    ):
        super().__init__(client, builder)
        from_ = self._builder.get_from()
        self._builder.append(
            NodeQueryStep(
                name=self._builder.create_name(from_),
                expression=dm.query.NodeResultSetExpression(
                    from_=from_,
                    filter=filter_,
                ),
                result_cls=PowerInverter,
                max_retrieve_limit=limit,
            )
        )

    def query(
        self,
    ) -> T_DomainModelList:
        """Execute query and return the result.

        Returns:
            The list of the source nodes of the query.

        """
        return self._query()

query()

Execute query and return the result.

Returns:

Type Description
T_DomainModelList

The list of the source nodes of the query.

Source code in examples/windmill/_api/power_inverter_query.py
def query(
    self,
) -> T_DomainModelList:
    """Execute query and return the result.

    Returns:
        The list of the source nodes of the query.

    """
    return self._query()

PowerInverterReactivePowerTotalAPI

Source code in examples/windmill/_api/power_inverter_reactive_power_total.py
class PowerInverterReactivePowerTotalAPI:
    def __init__(self, client: CogniteClient, view_id: dm.ViewId):
        self._client = client
        self._view_id = view_id

    def __call__(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> PowerInverterReactivePowerTotalQuery:
        """Query timeseries `power_inverter.reactive_power_total`

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of power inverters to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query object that can be used to retrieve datapoins for the power_inverter.reactive_power_total timeseries
            selected in this method.

        Examples:

            Retrieve all data for 5 power_inverter.reactive_power_total timeseries:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> power_inverters = client.power_inverter.reactive_power_total(limit=5).retrieve()

        """
        filter_ = _create_power_inverter_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )

        return PowerInverterReactivePowerTotalQuery(
            client=self._client,
            view_id=self._view_id,
            timeseries_limit=limit,
            filter=filter_,
        )

    def list(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> TimeSeriesList:
        """List timeseries `power_inverter.reactive_power_total`

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of power inverters to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            List of Timeseries power_inverter.reactive_power_total.

        Examples:

            List power_inverter.reactive_power_total and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> power_inverters = client.power_inverter.reactive_power_total.list(limit=5)

        """
        filter_ = _create_power_inverter_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )
        external_ids = _retrieve_timeseries_external_ids_with_extra_reactive_power_total(
            self._client, self._view_id, filter_, limit
        )
        if external_ids:
            return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
        else:
            return TimeSeriesList([])

__call__(external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Query timeseries power_inverter.reactive_power_total

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of power inverters to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
PowerInverterReactivePowerTotalQuery

A query object that can be used to retrieve datapoins for the power_inverter.reactive_power_total timeseries

PowerInverterReactivePowerTotalQuery

selected in this method.

Examples:

Retrieve all data for 5 power_inverter.reactive_power_total timeseries:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> power_inverters = client.power_inverter.reactive_power_total(limit=5).retrieve()
Source code in examples/windmill/_api/power_inverter_reactive_power_total.py
def __call__(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> PowerInverterReactivePowerTotalQuery:
    """Query timeseries `power_inverter.reactive_power_total`

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of power inverters to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query object that can be used to retrieve datapoins for the power_inverter.reactive_power_total timeseries
        selected in this method.

    Examples:

        Retrieve all data for 5 power_inverter.reactive_power_total timeseries:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> power_inverters = client.power_inverter.reactive_power_total(limit=5).retrieve()

    """
    filter_ = _create_power_inverter_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )

    return PowerInverterReactivePowerTotalQuery(
        client=self._client,
        view_id=self._view_id,
        timeseries_limit=limit,
        filter=filter_,
    )

list(external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

List timeseries power_inverter.reactive_power_total

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of power inverters to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
TimeSeriesList

List of Timeseries power_inverter.reactive_power_total.

Examples:

List power_inverter.reactive_power_total and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> power_inverters = client.power_inverter.reactive_power_total.list(limit=5)
Source code in examples/windmill/_api/power_inverter_reactive_power_total.py
def list(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> TimeSeriesList:
    """List timeseries `power_inverter.reactive_power_total`

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of power inverters to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        List of Timeseries power_inverter.reactive_power_total.

    Examples:

        List power_inverter.reactive_power_total and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> power_inverters = client.power_inverter.reactive_power_total.list(limit=5)

    """
    filter_ = _create_power_inverter_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )
    external_ids = _retrieve_timeseries_external_ids_with_extra_reactive_power_total(
        self._client, self._view_id, filter_, limit
    )
    if external_ids:
        return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
    else:
        return TimeSeriesList([])

RotorAPI

Bases: NodeAPI[Rotor, RotorWrite, RotorList, RotorWriteList]

Source code in examples/windmill/_api/rotor.py
class RotorAPI(NodeAPI[Rotor, RotorWrite, RotorList, RotorWriteList]):
    _view_id = dm.ViewId("power-models", "Rotor", "1")
    _properties_by_field = _ROTOR_PROPERTIES_BY_FIELD
    _class_type = Rotor
    _class_list = RotorList
    _class_write_list = RotorWriteList

    def __init__(self, client: CogniteClient):
        super().__init__(client=client)

        self.rotor_speed_controller = RotorRotorSpeedControllerAPI(client, self._view_id)
        self.rpm_low_speed_shaft = RotorRpmLowSpeedShaftAPI(client, self._view_id)

    def __call__(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_QUERY_LIMIT,
        filter: dm.Filter | None = None,
    ) -> RotorQueryAPI[RotorList]:
        """Query starting at rotors.

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of rotors to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query API for rotors.

        """
        has_data = dm.filters.HasData(views=[self._view_id])
        filter_ = _create_rotor_filter(
            self._view_id,
            external_id_prefix,
            space,
            (filter and dm.filters.And(filter, has_data)) or has_data,
        )
        builder = QueryBuilder(RotorList)
        return RotorQueryAPI(self._client, builder, filter_, limit)

    def apply(
        self,
        rotor: RotorWrite | Sequence[RotorWrite],
        replace: bool = False,
        write_none: bool = False,
    ) -> ResourcesWriteResult:
        """Add or update (upsert) rotors.

        Args:
            rotor: Rotor or sequence of rotors to upsert.
            replace (bool): How do we behave when a property value exists? Do we replace all matching and existing values with the supplied values (true)?
                Or should we merge in new values for properties together with the existing values (false)? Note: This setting applies for all nodes or edges specified in the ingestion call.
            write_none (bool): This method, will by default, skip properties that are set to None. However, if you want to set properties to None,
                you can set this parameter to True. Note this only applies to properties that are nullable.
        Returns:
            Created instance(s), i.e., nodes, edges, and time series.

        Examples:

            Create a new rotor:

                >>> from windmill import WindmillClient
                >>> from windmill.data_classes import RotorWrite
                >>> client = WindmillClient()
                >>> rotor = RotorWrite(external_id="my_rotor", ...)
                >>> result = client.rotor.apply(rotor)

        """
        warnings.warn(
            "The .apply method is deprecated and will be removed in v1.0. "
            "Please use the .upsert method on the client instead. This means instead of "
            "`my_client.rotor.apply(my_items)` please use `my_client.upsert(my_items)`."
            "The motivation is that all apply methods are the same, and having one apply method per API "
            " class encourages users to create items in small batches, which is inefficient."
            "In addition, .upsert method is more descriptive of what the method does.",
            UserWarning,
            stacklevel=2,
        )
        return self._apply(rotor, replace, write_none)

    def delete(
        self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
    ) -> dm.InstancesDeleteResult:
        """Delete one or more rotor.

        Args:
            external_id: External id of the rotor to delete.
            space: The space where all the rotor are located.

        Returns:
            The instance(s), i.e., nodes and edges which has been deleted. Empty list if nothing was deleted.

        Examples:

            Delete rotor by id:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> client.rotor.delete("my_rotor")
        """
        warnings.warn(
            "The .delete method is deprecated and will be removed in v1.0. "
            "Please use the .delete method on the client instead. This means instead of "
            "`my_client.rotor.delete(my_ids)` please use `my_client.delete(my_ids)`."
            "The motivation is that all delete methods are the same, and having one delete method per API "
            " class encourages users to delete items in small batches, which is inefficient.",
            UserWarning,
            stacklevel=2,
        )
        return self._delete(external_id, space)

    @overload
    def retrieve(self, external_id: str, space: str = DEFAULT_INSTANCE_SPACE) -> Rotor | None: ...

    @overload
    def retrieve(self, external_id: SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE) -> RotorList: ...

    def retrieve(
        self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
    ) -> Rotor | RotorList | None:
        """Retrieve one or more rotors by id(s).

        Args:
            external_id: External id or list of external ids of the rotors.
            space: The space where all the rotors are located.

        Returns:
            The requested rotors.

        Examples:

            Retrieve rotor by id:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> rotor = client.rotor.retrieve("my_rotor")

        """
        return self._retrieve(external_id, space)

    def search(
        self,
        query: str,
        properties: RotorTextFields | SequenceNotStr[RotorTextFields] | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
        sort_by: RotorFields | SequenceNotStr[RotorFields] | None = None,
        direction: Literal["ascending", "descending"] = "ascending",
        sort: InstanceSort | list[InstanceSort] | None = None,
    ) -> RotorList:
        """Search rotors

        Args:
            query: The search query,
            properties: The property to search, if nothing is passed all text fields will be searched.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of rotors to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
            sort_by: The property to sort by.
            direction: The direction to sort by, either 'ascending' or 'descending'.
            sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
                This will override the sort_by and direction. This allowos you to sort by multiple fields and
                specify the direction for each field as well as how to handle null values.

        Returns:
            Search results rotors matching the query.

        Examples:

           Search for 'my_rotor' in all text properties:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> rotors = client.rotor.search('my_rotor')

        """
        filter_ = _create_rotor_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )
        return self._search(
            query=query,
            properties=properties,
            filter_=filter_,
            limit=limit,
            sort_by=sort_by,  # type: ignore[arg-type]
            direction=direction,
            sort=sort,
        )

    @overload
    def aggregate(
        self,
        aggregate: Aggregations | dm.aggregations.MetricAggregation,
        group_by: None = None,
        property: RotorFields | SequenceNotStr[RotorFields] | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> dm.aggregations.AggregatedNumberedValue: ...

    @overload
    def aggregate(
        self,
        aggregate: SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation],
        group_by: None = None,
        property: RotorFields | SequenceNotStr[RotorFields] | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> list[dm.aggregations.AggregatedNumberedValue]: ...

    @overload
    def aggregate(
        self,
        aggregate: (
            Aggregations
            | dm.aggregations.MetricAggregation
            | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation]
        ),
        group_by: RotorFields | SequenceNotStr[RotorFields],
        property: RotorFields | SequenceNotStr[RotorFields] | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> InstanceAggregationResultList: ...

    def aggregate(
        self,
        aggregate: (
            Aggregations
            | dm.aggregations.MetricAggregation
            | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation]
        ),
        group_by: RotorFields | SequenceNotStr[RotorFields] | None = None,
        property: RotorFields | SequenceNotStr[RotorFields] | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> (
        dm.aggregations.AggregatedNumberedValue
        | list[dm.aggregations.AggregatedNumberedValue]
        | InstanceAggregationResultList
    ):
        """Aggregate data across rotors

        Args:
            aggregate: The aggregation to perform.
            group_by: The property to group by when doing the aggregation.
            property: The property to perform aggregation on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of rotors to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            Aggregation results.

        Examples:

            Count rotors in space `my_space`:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> result = client.rotor.aggregate("count", space="my_space")

        """

        filter_ = _create_rotor_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )
        return self._aggregate(
            aggregate=aggregate,
            group_by=group_by,  # type: ignore[arg-type]
            properties=property,  # type: ignore[arg-type]
            query=None,
            search_properties=None,
            limit=limit,
            filter=filter_,
        )

    def histogram(
        self,
        property: RotorFields,
        interval: float,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> dm.aggregations.HistogramValue:
        """Produces histograms for rotors

        Args:
            property: The property to use as the value in the histogram.
            interval: The interval to use for the histogram bins.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of rotors to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            Bucketed histogram results.

        """
        filter_ = _create_rotor_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )
        return self._histogram(
            property,
            interval,
            None,
            None,
            limit,
            filter_,
        )

    def query(self) -> RotorQuery:
        """Start a query for rotors."""
        warnings.warn("The .query is in alpha and is subject to breaking changes without notice.")
        return RotorQuery(self._client)

    def list(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
        sort_by: RotorFields | Sequence[RotorFields] | None = None,
        direction: Literal["ascending", "descending"] = "ascending",
        sort: InstanceSort | list[InstanceSort] | None = None,
    ) -> RotorList:
        """List/filter rotors

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of rotors to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
            sort_by: The property to sort by.
            direction: The direction to sort by, either 'ascending' or 'descending'.
            sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
                This will override the sort_by and direction. This allowos you to sort by multiple fields and
                specify the direction for each field as well as how to handle null values.

        Returns:
            List of requested rotors

        Examples:

            List rotors and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> rotors = client.rotor.list(limit=5)

        """
        filter_ = _create_rotor_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )

        return self._list(
            limit=limit,
            filter=filter_,
            sort_by=sort_by,  # type: ignore[arg-type]
            direction=direction,
            sort=sort,
        )

__call__(external_id_prefix=None, space=None, limit=DEFAULT_QUERY_LIMIT, filter=None)

Query starting at rotors.

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of rotors to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_QUERY_LIMIT
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
RotorQueryAPI[RotorList]

A query API for rotors.

Source code in examples/windmill/_api/rotor.py
def __call__(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_QUERY_LIMIT,
    filter: dm.Filter | None = None,
) -> RotorQueryAPI[RotorList]:
    """Query starting at rotors.

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of rotors to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query API for rotors.

    """
    has_data = dm.filters.HasData(views=[self._view_id])
    filter_ = _create_rotor_filter(
        self._view_id,
        external_id_prefix,
        space,
        (filter and dm.filters.And(filter, has_data)) or has_data,
    )
    builder = QueryBuilder(RotorList)
    return RotorQueryAPI(self._client, builder, filter_, limit)

aggregate(aggregate, group_by=None, property=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

aggregate(aggregate: Aggregations | dm.aggregations.MetricAggregation, group_by: None = None, property: RotorFields | SequenceNotStr[RotorFields] | None = None, external_id_prefix: str | None = None, space: str | list[str] | None = None, limit: int = DEFAULT_LIMIT_READ, filter: dm.Filter | None = None) -> dm.aggregations.AggregatedNumberedValue
aggregate(aggregate: SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation], group_by: None = None, property: RotorFields | SequenceNotStr[RotorFields] | None = None, external_id_prefix: str | None = None, space: str | list[str] | None = None, limit: int = DEFAULT_LIMIT_READ, filter: dm.Filter | None = None) -> list[dm.aggregations.AggregatedNumberedValue]
aggregate(aggregate: Aggregations | dm.aggregations.MetricAggregation | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation], group_by: RotorFields | SequenceNotStr[RotorFields], property: RotorFields | SequenceNotStr[RotorFields] | None = None, external_id_prefix: str | None = None, space: str | list[str] | None = None, limit: int = DEFAULT_LIMIT_READ, filter: dm.Filter | None = None) -> InstanceAggregationResultList

Aggregate data across rotors

Parameters:

Name Type Description Default
aggregate Aggregations | MetricAggregation | SequenceNotStr[Aggregations | MetricAggregation]

The aggregation to perform.

required
group_by RotorFields | SequenceNotStr[RotorFields] | None

The property to group by when doing the aggregation.

None
property RotorFields | SequenceNotStr[RotorFields] | None

The property to perform aggregation on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of rotors to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
AggregatedNumberedValue | list[AggregatedNumberedValue] | InstanceAggregationResultList

Aggregation results.

Examples:

Count rotors in space `my_space`:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> result = client.rotor.aggregate("count", space="my_space")
Source code in examples/windmill/_api/rotor.py
def aggregate(
    self,
    aggregate: (
        Aggregations
        | dm.aggregations.MetricAggregation
        | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation]
    ),
    group_by: RotorFields | SequenceNotStr[RotorFields] | None = None,
    property: RotorFields | SequenceNotStr[RotorFields] | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> (
    dm.aggregations.AggregatedNumberedValue
    | list[dm.aggregations.AggregatedNumberedValue]
    | InstanceAggregationResultList
):
    """Aggregate data across rotors

    Args:
        aggregate: The aggregation to perform.
        group_by: The property to group by when doing the aggregation.
        property: The property to perform aggregation on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of rotors to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        Aggregation results.

    Examples:

        Count rotors in space `my_space`:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> result = client.rotor.aggregate("count", space="my_space")

    """

    filter_ = _create_rotor_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )
    return self._aggregate(
        aggregate=aggregate,
        group_by=group_by,  # type: ignore[arg-type]
        properties=property,  # type: ignore[arg-type]
        query=None,
        search_properties=None,
        limit=limit,
        filter=filter_,
    )

apply(rotor, replace=False, write_none=False)

Add or update (upsert) rotors.

Parameters:

Name Type Description Default
rotor RotorWrite | Sequence[RotorWrite]

Rotor or sequence of rotors to upsert.

required
replace bool

How do we behave when a property value exists? Do we replace all matching and existing values with the supplied values (true)? Or should we merge in new values for properties together with the existing values (false)? Note: This setting applies for all nodes or edges specified in the ingestion call.

False
write_none bool

This method, will by default, skip properties that are set to None. However, if you want to set properties to None, you can set this parameter to True. Note this only applies to properties that are nullable.

False

Returns: Created instance(s), i.e., nodes, edges, and time series.

Examples:

Create a new rotor:

    >>> from windmill import WindmillClient
    >>> from windmill.data_classes import RotorWrite
    >>> client = WindmillClient()
    >>> rotor = RotorWrite(external_id="my_rotor", ...)
    >>> result = client.rotor.apply(rotor)
Source code in examples/windmill/_api/rotor.py
def apply(
    self,
    rotor: RotorWrite | Sequence[RotorWrite],
    replace: bool = False,
    write_none: bool = False,
) -> ResourcesWriteResult:
    """Add or update (upsert) rotors.

    Args:
        rotor: Rotor or sequence of rotors to upsert.
        replace (bool): How do we behave when a property value exists? Do we replace all matching and existing values with the supplied values (true)?
            Or should we merge in new values for properties together with the existing values (false)? Note: This setting applies for all nodes or edges specified in the ingestion call.
        write_none (bool): This method, will by default, skip properties that are set to None. However, if you want to set properties to None,
            you can set this parameter to True. Note this only applies to properties that are nullable.
    Returns:
        Created instance(s), i.e., nodes, edges, and time series.

    Examples:

        Create a new rotor:

            >>> from windmill import WindmillClient
            >>> from windmill.data_classes import RotorWrite
            >>> client = WindmillClient()
            >>> rotor = RotorWrite(external_id="my_rotor", ...)
            >>> result = client.rotor.apply(rotor)

    """
    warnings.warn(
        "The .apply method is deprecated and will be removed in v1.0. "
        "Please use the .upsert method on the client instead. This means instead of "
        "`my_client.rotor.apply(my_items)` please use `my_client.upsert(my_items)`."
        "The motivation is that all apply methods are the same, and having one apply method per API "
        " class encourages users to create items in small batches, which is inefficient."
        "In addition, .upsert method is more descriptive of what the method does.",
        UserWarning,
        stacklevel=2,
    )
    return self._apply(rotor, replace, write_none)

delete(external_id, space=DEFAULT_INSTANCE_SPACE)

Delete one or more rotor.

Parameters:

Name Type Description Default
external_id str | SequenceNotStr[str]

External id of the rotor to delete.

required
space str

The space where all the rotor are located.

DEFAULT_INSTANCE_SPACE

Returns:

Type Description
InstancesDeleteResult

The instance(s), i.e., nodes and edges which has been deleted. Empty list if nothing was deleted.

Examples:

Delete rotor by id:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> client.rotor.delete("my_rotor")
Source code in examples/windmill/_api/rotor.py
def delete(
    self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
) -> dm.InstancesDeleteResult:
    """Delete one or more rotor.

    Args:
        external_id: External id of the rotor to delete.
        space: The space where all the rotor are located.

    Returns:
        The instance(s), i.e., nodes and edges which has been deleted. Empty list if nothing was deleted.

    Examples:

        Delete rotor by id:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> client.rotor.delete("my_rotor")
    """
    warnings.warn(
        "The .delete method is deprecated and will be removed in v1.0. "
        "Please use the .delete method on the client instead. This means instead of "
        "`my_client.rotor.delete(my_ids)` please use `my_client.delete(my_ids)`."
        "The motivation is that all delete methods are the same, and having one delete method per API "
        " class encourages users to delete items in small batches, which is inefficient.",
        UserWarning,
        stacklevel=2,
    )
    return self._delete(external_id, space)

histogram(property, interval, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Produces histograms for rotors

Parameters:

Name Type Description Default
property RotorFields

The property to use as the value in the histogram.

required
interval float

The interval to use for the histogram bins.

required
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of rotors to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
HistogramValue

Bucketed histogram results.

Source code in examples/windmill/_api/rotor.py
def histogram(
    self,
    property: RotorFields,
    interval: float,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> dm.aggregations.HistogramValue:
    """Produces histograms for rotors

    Args:
        property: The property to use as the value in the histogram.
        interval: The interval to use for the histogram bins.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of rotors to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        Bucketed histogram results.

    """
    filter_ = _create_rotor_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )
    return self._histogram(
        property,
        interval,
        None,
        None,
        limit,
        filter_,
    )

list(external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None, sort_by=None, direction='ascending', sort=None)

List/filter rotors

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of rotors to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None
sort_by RotorFields | Sequence[RotorFields] | None

The property to sort by.

None
direction Literal['ascending', 'descending']

The direction to sort by, either 'ascending' or 'descending'.

'ascending'
sort InstanceSort | list[InstanceSort] | None

(Advanced) If sort_by and direction are not sufficient, you can write your own sorting. This will override the sort_by and direction. This allowos you to sort by multiple fields and specify the direction for each field as well as how to handle null values.

None

Returns:

Type Description
RotorList

List of requested rotors

Examples:

List rotors and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> rotors = client.rotor.list(limit=5)
Source code in examples/windmill/_api/rotor.py
def list(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
    sort_by: RotorFields | Sequence[RotorFields] | None = None,
    direction: Literal["ascending", "descending"] = "ascending",
    sort: InstanceSort | list[InstanceSort] | None = None,
) -> RotorList:
    """List/filter rotors

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of rotors to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
        sort_by: The property to sort by.
        direction: The direction to sort by, either 'ascending' or 'descending'.
        sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
            This will override the sort_by and direction. This allowos you to sort by multiple fields and
            specify the direction for each field as well as how to handle null values.

    Returns:
        List of requested rotors

    Examples:

        List rotors and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> rotors = client.rotor.list(limit=5)

    """
    filter_ = _create_rotor_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )

    return self._list(
        limit=limit,
        filter=filter_,
        sort_by=sort_by,  # type: ignore[arg-type]
        direction=direction,
        sort=sort,
    )

query()

Start a query for rotors.

Source code in examples/windmill/_api/rotor.py
def query(self) -> RotorQuery:
    """Start a query for rotors."""
    warnings.warn("The .query is in alpha and is subject to breaking changes without notice.")
    return RotorQuery(self._client)

retrieve(external_id, space=DEFAULT_INSTANCE_SPACE)

retrieve(external_id: str, space: str = DEFAULT_INSTANCE_SPACE) -> Rotor | None
retrieve(external_id: SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE) -> RotorList

Retrieve one or more rotors by id(s).

Parameters:

Name Type Description Default
external_id str | SequenceNotStr[str]

External id or list of external ids of the rotors.

required
space str

The space where all the rotors are located.

DEFAULT_INSTANCE_SPACE

Returns:

Type Description
Rotor | RotorList | None

The requested rotors.

Examples:

Retrieve rotor by id:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> rotor = client.rotor.retrieve("my_rotor")
Source code in examples/windmill/_api/rotor.py
def retrieve(
    self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
) -> Rotor | RotorList | None:
    """Retrieve one or more rotors by id(s).

    Args:
        external_id: External id or list of external ids of the rotors.
        space: The space where all the rotors are located.

    Returns:
        The requested rotors.

    Examples:

        Retrieve rotor by id:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> rotor = client.rotor.retrieve("my_rotor")

    """
    return self._retrieve(external_id, space)

search(query, properties=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None, sort_by=None, direction='ascending', sort=None)

Search rotors

Parameters:

Name Type Description Default
query str

The search query,

required
properties RotorTextFields | SequenceNotStr[RotorTextFields] | None

The property to search, if nothing is passed all text fields will be searched.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of rotors to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None
sort_by RotorFields | SequenceNotStr[RotorFields] | None

The property to sort by.

None
direction Literal['ascending', 'descending']

The direction to sort by, either 'ascending' or 'descending'.

'ascending'
sort InstanceSort | list[InstanceSort] | None

(Advanced) If sort_by and direction are not sufficient, you can write your own sorting. This will override the sort_by and direction. This allowos you to sort by multiple fields and specify the direction for each field as well as how to handle null values.

None

Returns:

Type Description
RotorList

Search results rotors matching the query.

Examples:

Search for 'my_rotor' in all text properties:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> rotors = client.rotor.search('my_rotor')
Source code in examples/windmill/_api/rotor.py
def search(
    self,
    query: str,
    properties: RotorTextFields | SequenceNotStr[RotorTextFields] | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
    sort_by: RotorFields | SequenceNotStr[RotorFields] | None = None,
    direction: Literal["ascending", "descending"] = "ascending",
    sort: InstanceSort | list[InstanceSort] | None = None,
) -> RotorList:
    """Search rotors

    Args:
        query: The search query,
        properties: The property to search, if nothing is passed all text fields will be searched.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of rotors to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
        sort_by: The property to sort by.
        direction: The direction to sort by, either 'ascending' or 'descending'.
        sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
            This will override the sort_by and direction. This allowos you to sort by multiple fields and
            specify the direction for each field as well as how to handle null values.

    Returns:
        Search results rotors matching the query.

    Examples:

       Search for 'my_rotor' in all text properties:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> rotors = client.rotor.search('my_rotor')

    """
    filter_ = _create_rotor_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )
    return self._search(
        query=query,
        properties=properties,
        filter_=filter_,
        limit=limit,
        sort_by=sort_by,  # type: ignore[arg-type]
        direction=direction,
        sort=sort,
    )

RotorQueryAPI

Bases: QueryAPI[T_DomainModelList]

Source code in examples/windmill/_api/rotor_query.py
class RotorQueryAPI(QueryAPI[T_DomainModelList]):
    _view_id = dm.ViewId("power-models", "Rotor", "1")

    def __init__(
        self,
        client: CogniteClient,
        builder: QueryBuilder[T_DomainModelList],
        filter_: dm.filters.Filter | None = None,
        limit: int = DEFAULT_QUERY_LIMIT,
    ):
        super().__init__(client, builder)
        from_ = self._builder.get_from()
        self._builder.append(
            NodeQueryStep(
                name=self._builder.create_name(from_),
                expression=dm.query.NodeResultSetExpression(
                    from_=from_,
                    filter=filter_,
                ),
                result_cls=Rotor,
                max_retrieve_limit=limit,
            )
        )

    def query(
        self,
    ) -> T_DomainModelList:
        """Execute query and return the result.

        Returns:
            The list of the source nodes of the query.

        """
        return self._query()

query()

Execute query and return the result.

Returns:

Type Description
T_DomainModelList

The list of the source nodes of the query.

Source code in examples/windmill/_api/rotor_query.py
def query(
    self,
) -> T_DomainModelList:
    """Execute query and return the result.

    Returns:
        The list of the source nodes of the query.

    """
    return self._query()

RotorRotorSpeedControllerAPI

Source code in examples/windmill/_api/rotor_rotor_speed_controller.py
class RotorRotorSpeedControllerAPI:
    def __init__(self, client: CogniteClient, view_id: dm.ViewId):
        self._client = client
        self._view_id = view_id

    def __call__(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> RotorRotorSpeedControllerQuery:
        """Query timeseries `rotor.rotor_speed_controller`

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of rotors to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query object that can be used to retrieve datapoins for the rotor.rotor_speed_controller timeseries
            selected in this method.

        Examples:

            Retrieve all data for 5 rotor.rotor_speed_controller timeseries:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> rotors = client.rotor.rotor_speed_controller(limit=5).retrieve()

        """
        filter_ = _create_rotor_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )

        return RotorRotorSpeedControllerQuery(
            client=self._client,
            view_id=self._view_id,
            timeseries_limit=limit,
            filter=filter_,
        )

    def list(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> TimeSeriesList:
        """List timeseries `rotor.rotor_speed_controller`

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of rotors to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            List of Timeseries rotor.rotor_speed_controller.

        Examples:

            List rotor.rotor_speed_controller and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> rotors = client.rotor.rotor_speed_controller.list(limit=5)

        """
        filter_ = _create_rotor_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )
        external_ids = _retrieve_timeseries_external_ids_with_extra_rotor_speed_controller(
            self._client, self._view_id, filter_, limit
        )
        if external_ids:
            return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
        else:
            return TimeSeriesList([])

__call__(external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Query timeseries rotor.rotor_speed_controller

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of rotors to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
RotorRotorSpeedControllerQuery

A query object that can be used to retrieve datapoins for the rotor.rotor_speed_controller timeseries

RotorRotorSpeedControllerQuery

selected in this method.

Examples:

Retrieve all data for 5 rotor.rotor_speed_controller timeseries:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> rotors = client.rotor.rotor_speed_controller(limit=5).retrieve()
Source code in examples/windmill/_api/rotor_rotor_speed_controller.py
def __call__(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> RotorRotorSpeedControllerQuery:
    """Query timeseries `rotor.rotor_speed_controller`

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of rotors to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query object that can be used to retrieve datapoins for the rotor.rotor_speed_controller timeseries
        selected in this method.

    Examples:

        Retrieve all data for 5 rotor.rotor_speed_controller timeseries:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> rotors = client.rotor.rotor_speed_controller(limit=5).retrieve()

    """
    filter_ = _create_rotor_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )

    return RotorRotorSpeedControllerQuery(
        client=self._client,
        view_id=self._view_id,
        timeseries_limit=limit,
        filter=filter_,
    )

list(external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

List timeseries rotor.rotor_speed_controller

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of rotors to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
TimeSeriesList

List of Timeseries rotor.rotor_speed_controller.

Examples:

List rotor.rotor_speed_controller and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> rotors = client.rotor.rotor_speed_controller.list(limit=5)
Source code in examples/windmill/_api/rotor_rotor_speed_controller.py
def list(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> TimeSeriesList:
    """List timeseries `rotor.rotor_speed_controller`

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of rotors to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        List of Timeseries rotor.rotor_speed_controller.

    Examples:

        List rotor.rotor_speed_controller and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> rotors = client.rotor.rotor_speed_controller.list(limit=5)

    """
    filter_ = _create_rotor_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )
    external_ids = _retrieve_timeseries_external_ids_with_extra_rotor_speed_controller(
        self._client, self._view_id, filter_, limit
    )
    if external_ids:
        return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
    else:
        return TimeSeriesList([])

RotorRpmLowSpeedShaftAPI

Source code in examples/windmill/_api/rotor_rpm_low_speed_shaft.py
class RotorRpmLowSpeedShaftAPI:
    def __init__(self, client: CogniteClient, view_id: dm.ViewId):
        self._client = client
        self._view_id = view_id

    def __call__(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> RotorRpmLowSpeedShaftQuery:
        """Query timeseries `rotor.rpm_low_speed_shaft`

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of rotors to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query object that can be used to retrieve datapoins for the rotor.rpm_low_speed_shaft timeseries
            selected in this method.

        Examples:

            Retrieve all data for 5 rotor.rpm_low_speed_shaft timeseries:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> rotors = client.rotor.rpm_low_speed_shaft(limit=5).retrieve()

        """
        filter_ = _create_rotor_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )

        return RotorRpmLowSpeedShaftQuery(
            client=self._client,
            view_id=self._view_id,
            timeseries_limit=limit,
            filter=filter_,
        )

    def list(
        self,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> TimeSeriesList:
        """List timeseries `rotor.rpm_low_speed_shaft`

        Args:
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of rotors to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            List of Timeseries rotor.rpm_low_speed_shaft.

        Examples:

            List rotor.rpm_low_speed_shaft and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> rotors = client.rotor.rpm_low_speed_shaft.list(limit=5)

        """
        filter_ = _create_rotor_filter(
            self._view_id,
            external_id_prefix,
            space,
            filter,
        )
        external_ids = _retrieve_timeseries_external_ids_with_extra_rpm_low_speed_shaft(
            self._client, self._view_id, filter_, limit
        )
        if external_ids:
            return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
        else:
            return TimeSeriesList([])

__call__(external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Query timeseries rotor.rpm_low_speed_shaft

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of rotors to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
RotorRpmLowSpeedShaftQuery

A query object that can be used to retrieve datapoins for the rotor.rpm_low_speed_shaft timeseries

RotorRpmLowSpeedShaftQuery

selected in this method.

Examples:

Retrieve all data for 5 rotor.rpm_low_speed_shaft timeseries:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> rotors = client.rotor.rpm_low_speed_shaft(limit=5).retrieve()
Source code in examples/windmill/_api/rotor_rpm_low_speed_shaft.py
def __call__(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> RotorRpmLowSpeedShaftQuery:
    """Query timeseries `rotor.rpm_low_speed_shaft`

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of rotors to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query object that can be used to retrieve datapoins for the rotor.rpm_low_speed_shaft timeseries
        selected in this method.

    Examples:

        Retrieve all data for 5 rotor.rpm_low_speed_shaft timeseries:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> rotors = client.rotor.rpm_low_speed_shaft(limit=5).retrieve()

    """
    filter_ = _create_rotor_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )

    return RotorRpmLowSpeedShaftQuery(
        client=self._client,
        view_id=self._view_id,
        timeseries_limit=limit,
        filter=filter_,
    )

list(external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

List timeseries rotor.rpm_low_speed_shaft

Parameters:

Name Type Description Default
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of rotors to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
TimeSeriesList

List of Timeseries rotor.rpm_low_speed_shaft.

Examples:

List rotor.rpm_low_speed_shaft and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> rotors = client.rotor.rpm_low_speed_shaft.list(limit=5)
Source code in examples/windmill/_api/rotor_rpm_low_speed_shaft.py
def list(
    self,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> TimeSeriesList:
    """List timeseries `rotor.rpm_low_speed_shaft`

    Args:
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of rotors to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        List of Timeseries rotor.rpm_low_speed_shaft.

    Examples:

        List rotor.rpm_low_speed_shaft and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> rotors = client.rotor.rpm_low_speed_shaft.list(limit=5)

    """
    filter_ = _create_rotor_filter(
        self._view_id,
        external_id_prefix,
        space,
        filter,
    )
    external_ids = _retrieve_timeseries_external_ids_with_extra_rpm_low_speed_shaft(
        self._client, self._view_id, filter_, limit
    )
    if external_ids:
        return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
    else:
        return TimeSeriesList([])

SensorPositionAPI

Bases: NodeAPI[SensorPosition, SensorPositionWrite, SensorPositionList, SensorPositionWriteList]

Source code in examples/windmill/_api/sensor_position.py
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
class SensorPositionAPI(NodeAPI[SensorPosition, SensorPositionWrite, SensorPositionList, SensorPositionWriteList]):
    _view_id = dm.ViewId("power-models", "SensorPosition", "1")
    _properties_by_field = _SENSORPOSITION_PROPERTIES_BY_FIELD
    _class_type = SensorPosition
    _class_list = SensorPositionList
    _class_write_list = SensorPositionWriteList

    def __init__(self, client: CogniteClient):
        super().__init__(client=client)

        self.edgewise_bend_mom_crosstalk_corrected = SensorPositionEdgewiseBendMomCrosstalkCorrectedAPI(
            client, self._view_id
        )
        self.edgewise_bend_mom_offset = SensorPositionEdgewiseBendMomOffsetAPI(client, self._view_id)
        self.edgewise_bend_mom_offset_crosstalk_corrected = SensorPositionEdgewiseBendMomOffsetCrosstalkCorrectedAPI(
            client, self._view_id
        )
        self.edgewisewise_bend_mom = SensorPositionEdgewisewiseBendMomAPI(client, self._view_id)
        self.flapwise_bend_mom = SensorPositionFlapwiseBendMomAPI(client, self._view_id)
        self.flapwise_bend_mom_crosstalk_corrected = SensorPositionFlapwiseBendMomCrosstalkCorrectedAPI(
            client, self._view_id
        )
        self.flapwise_bend_mom_offset = SensorPositionFlapwiseBendMomOffsetAPI(client, self._view_id)
        self.flapwise_bend_mom_offset_crosstalk_corrected = SensorPositionFlapwiseBendMomOffsetCrosstalkCorrectedAPI(
            client, self._view_id
        )

    def __call__(
        self,
        min_position: float | None = None,
        max_position: float | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_QUERY_LIMIT,
        filter: dm.Filter | None = None,
    ) -> SensorPositionQueryAPI[SensorPositionList]:
        """Query starting at sensor positions.

        Args:
            min_position: The minimum value of the position to filter on.
            max_position: The maximum value of the position to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query API for sensor positions.

        """
        has_data = dm.filters.HasData(views=[self._view_id])
        filter_ = _create_sensor_position_filter(
            self._view_id,
            min_position,
            max_position,
            external_id_prefix,
            space,
            (filter and dm.filters.And(filter, has_data)) or has_data,
        )
        builder = QueryBuilder(SensorPositionList)
        return SensorPositionQueryAPI(self._client, builder, filter_, limit)

    def apply(
        self,
        sensor_position: SensorPositionWrite | Sequence[SensorPositionWrite],
        replace: bool = False,
        write_none: bool = False,
    ) -> ResourcesWriteResult:
        """Add or update (upsert) sensor positions.

        Args:
            sensor_position: Sensor position or sequence of sensor positions to upsert.
            replace (bool): How do we behave when a property value exists? Do we replace all matching and existing values with the supplied values (true)?
                Or should we merge in new values for properties together with the existing values (false)? Note: This setting applies for all nodes or edges specified in the ingestion call.
            write_none (bool): This method, will by default, skip properties that are set to None. However, if you want to set properties to None,
                you can set this parameter to True. Note this only applies to properties that are nullable.
        Returns:
            Created instance(s), i.e., nodes, edges, and time series.

        Examples:

            Create a new sensor_position:

                >>> from windmill import WindmillClient
                >>> from windmill.data_classes import SensorPositionWrite
                >>> client = WindmillClient()
                >>> sensor_position = SensorPositionWrite(external_id="my_sensor_position", ...)
                >>> result = client.sensor_position.apply(sensor_position)

        """
        warnings.warn(
            "The .apply method is deprecated and will be removed in v1.0. "
            "Please use the .upsert method on the client instead. This means instead of "
            "`my_client.sensor_position.apply(my_items)` please use `my_client.upsert(my_items)`."
            "The motivation is that all apply methods are the same, and having one apply method per API "
            " class encourages users to create items in small batches, which is inefficient."
            "In addition, .upsert method is more descriptive of what the method does.",
            UserWarning,
            stacklevel=2,
        )
        return self._apply(sensor_position, replace, write_none)

    def delete(
        self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
    ) -> dm.InstancesDeleteResult:
        """Delete one or more sensor position.

        Args:
            external_id: External id of the sensor position to delete.
            space: The space where all the sensor position are located.

        Returns:
            The instance(s), i.e., nodes and edges which has been deleted. Empty list if nothing was deleted.

        Examples:

            Delete sensor_position by id:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> client.sensor_position.delete("my_sensor_position")
        """
        warnings.warn(
            "The .delete method is deprecated and will be removed in v1.0. "
            "Please use the .delete method on the client instead. This means instead of "
            "`my_client.sensor_position.delete(my_ids)` please use `my_client.delete(my_ids)`."
            "The motivation is that all delete methods are the same, and having one delete method per API "
            " class encourages users to delete items in small batches, which is inefficient.",
            UserWarning,
            stacklevel=2,
        )
        return self._delete(external_id, space)

    @overload
    def retrieve(self, external_id: str, space: str = DEFAULT_INSTANCE_SPACE) -> SensorPosition | None: ...

    @overload
    def retrieve(self, external_id: SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE) -> SensorPositionList: ...

    def retrieve(
        self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
    ) -> SensorPosition | SensorPositionList | None:
        """Retrieve one or more sensor positions by id(s).

        Args:
            external_id: External id or list of external ids of the sensor positions.
            space: The space where all the sensor positions are located.

        Returns:
            The requested sensor positions.

        Examples:

            Retrieve sensor_position by id:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> sensor_position = client.sensor_position.retrieve("my_sensor_position")

        """
        return self._retrieve(external_id, space)

    def search(
        self,
        query: str,
        properties: SensorPositionTextFields | SequenceNotStr[SensorPositionTextFields] | None = None,
        min_position: float | None = None,
        max_position: float | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
        sort_by: SensorPositionFields | SequenceNotStr[SensorPositionFields] | None = None,
        direction: Literal["ascending", "descending"] = "ascending",
        sort: InstanceSort | list[InstanceSort] | None = None,
    ) -> SensorPositionList:
        """Search sensor positions

        Args:
            query: The search query,
            properties: The property to search, if nothing is passed all text fields will be searched.
            min_position: The minimum value of the position to filter on.
            max_position: The maximum value of the position to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
            sort_by: The property to sort by.
            direction: The direction to sort by, either 'ascending' or 'descending'.
            sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
                This will override the sort_by and direction. This allowos you to sort by multiple fields and
                specify the direction for each field as well as how to handle null values.

        Returns:
            Search results sensor positions matching the query.

        Examples:

           Search for 'my_sensor_position' in all text properties:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> sensor_positions = client.sensor_position.search('my_sensor_position')

        """
        filter_ = _create_sensor_position_filter(
            self._view_id,
            min_position,
            max_position,
            external_id_prefix,
            space,
            filter,
        )
        return self._search(
            query=query,
            properties=properties,
            filter_=filter_,
            limit=limit,
            sort_by=sort_by,  # type: ignore[arg-type]
            direction=direction,
            sort=sort,
        )

    @overload
    def aggregate(
        self,
        aggregate: Aggregations | dm.aggregations.MetricAggregation,
        group_by: None = None,
        property: SensorPositionFields | SequenceNotStr[SensorPositionFields] | None = None,
        min_position: float | None = None,
        max_position: float | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> dm.aggregations.AggregatedNumberedValue: ...

    @overload
    def aggregate(
        self,
        aggregate: SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation],
        group_by: None = None,
        property: SensorPositionFields | SequenceNotStr[SensorPositionFields] | None = None,
        min_position: float | None = None,
        max_position: float | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> list[dm.aggregations.AggregatedNumberedValue]: ...

    @overload
    def aggregate(
        self,
        aggregate: (
            Aggregations
            | dm.aggregations.MetricAggregation
            | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation]
        ),
        group_by: SensorPositionFields | SequenceNotStr[SensorPositionFields],
        property: SensorPositionFields | SequenceNotStr[SensorPositionFields] | None = None,
        min_position: float | None = None,
        max_position: float | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> InstanceAggregationResultList: ...

    def aggregate(
        self,
        aggregate: (
            Aggregations
            | dm.aggregations.MetricAggregation
            | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation]
        ),
        group_by: SensorPositionFields | SequenceNotStr[SensorPositionFields] | None = None,
        property: SensorPositionFields | SequenceNotStr[SensorPositionFields] | None = None,
        min_position: float | None = None,
        max_position: float | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> (
        dm.aggregations.AggregatedNumberedValue
        | list[dm.aggregations.AggregatedNumberedValue]
        | InstanceAggregationResultList
    ):
        """Aggregate data across sensor positions

        Args:
            aggregate: The aggregation to perform.
            group_by: The property to group by when doing the aggregation.
            property: The property to perform aggregation on.
            min_position: The minimum value of the position to filter on.
            max_position: The maximum value of the position to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            Aggregation results.

        Examples:

            Count sensor positions in space `my_space`:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> result = client.sensor_position.aggregate("count", space="my_space")

        """

        filter_ = _create_sensor_position_filter(
            self._view_id,
            min_position,
            max_position,
            external_id_prefix,
            space,
            filter,
        )
        return self._aggregate(
            aggregate=aggregate,
            group_by=group_by,  # type: ignore[arg-type]
            properties=property,  # type: ignore[arg-type]
            query=None,
            search_properties=None,
            limit=limit,
            filter=filter_,
        )

    def histogram(
        self,
        property: SensorPositionFields,
        interval: float,
        min_position: float | None = None,
        max_position: float | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> dm.aggregations.HistogramValue:
        """Produces histograms for sensor positions

        Args:
            property: The property to use as the value in the histogram.
            interval: The interval to use for the histogram bins.
            min_position: The minimum value of the position to filter on.
            max_position: The maximum value of the position to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            Bucketed histogram results.

        """
        filter_ = _create_sensor_position_filter(
            self._view_id,
            min_position,
            max_position,
            external_id_prefix,
            space,
            filter,
        )
        return self._histogram(
            property,
            interval,
            None,
            None,
            limit,
            filter_,
        )

    def query(self) -> SensorPositionQuery:
        """Start a query for sensor positions."""
        warnings.warn("The .query is in alpha and is subject to breaking changes without notice.")
        return SensorPositionQuery(self._client)

    def list(
        self,
        min_position: float | None = None,
        max_position: float | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
        sort_by: SensorPositionFields | Sequence[SensorPositionFields] | None = None,
        direction: Literal["ascending", "descending"] = "ascending",
        sort: InstanceSort | list[InstanceSort] | None = None,
    ) -> SensorPositionList:
        """List/filter sensor positions

        Args:
            min_position: The minimum value of the position to filter on.
            max_position: The maximum value of the position to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
            sort_by: The property to sort by.
            direction: The direction to sort by, either 'ascending' or 'descending'.
            sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
                This will override the sort_by and direction. This allowos you to sort by multiple fields and
                specify the direction for each field as well as how to handle null values.

        Returns:
            List of requested sensor positions

        Examples:

            List sensor positions and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> sensor_positions = client.sensor_position.list(limit=5)

        """
        filter_ = _create_sensor_position_filter(
            self._view_id,
            min_position,
            max_position,
            external_id_prefix,
            space,
            filter,
        )

        return self._list(
            limit=limit,
            filter=filter_,
            sort_by=sort_by,  # type: ignore[arg-type]
            direction=direction,
            sort=sort,
        )

__call__(min_position=None, max_position=None, external_id_prefix=None, space=None, limit=DEFAULT_QUERY_LIMIT, filter=None)

Query starting at sensor positions.

Parameters:

Name Type Description Default
min_position float | None

The minimum value of the position to filter on.

None
max_position float | None

The maximum value of the position to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_QUERY_LIMIT
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
SensorPositionQueryAPI[SensorPositionList]

A query API for sensor positions.

Source code in examples/windmill/_api/sensor_position.py
def __call__(
    self,
    min_position: float | None = None,
    max_position: float | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_QUERY_LIMIT,
    filter: dm.Filter | None = None,
) -> SensorPositionQueryAPI[SensorPositionList]:
    """Query starting at sensor positions.

    Args:
        min_position: The minimum value of the position to filter on.
        max_position: The maximum value of the position to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query API for sensor positions.

    """
    has_data = dm.filters.HasData(views=[self._view_id])
    filter_ = _create_sensor_position_filter(
        self._view_id,
        min_position,
        max_position,
        external_id_prefix,
        space,
        (filter and dm.filters.And(filter, has_data)) or has_data,
    )
    builder = QueryBuilder(SensorPositionList)
    return SensorPositionQueryAPI(self._client, builder, filter_, limit)

aggregate(aggregate, group_by=None, property=None, min_position=None, max_position=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

aggregate(aggregate: Aggregations | dm.aggregations.MetricAggregation, group_by: None = None, property: SensorPositionFields | SequenceNotStr[SensorPositionFields] | None = None, min_position: float | None = None, max_position: float | None = None, external_id_prefix: str | None = None, space: str | list[str] | None = None, limit: int = DEFAULT_LIMIT_READ, filter: dm.Filter | None = None) -> dm.aggregations.AggregatedNumberedValue
aggregate(aggregate: SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation], group_by: None = None, property: SensorPositionFields | SequenceNotStr[SensorPositionFields] | None = None, min_position: float | None = None, max_position: float | None = None, external_id_prefix: str | None = None, space: str | list[str] | None = None, limit: int = DEFAULT_LIMIT_READ, filter: dm.Filter | None = None) -> list[dm.aggregations.AggregatedNumberedValue]
aggregate(aggregate: Aggregations | dm.aggregations.MetricAggregation | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation], group_by: SensorPositionFields | SequenceNotStr[SensorPositionFields], property: SensorPositionFields | SequenceNotStr[SensorPositionFields] | None = None, min_position: float | None = None, max_position: float | None = None, external_id_prefix: str | None = None, space: str | list[str] | None = None, limit: int = DEFAULT_LIMIT_READ, filter: dm.Filter | None = None) -> InstanceAggregationResultList

Aggregate data across sensor positions

Parameters:

Name Type Description Default
aggregate Aggregations | MetricAggregation | SequenceNotStr[Aggregations | MetricAggregation]

The aggregation to perform.

required
group_by SensorPositionFields | SequenceNotStr[SensorPositionFields] | None

The property to group by when doing the aggregation.

None
property SensorPositionFields | SequenceNotStr[SensorPositionFields] | None

The property to perform aggregation on.

None
min_position float | None

The minimum value of the position to filter on.

None
max_position float | None

The maximum value of the position to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
AggregatedNumberedValue | list[AggregatedNumberedValue] | InstanceAggregationResultList

Aggregation results.

Examples:

Count sensor positions in space `my_space`:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> result = client.sensor_position.aggregate("count", space="my_space")
Source code in examples/windmill/_api/sensor_position.py
def aggregate(
    self,
    aggregate: (
        Aggregations
        | dm.aggregations.MetricAggregation
        | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation]
    ),
    group_by: SensorPositionFields | SequenceNotStr[SensorPositionFields] | None = None,
    property: SensorPositionFields | SequenceNotStr[SensorPositionFields] | None = None,
    min_position: float | None = None,
    max_position: float | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> (
    dm.aggregations.AggregatedNumberedValue
    | list[dm.aggregations.AggregatedNumberedValue]
    | InstanceAggregationResultList
):
    """Aggregate data across sensor positions

    Args:
        aggregate: The aggregation to perform.
        group_by: The property to group by when doing the aggregation.
        property: The property to perform aggregation on.
        min_position: The minimum value of the position to filter on.
        max_position: The maximum value of the position to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        Aggregation results.

    Examples:

        Count sensor positions in space `my_space`:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> result = client.sensor_position.aggregate("count", space="my_space")

    """

    filter_ = _create_sensor_position_filter(
        self._view_id,
        min_position,
        max_position,
        external_id_prefix,
        space,
        filter,
    )
    return self._aggregate(
        aggregate=aggregate,
        group_by=group_by,  # type: ignore[arg-type]
        properties=property,  # type: ignore[arg-type]
        query=None,
        search_properties=None,
        limit=limit,
        filter=filter_,
    )

apply(sensor_position, replace=False, write_none=False)

Add or update (upsert) sensor positions.

Parameters:

Name Type Description Default
sensor_position SensorPositionWrite | Sequence[SensorPositionWrite]

Sensor position or sequence of sensor positions to upsert.

required
replace bool

How do we behave when a property value exists? Do we replace all matching and existing values with the supplied values (true)? Or should we merge in new values for properties together with the existing values (false)? Note: This setting applies for all nodes or edges specified in the ingestion call.

False
write_none bool

This method, will by default, skip properties that are set to None. However, if you want to set properties to None, you can set this parameter to True. Note this only applies to properties that are nullable.

False

Returns: Created instance(s), i.e., nodes, edges, and time series.

Examples:

Create a new sensor_position:

    >>> from windmill import WindmillClient
    >>> from windmill.data_classes import SensorPositionWrite
    >>> client = WindmillClient()
    >>> sensor_position = SensorPositionWrite(external_id="my_sensor_position", ...)
    >>> result = client.sensor_position.apply(sensor_position)
Source code in examples/windmill/_api/sensor_position.py
def apply(
    self,
    sensor_position: SensorPositionWrite | Sequence[SensorPositionWrite],
    replace: bool = False,
    write_none: bool = False,
) -> ResourcesWriteResult:
    """Add or update (upsert) sensor positions.

    Args:
        sensor_position: Sensor position or sequence of sensor positions to upsert.
        replace (bool): How do we behave when a property value exists? Do we replace all matching and existing values with the supplied values (true)?
            Or should we merge in new values for properties together with the existing values (false)? Note: This setting applies for all nodes or edges specified in the ingestion call.
        write_none (bool): This method, will by default, skip properties that are set to None. However, if you want to set properties to None,
            you can set this parameter to True. Note this only applies to properties that are nullable.
    Returns:
        Created instance(s), i.e., nodes, edges, and time series.

    Examples:

        Create a new sensor_position:

            >>> from windmill import WindmillClient
            >>> from windmill.data_classes import SensorPositionWrite
            >>> client = WindmillClient()
            >>> sensor_position = SensorPositionWrite(external_id="my_sensor_position", ...)
            >>> result = client.sensor_position.apply(sensor_position)

    """
    warnings.warn(
        "The .apply method is deprecated and will be removed in v1.0. "
        "Please use the .upsert method on the client instead. This means instead of "
        "`my_client.sensor_position.apply(my_items)` please use `my_client.upsert(my_items)`."
        "The motivation is that all apply methods are the same, and having one apply method per API "
        " class encourages users to create items in small batches, which is inefficient."
        "In addition, .upsert method is more descriptive of what the method does.",
        UserWarning,
        stacklevel=2,
    )
    return self._apply(sensor_position, replace, write_none)

delete(external_id, space=DEFAULT_INSTANCE_SPACE)

Delete one or more sensor position.

Parameters:

Name Type Description Default
external_id str | SequenceNotStr[str]

External id of the sensor position to delete.

required
space str

The space where all the sensor position are located.

DEFAULT_INSTANCE_SPACE

Returns:

Type Description
InstancesDeleteResult

The instance(s), i.e., nodes and edges which has been deleted. Empty list if nothing was deleted.

Examples:

Delete sensor_position by id:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> client.sensor_position.delete("my_sensor_position")
Source code in examples/windmill/_api/sensor_position.py
def delete(
    self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
) -> dm.InstancesDeleteResult:
    """Delete one or more sensor position.

    Args:
        external_id: External id of the sensor position to delete.
        space: The space where all the sensor position are located.

    Returns:
        The instance(s), i.e., nodes and edges which has been deleted. Empty list if nothing was deleted.

    Examples:

        Delete sensor_position by id:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> client.sensor_position.delete("my_sensor_position")
    """
    warnings.warn(
        "The .delete method is deprecated and will be removed in v1.0. "
        "Please use the .delete method on the client instead. This means instead of "
        "`my_client.sensor_position.delete(my_ids)` please use `my_client.delete(my_ids)`."
        "The motivation is that all delete methods are the same, and having one delete method per API "
        " class encourages users to delete items in small batches, which is inefficient.",
        UserWarning,
        stacklevel=2,
    )
    return self._delete(external_id, space)

histogram(property, interval, min_position=None, max_position=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Produces histograms for sensor positions

Parameters:

Name Type Description Default
property SensorPositionFields

The property to use as the value in the histogram.

required
interval float

The interval to use for the histogram bins.

required
min_position float | None

The minimum value of the position to filter on.

None
max_position float | None

The maximum value of the position to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
HistogramValue

Bucketed histogram results.

Source code in examples/windmill/_api/sensor_position.py
def histogram(
    self,
    property: SensorPositionFields,
    interval: float,
    min_position: float | None = None,
    max_position: float | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> dm.aggregations.HistogramValue:
    """Produces histograms for sensor positions

    Args:
        property: The property to use as the value in the histogram.
        interval: The interval to use for the histogram bins.
        min_position: The minimum value of the position to filter on.
        max_position: The maximum value of the position to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        Bucketed histogram results.

    """
    filter_ = _create_sensor_position_filter(
        self._view_id,
        min_position,
        max_position,
        external_id_prefix,
        space,
        filter,
    )
    return self._histogram(
        property,
        interval,
        None,
        None,
        limit,
        filter_,
    )

list(min_position=None, max_position=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None, sort_by=None, direction='ascending', sort=None)

List/filter sensor positions

Parameters:

Name Type Description Default
min_position float | None

The minimum value of the position to filter on.

None
max_position float | None

The maximum value of the position to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None
sort_by SensorPositionFields | Sequence[SensorPositionFields] | None

The property to sort by.

None
direction Literal['ascending', 'descending']

The direction to sort by, either 'ascending' or 'descending'.

'ascending'
sort InstanceSort | list[InstanceSort] | None

(Advanced) If sort_by and direction are not sufficient, you can write your own sorting. This will override the sort_by and direction. This allowos you to sort by multiple fields and specify the direction for each field as well as how to handle null values.

None

Returns:

Type Description
SensorPositionList

List of requested sensor positions

Examples:

List sensor positions and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> sensor_positions = client.sensor_position.list(limit=5)
Source code in examples/windmill/_api/sensor_position.py
def list(
    self,
    min_position: float | None = None,
    max_position: float | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
    sort_by: SensorPositionFields | Sequence[SensorPositionFields] | None = None,
    direction: Literal["ascending", "descending"] = "ascending",
    sort: InstanceSort | list[InstanceSort] | None = None,
) -> SensorPositionList:
    """List/filter sensor positions

    Args:
        min_position: The minimum value of the position to filter on.
        max_position: The maximum value of the position to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
        sort_by: The property to sort by.
        direction: The direction to sort by, either 'ascending' or 'descending'.
        sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
            This will override the sort_by and direction. This allowos you to sort by multiple fields and
            specify the direction for each field as well as how to handle null values.

    Returns:
        List of requested sensor positions

    Examples:

        List sensor positions and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> sensor_positions = client.sensor_position.list(limit=5)

    """
    filter_ = _create_sensor_position_filter(
        self._view_id,
        min_position,
        max_position,
        external_id_prefix,
        space,
        filter,
    )

    return self._list(
        limit=limit,
        filter=filter_,
        sort_by=sort_by,  # type: ignore[arg-type]
        direction=direction,
        sort=sort,
    )

query()

Start a query for sensor positions.

Source code in examples/windmill/_api/sensor_position.py
def query(self) -> SensorPositionQuery:
    """Start a query for sensor positions."""
    warnings.warn("The .query is in alpha and is subject to breaking changes without notice.")
    return SensorPositionQuery(self._client)

retrieve(external_id, space=DEFAULT_INSTANCE_SPACE)

retrieve(external_id: str, space: str = DEFAULT_INSTANCE_SPACE) -> SensorPosition | None
retrieve(external_id: SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE) -> SensorPositionList

Retrieve one or more sensor positions by id(s).

Parameters:

Name Type Description Default
external_id str | SequenceNotStr[str]

External id or list of external ids of the sensor positions.

required
space str

The space where all the sensor positions are located.

DEFAULT_INSTANCE_SPACE

Returns:

Type Description
SensorPosition | SensorPositionList | None

The requested sensor positions.

Examples:

Retrieve sensor_position by id:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> sensor_position = client.sensor_position.retrieve("my_sensor_position")
Source code in examples/windmill/_api/sensor_position.py
def retrieve(
    self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
) -> SensorPosition | SensorPositionList | None:
    """Retrieve one or more sensor positions by id(s).

    Args:
        external_id: External id or list of external ids of the sensor positions.
        space: The space where all the sensor positions are located.

    Returns:
        The requested sensor positions.

    Examples:

        Retrieve sensor_position by id:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> sensor_position = client.sensor_position.retrieve("my_sensor_position")

    """
    return self._retrieve(external_id, space)

search(query, properties=None, min_position=None, max_position=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None, sort_by=None, direction='ascending', sort=None)

Search sensor positions

Parameters:

Name Type Description Default
query str

The search query,

required
properties SensorPositionTextFields | SequenceNotStr[SensorPositionTextFields] | None

The property to search, if nothing is passed all text fields will be searched.

None
min_position float | None

The minimum value of the position to filter on.

None
max_position float | None

The maximum value of the position to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None
sort_by SensorPositionFields | SequenceNotStr[SensorPositionFields] | None

The property to sort by.

None
direction Literal['ascending', 'descending']

The direction to sort by, either 'ascending' or 'descending'.

'ascending'
sort InstanceSort | list[InstanceSort] | None

(Advanced) If sort_by and direction are not sufficient, you can write your own sorting. This will override the sort_by and direction. This allowos you to sort by multiple fields and specify the direction for each field as well as how to handle null values.

None

Returns:

Type Description
SensorPositionList

Search results sensor positions matching the query.

Examples:

Search for 'my_sensor_position' in all text properties:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> sensor_positions = client.sensor_position.search('my_sensor_position')
Source code in examples/windmill/_api/sensor_position.py
def search(
    self,
    query: str,
    properties: SensorPositionTextFields | SequenceNotStr[SensorPositionTextFields] | None = None,
    min_position: float | None = None,
    max_position: float | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
    sort_by: SensorPositionFields | SequenceNotStr[SensorPositionFields] | None = None,
    direction: Literal["ascending", "descending"] = "ascending",
    sort: InstanceSort | list[InstanceSort] | None = None,
) -> SensorPositionList:
    """Search sensor positions

    Args:
        query: The search query,
        properties: The property to search, if nothing is passed all text fields will be searched.
        min_position: The minimum value of the position to filter on.
        max_position: The maximum value of the position to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
        sort_by: The property to sort by.
        direction: The direction to sort by, either 'ascending' or 'descending'.
        sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
            This will override the sort_by and direction. This allowos you to sort by multiple fields and
            specify the direction for each field as well as how to handle null values.

    Returns:
        Search results sensor positions matching the query.

    Examples:

       Search for 'my_sensor_position' in all text properties:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> sensor_positions = client.sensor_position.search('my_sensor_position')

    """
    filter_ = _create_sensor_position_filter(
        self._view_id,
        min_position,
        max_position,
        external_id_prefix,
        space,
        filter,
    )
    return self._search(
        query=query,
        properties=properties,
        filter_=filter_,
        limit=limit,
        sort_by=sort_by,  # type: ignore[arg-type]
        direction=direction,
        sort=sort,
    )

SensorPositionEdgewiseBendMomCrosstalkCorrectedAPI

Source code in examples/windmill/_api/sensor_position_edgewise_bend_mom_crosstalk_corrected.py
class SensorPositionEdgewiseBendMomCrosstalkCorrectedAPI:
    def __init__(self, client: CogniteClient, view_id: dm.ViewId):
        self._client = client
        self._view_id = view_id

    def __call__(
        self,
        min_position: float | None = None,
        max_position: float | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> SensorPositionEdgewiseBendMomCrosstalkCorrectedQuery:
        """Query timeseries `sensor_position.edgewise_bend_mom_crosstalk_corrected`

        Args:
            min_position: The minimum value of the position to filter on.
            max_position: The maximum value of the position to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query object that can be used to retrieve datapoins for the sensor_position.edgewise_bend_mom_crosstalk_corrected timeseries
            selected in this method.

        Examples:

            Retrieve all data for 5 sensor_position.edgewise_bend_mom_crosstalk_corrected timeseries:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> sensor_positions = client.sensor_position.edgewise_bend_mom_crosstalk_corrected(limit=5).retrieve()

        """
        filter_ = _create_sensor_position_filter(
            self._view_id,
            min_position,
            max_position,
            external_id_prefix,
            space,
            filter,
        )

        return SensorPositionEdgewiseBendMomCrosstalkCorrectedQuery(
            client=self._client,
            view_id=self._view_id,
            timeseries_limit=limit,
            filter=filter_,
        )

    def list(
        self,
        min_position: float | None = None,
        max_position: float | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> TimeSeriesList:
        """List timeseries `sensor_position.edgewise_bend_mom_crosstalk_corrected`

        Args:
            min_position: The minimum value of the position to filter on.
            max_position: The maximum value of the position to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            List of Timeseries sensor_position.edgewise_bend_mom_crosstalk_corrected.

        Examples:

            List sensor_position.edgewise_bend_mom_crosstalk_corrected and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> sensor_positions = client.sensor_position.edgewise_bend_mom_crosstalk_corrected.list(limit=5)

        """
        filter_ = _create_sensor_position_filter(
            self._view_id,
            min_position,
            max_position,
            external_id_prefix,
            space,
            filter,
        )
        external_ids = _retrieve_timeseries_external_ids_with_extra_edgewise_bend_mom_crosstalk_corrected(
            self._client, self._view_id, filter_, limit
        )
        if external_ids:
            return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
        else:
            return TimeSeriesList([])

__call__(min_position=None, max_position=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Query timeseries sensor_position.edgewise_bend_mom_crosstalk_corrected

Parameters:

Name Type Description Default
min_position float | None

The minimum value of the position to filter on.

None
max_position float | None

The maximum value of the position to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
SensorPositionEdgewiseBendMomCrosstalkCorrectedQuery

A query object that can be used to retrieve datapoins for the sensor_position.edgewise_bend_mom_crosstalk_corrected timeseries

SensorPositionEdgewiseBendMomCrosstalkCorrectedQuery

selected in this method.

Examples:

Retrieve all data for 5 sensor_position.edgewise_bend_mom_crosstalk_corrected timeseries:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> sensor_positions = client.sensor_position.edgewise_bend_mom_crosstalk_corrected(limit=5).retrieve()
Source code in examples/windmill/_api/sensor_position_edgewise_bend_mom_crosstalk_corrected.py
def __call__(
    self,
    min_position: float | None = None,
    max_position: float | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> SensorPositionEdgewiseBendMomCrosstalkCorrectedQuery:
    """Query timeseries `sensor_position.edgewise_bend_mom_crosstalk_corrected`

    Args:
        min_position: The minimum value of the position to filter on.
        max_position: The maximum value of the position to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query object that can be used to retrieve datapoins for the sensor_position.edgewise_bend_mom_crosstalk_corrected timeseries
        selected in this method.

    Examples:

        Retrieve all data for 5 sensor_position.edgewise_bend_mom_crosstalk_corrected timeseries:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> sensor_positions = client.sensor_position.edgewise_bend_mom_crosstalk_corrected(limit=5).retrieve()

    """
    filter_ = _create_sensor_position_filter(
        self._view_id,
        min_position,
        max_position,
        external_id_prefix,
        space,
        filter,
    )

    return SensorPositionEdgewiseBendMomCrosstalkCorrectedQuery(
        client=self._client,
        view_id=self._view_id,
        timeseries_limit=limit,
        filter=filter_,
    )

list(min_position=None, max_position=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

List timeseries sensor_position.edgewise_bend_mom_crosstalk_corrected

Parameters:

Name Type Description Default
min_position float | None

The minimum value of the position to filter on.

None
max_position float | None

The maximum value of the position to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
TimeSeriesList

List of Timeseries sensor_position.edgewise_bend_mom_crosstalk_corrected.

Examples:

List sensor_position.edgewise_bend_mom_crosstalk_corrected and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> sensor_positions = client.sensor_position.edgewise_bend_mom_crosstalk_corrected.list(limit=5)
Source code in examples/windmill/_api/sensor_position_edgewise_bend_mom_crosstalk_corrected.py
def list(
    self,
    min_position: float | None = None,
    max_position: float | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> TimeSeriesList:
    """List timeseries `sensor_position.edgewise_bend_mom_crosstalk_corrected`

    Args:
        min_position: The minimum value of the position to filter on.
        max_position: The maximum value of the position to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        List of Timeseries sensor_position.edgewise_bend_mom_crosstalk_corrected.

    Examples:

        List sensor_position.edgewise_bend_mom_crosstalk_corrected and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> sensor_positions = client.sensor_position.edgewise_bend_mom_crosstalk_corrected.list(limit=5)

    """
    filter_ = _create_sensor_position_filter(
        self._view_id,
        min_position,
        max_position,
        external_id_prefix,
        space,
        filter,
    )
    external_ids = _retrieve_timeseries_external_ids_with_extra_edgewise_bend_mom_crosstalk_corrected(
        self._client, self._view_id, filter_, limit
    )
    if external_ids:
        return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
    else:
        return TimeSeriesList([])

SensorPositionEdgewiseBendMomOffsetAPI

Source code in examples/windmill/_api/sensor_position_edgewise_bend_mom_offset.py
class SensorPositionEdgewiseBendMomOffsetAPI:
    def __init__(self, client: CogniteClient, view_id: dm.ViewId):
        self._client = client
        self._view_id = view_id

    def __call__(
        self,
        min_position: float | None = None,
        max_position: float | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> SensorPositionEdgewiseBendMomOffsetQuery:
        """Query timeseries `sensor_position.edgewise_bend_mom_offset`

        Args:
            min_position: The minimum value of the position to filter on.
            max_position: The maximum value of the position to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query object that can be used to retrieve datapoins for the sensor_position.edgewise_bend_mom_offset timeseries
            selected in this method.

        Examples:

            Retrieve all data for 5 sensor_position.edgewise_bend_mom_offset timeseries:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> sensor_positions = client.sensor_position.edgewise_bend_mom_offset(limit=5).retrieve()

        """
        filter_ = _create_sensor_position_filter(
            self._view_id,
            min_position,
            max_position,
            external_id_prefix,
            space,
            filter,
        )

        return SensorPositionEdgewiseBendMomOffsetQuery(
            client=self._client,
            view_id=self._view_id,
            timeseries_limit=limit,
            filter=filter_,
        )

    def list(
        self,
        min_position: float | None = None,
        max_position: float | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> TimeSeriesList:
        """List timeseries `sensor_position.edgewise_bend_mom_offset`

        Args:
            min_position: The minimum value of the position to filter on.
            max_position: The maximum value of the position to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            List of Timeseries sensor_position.edgewise_bend_mom_offset.

        Examples:

            List sensor_position.edgewise_bend_mom_offset and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> sensor_positions = client.sensor_position.edgewise_bend_mom_offset.list(limit=5)

        """
        filter_ = _create_sensor_position_filter(
            self._view_id,
            min_position,
            max_position,
            external_id_prefix,
            space,
            filter,
        )
        external_ids = _retrieve_timeseries_external_ids_with_extra_edgewise_bend_mom_offset(
            self._client, self._view_id, filter_, limit
        )
        if external_ids:
            return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
        else:
            return TimeSeriesList([])

__call__(min_position=None, max_position=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Query timeseries sensor_position.edgewise_bend_mom_offset

Parameters:

Name Type Description Default
min_position float | None

The minimum value of the position to filter on.

None
max_position float | None

The maximum value of the position to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
SensorPositionEdgewiseBendMomOffsetQuery

A query object that can be used to retrieve datapoins for the sensor_position.edgewise_bend_mom_offset timeseries

SensorPositionEdgewiseBendMomOffsetQuery

selected in this method.

Examples:

Retrieve all data for 5 sensor_position.edgewise_bend_mom_offset timeseries:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> sensor_positions = client.sensor_position.edgewise_bend_mom_offset(limit=5).retrieve()
Source code in examples/windmill/_api/sensor_position_edgewise_bend_mom_offset.py
def __call__(
    self,
    min_position: float | None = None,
    max_position: float | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> SensorPositionEdgewiseBendMomOffsetQuery:
    """Query timeseries `sensor_position.edgewise_bend_mom_offset`

    Args:
        min_position: The minimum value of the position to filter on.
        max_position: The maximum value of the position to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query object that can be used to retrieve datapoins for the sensor_position.edgewise_bend_mom_offset timeseries
        selected in this method.

    Examples:

        Retrieve all data for 5 sensor_position.edgewise_bend_mom_offset timeseries:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> sensor_positions = client.sensor_position.edgewise_bend_mom_offset(limit=5).retrieve()

    """
    filter_ = _create_sensor_position_filter(
        self._view_id,
        min_position,
        max_position,
        external_id_prefix,
        space,
        filter,
    )

    return SensorPositionEdgewiseBendMomOffsetQuery(
        client=self._client,
        view_id=self._view_id,
        timeseries_limit=limit,
        filter=filter_,
    )

list(min_position=None, max_position=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

List timeseries sensor_position.edgewise_bend_mom_offset

Parameters:

Name Type Description Default
min_position float | None

The minimum value of the position to filter on.

None
max_position float | None

The maximum value of the position to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
TimeSeriesList

List of Timeseries sensor_position.edgewise_bend_mom_offset.

Examples:

List sensor_position.edgewise_bend_mom_offset and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> sensor_positions = client.sensor_position.edgewise_bend_mom_offset.list(limit=5)
Source code in examples/windmill/_api/sensor_position_edgewise_bend_mom_offset.py
def list(
    self,
    min_position: float | None = None,
    max_position: float | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> TimeSeriesList:
    """List timeseries `sensor_position.edgewise_bend_mom_offset`

    Args:
        min_position: The minimum value of the position to filter on.
        max_position: The maximum value of the position to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        List of Timeseries sensor_position.edgewise_bend_mom_offset.

    Examples:

        List sensor_position.edgewise_bend_mom_offset and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> sensor_positions = client.sensor_position.edgewise_bend_mom_offset.list(limit=5)

    """
    filter_ = _create_sensor_position_filter(
        self._view_id,
        min_position,
        max_position,
        external_id_prefix,
        space,
        filter,
    )
    external_ids = _retrieve_timeseries_external_ids_with_extra_edgewise_bend_mom_offset(
        self._client, self._view_id, filter_, limit
    )
    if external_ids:
        return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
    else:
        return TimeSeriesList([])

SensorPositionEdgewiseBendMomOffsetCrosstalkCorrectedAPI

Source code in examples/windmill/_api/sensor_position_edgewise_bend_mom_offset_crosstalk_corrected.py
class SensorPositionEdgewiseBendMomOffsetCrosstalkCorrectedAPI:
    def __init__(self, client: CogniteClient, view_id: dm.ViewId):
        self._client = client
        self._view_id = view_id

    def __call__(
        self,
        min_position: float | None = None,
        max_position: float | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> SensorPositionEdgewiseBendMomOffsetCrosstalkCorrectedQuery:
        """Query timeseries `sensor_position.edgewise_bend_mom_offset_crosstalk_corrected`

        Args:
            min_position: The minimum value of the position to filter on.
            max_position: The maximum value of the position to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query object that can be used to retrieve datapoins for the sensor_position.edgewise_bend_mom_offset_crosstalk_corrected timeseries
            selected in this method.

        Examples:

            Retrieve all data for 5 sensor_position.edgewise_bend_mom_offset_crosstalk_corrected timeseries:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> sensor_positions = client.sensor_position.edgewise_bend_mom_offset_crosstalk_corrected(limit=5).retrieve()

        """
        filter_ = _create_sensor_position_filter(
            self._view_id,
            min_position,
            max_position,
            external_id_prefix,
            space,
            filter,
        )

        return SensorPositionEdgewiseBendMomOffsetCrosstalkCorrectedQuery(
            client=self._client,
            view_id=self._view_id,
            timeseries_limit=limit,
            filter=filter_,
        )

    def list(
        self,
        min_position: float | None = None,
        max_position: float | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> TimeSeriesList:
        """List timeseries `sensor_position.edgewise_bend_mom_offset_crosstalk_corrected`

        Args:
            min_position: The minimum value of the position to filter on.
            max_position: The maximum value of the position to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            List of Timeseries sensor_position.edgewise_bend_mom_offset_crosstalk_corrected.

        Examples:

            List sensor_position.edgewise_bend_mom_offset_crosstalk_corrected and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> sensor_positions = client.sensor_position.edgewise_bend_mom_offset_crosstalk_corrected.list(limit=5)

        """
        filter_ = _create_sensor_position_filter(
            self._view_id,
            min_position,
            max_position,
            external_id_prefix,
            space,
            filter,
        )
        external_ids = _retrieve_timeseries_external_ids_with_extra_edgewise_bend_mom_offset_crosstalk_corrected(
            self._client, self._view_id, filter_, limit
        )
        if external_ids:
            return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
        else:
            return TimeSeriesList([])

__call__(min_position=None, max_position=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Query timeseries sensor_position.edgewise_bend_mom_offset_crosstalk_corrected

Parameters:

Name Type Description Default
min_position float | None

The minimum value of the position to filter on.

None
max_position float | None

The maximum value of the position to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
SensorPositionEdgewiseBendMomOffsetCrosstalkCorrectedQuery

A query object that can be used to retrieve datapoins for the sensor_position.edgewise_bend_mom_offset_crosstalk_corrected timeseries

SensorPositionEdgewiseBendMomOffsetCrosstalkCorrectedQuery

selected in this method.

Examples:

Retrieve all data for 5 sensor_position.edgewise_bend_mom_offset_crosstalk_corrected timeseries:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> sensor_positions = client.sensor_position.edgewise_bend_mom_offset_crosstalk_corrected(limit=5).retrieve()
Source code in examples/windmill/_api/sensor_position_edgewise_bend_mom_offset_crosstalk_corrected.py
def __call__(
    self,
    min_position: float | None = None,
    max_position: float | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> SensorPositionEdgewiseBendMomOffsetCrosstalkCorrectedQuery:
    """Query timeseries `sensor_position.edgewise_bend_mom_offset_crosstalk_corrected`

    Args:
        min_position: The minimum value of the position to filter on.
        max_position: The maximum value of the position to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query object that can be used to retrieve datapoins for the sensor_position.edgewise_bend_mom_offset_crosstalk_corrected timeseries
        selected in this method.

    Examples:

        Retrieve all data for 5 sensor_position.edgewise_bend_mom_offset_crosstalk_corrected timeseries:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> sensor_positions = client.sensor_position.edgewise_bend_mom_offset_crosstalk_corrected(limit=5).retrieve()

    """
    filter_ = _create_sensor_position_filter(
        self._view_id,
        min_position,
        max_position,
        external_id_prefix,
        space,
        filter,
    )

    return SensorPositionEdgewiseBendMomOffsetCrosstalkCorrectedQuery(
        client=self._client,
        view_id=self._view_id,
        timeseries_limit=limit,
        filter=filter_,
    )

list(min_position=None, max_position=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

List timeseries sensor_position.edgewise_bend_mom_offset_crosstalk_corrected

Parameters:

Name Type Description Default
min_position float | None

The minimum value of the position to filter on.

None
max_position float | None

The maximum value of the position to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
TimeSeriesList

List of Timeseries sensor_position.edgewise_bend_mom_offset_crosstalk_corrected.

Examples:

List sensor_position.edgewise_bend_mom_offset_crosstalk_corrected and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> sensor_positions = client.sensor_position.edgewise_bend_mom_offset_crosstalk_corrected.list(limit=5)
Source code in examples/windmill/_api/sensor_position_edgewise_bend_mom_offset_crosstalk_corrected.py
def list(
    self,
    min_position: float | None = None,
    max_position: float | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> TimeSeriesList:
    """List timeseries `sensor_position.edgewise_bend_mom_offset_crosstalk_corrected`

    Args:
        min_position: The minimum value of the position to filter on.
        max_position: The maximum value of the position to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        List of Timeseries sensor_position.edgewise_bend_mom_offset_crosstalk_corrected.

    Examples:

        List sensor_position.edgewise_bend_mom_offset_crosstalk_corrected and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> sensor_positions = client.sensor_position.edgewise_bend_mom_offset_crosstalk_corrected.list(limit=5)

    """
    filter_ = _create_sensor_position_filter(
        self._view_id,
        min_position,
        max_position,
        external_id_prefix,
        space,
        filter,
    )
    external_ids = _retrieve_timeseries_external_ids_with_extra_edgewise_bend_mom_offset_crosstalk_corrected(
        self._client, self._view_id, filter_, limit
    )
    if external_ids:
        return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
    else:
        return TimeSeriesList([])

SensorPositionEdgewisewiseBendMomAPI

Source code in examples/windmill/_api/sensor_position_edgewisewise_bend_mom.py
class SensorPositionEdgewisewiseBendMomAPI:
    def __init__(self, client: CogniteClient, view_id: dm.ViewId):
        self._client = client
        self._view_id = view_id

    def __call__(
        self,
        min_position: float | None = None,
        max_position: float | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> SensorPositionEdgewisewiseBendMomQuery:
        """Query timeseries `sensor_position.edgewisewise_bend_mom`

        Args:
            min_position: The minimum value of the position to filter on.
            max_position: The maximum value of the position to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query object that can be used to retrieve datapoins for the sensor_position.edgewisewise_bend_mom timeseries
            selected in this method.

        Examples:

            Retrieve all data for 5 sensor_position.edgewisewise_bend_mom timeseries:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> sensor_positions = client.sensor_position.edgewisewise_bend_mom(limit=5).retrieve()

        """
        filter_ = _create_sensor_position_filter(
            self._view_id,
            min_position,
            max_position,
            external_id_prefix,
            space,
            filter,
        )

        return SensorPositionEdgewisewiseBendMomQuery(
            client=self._client,
            view_id=self._view_id,
            timeseries_limit=limit,
            filter=filter_,
        )

    def list(
        self,
        min_position: float | None = None,
        max_position: float | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> TimeSeriesList:
        """List timeseries `sensor_position.edgewisewise_bend_mom`

        Args:
            min_position: The minimum value of the position to filter on.
            max_position: The maximum value of the position to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            List of Timeseries sensor_position.edgewisewise_bend_mom.

        Examples:

            List sensor_position.edgewisewise_bend_mom and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> sensor_positions = client.sensor_position.edgewisewise_bend_mom.list(limit=5)

        """
        filter_ = _create_sensor_position_filter(
            self._view_id,
            min_position,
            max_position,
            external_id_prefix,
            space,
            filter,
        )
        external_ids = _retrieve_timeseries_external_ids_with_extra_edgewisewise_bend_mom(
            self._client, self._view_id, filter_, limit
        )
        if external_ids:
            return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
        else:
            return TimeSeriesList([])

__call__(min_position=None, max_position=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Query timeseries sensor_position.edgewisewise_bend_mom

Parameters:

Name Type Description Default
min_position float | None

The minimum value of the position to filter on.

None
max_position float | None

The maximum value of the position to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
SensorPositionEdgewisewiseBendMomQuery

A query object that can be used to retrieve datapoins for the sensor_position.edgewisewise_bend_mom timeseries

SensorPositionEdgewisewiseBendMomQuery

selected in this method.

Examples:

Retrieve all data for 5 sensor_position.edgewisewise_bend_mom timeseries:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> sensor_positions = client.sensor_position.edgewisewise_bend_mom(limit=5).retrieve()
Source code in examples/windmill/_api/sensor_position_edgewisewise_bend_mom.py
def __call__(
    self,
    min_position: float | None = None,
    max_position: float | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> SensorPositionEdgewisewiseBendMomQuery:
    """Query timeseries `sensor_position.edgewisewise_bend_mom`

    Args:
        min_position: The minimum value of the position to filter on.
        max_position: The maximum value of the position to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query object that can be used to retrieve datapoins for the sensor_position.edgewisewise_bend_mom timeseries
        selected in this method.

    Examples:

        Retrieve all data for 5 sensor_position.edgewisewise_bend_mom timeseries:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> sensor_positions = client.sensor_position.edgewisewise_bend_mom(limit=5).retrieve()

    """
    filter_ = _create_sensor_position_filter(
        self._view_id,
        min_position,
        max_position,
        external_id_prefix,
        space,
        filter,
    )

    return SensorPositionEdgewisewiseBendMomQuery(
        client=self._client,
        view_id=self._view_id,
        timeseries_limit=limit,
        filter=filter_,
    )

list(min_position=None, max_position=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

List timeseries sensor_position.edgewisewise_bend_mom

Parameters:

Name Type Description Default
min_position float | None

The minimum value of the position to filter on.

None
max_position float | None

The maximum value of the position to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
TimeSeriesList

List of Timeseries sensor_position.edgewisewise_bend_mom.

Examples:

List sensor_position.edgewisewise_bend_mom and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> sensor_positions = client.sensor_position.edgewisewise_bend_mom.list(limit=5)
Source code in examples/windmill/_api/sensor_position_edgewisewise_bend_mom.py
def list(
    self,
    min_position: float | None = None,
    max_position: float | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> TimeSeriesList:
    """List timeseries `sensor_position.edgewisewise_bend_mom`

    Args:
        min_position: The minimum value of the position to filter on.
        max_position: The maximum value of the position to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        List of Timeseries sensor_position.edgewisewise_bend_mom.

    Examples:

        List sensor_position.edgewisewise_bend_mom and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> sensor_positions = client.sensor_position.edgewisewise_bend_mom.list(limit=5)

    """
    filter_ = _create_sensor_position_filter(
        self._view_id,
        min_position,
        max_position,
        external_id_prefix,
        space,
        filter,
    )
    external_ids = _retrieve_timeseries_external_ids_with_extra_edgewisewise_bend_mom(
        self._client, self._view_id, filter_, limit
    )
    if external_ids:
        return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
    else:
        return TimeSeriesList([])

SensorPositionFlapwiseBendMomAPI

Source code in examples/windmill/_api/sensor_position_flapwise_bend_mom.py
class SensorPositionFlapwiseBendMomAPI:
    def __init__(self, client: CogniteClient, view_id: dm.ViewId):
        self._client = client
        self._view_id = view_id

    def __call__(
        self,
        min_position: float | None = None,
        max_position: float | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> SensorPositionFlapwiseBendMomQuery:
        """Query timeseries `sensor_position.flapwise_bend_mom`

        Args:
            min_position: The minimum value of the position to filter on.
            max_position: The maximum value of the position to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query object that can be used to retrieve datapoins for the sensor_position.flapwise_bend_mom timeseries
            selected in this method.

        Examples:

            Retrieve all data for 5 sensor_position.flapwise_bend_mom timeseries:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> sensor_positions = client.sensor_position.flapwise_bend_mom(limit=5).retrieve()

        """
        filter_ = _create_sensor_position_filter(
            self._view_id,
            min_position,
            max_position,
            external_id_prefix,
            space,
            filter,
        )

        return SensorPositionFlapwiseBendMomQuery(
            client=self._client,
            view_id=self._view_id,
            timeseries_limit=limit,
            filter=filter_,
        )

    def list(
        self,
        min_position: float | None = None,
        max_position: float | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> TimeSeriesList:
        """List timeseries `sensor_position.flapwise_bend_mom`

        Args:
            min_position: The minimum value of the position to filter on.
            max_position: The maximum value of the position to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            List of Timeseries sensor_position.flapwise_bend_mom.

        Examples:

            List sensor_position.flapwise_bend_mom and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> sensor_positions = client.sensor_position.flapwise_bend_mom.list(limit=5)

        """
        filter_ = _create_sensor_position_filter(
            self._view_id,
            min_position,
            max_position,
            external_id_prefix,
            space,
            filter,
        )
        external_ids = _retrieve_timeseries_external_ids_with_extra_flapwise_bend_mom(
            self._client, self._view_id, filter_, limit
        )
        if external_ids:
            return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
        else:
            return TimeSeriesList([])

__call__(min_position=None, max_position=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Query timeseries sensor_position.flapwise_bend_mom

Parameters:

Name Type Description Default
min_position float | None

The minimum value of the position to filter on.

None
max_position float | None

The maximum value of the position to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
SensorPositionFlapwiseBendMomQuery

A query object that can be used to retrieve datapoins for the sensor_position.flapwise_bend_mom timeseries

SensorPositionFlapwiseBendMomQuery

selected in this method.

Examples:

Retrieve all data for 5 sensor_position.flapwise_bend_mom timeseries:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> sensor_positions = client.sensor_position.flapwise_bend_mom(limit=5).retrieve()
Source code in examples/windmill/_api/sensor_position_flapwise_bend_mom.py
def __call__(
    self,
    min_position: float | None = None,
    max_position: float | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> SensorPositionFlapwiseBendMomQuery:
    """Query timeseries `sensor_position.flapwise_bend_mom`

    Args:
        min_position: The minimum value of the position to filter on.
        max_position: The maximum value of the position to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query object that can be used to retrieve datapoins for the sensor_position.flapwise_bend_mom timeseries
        selected in this method.

    Examples:

        Retrieve all data for 5 sensor_position.flapwise_bend_mom timeseries:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> sensor_positions = client.sensor_position.flapwise_bend_mom(limit=5).retrieve()

    """
    filter_ = _create_sensor_position_filter(
        self._view_id,
        min_position,
        max_position,
        external_id_prefix,
        space,
        filter,
    )

    return SensorPositionFlapwiseBendMomQuery(
        client=self._client,
        view_id=self._view_id,
        timeseries_limit=limit,
        filter=filter_,
    )

list(min_position=None, max_position=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

List timeseries sensor_position.flapwise_bend_mom

Parameters:

Name Type Description Default
min_position float | None

The minimum value of the position to filter on.

None
max_position float | None

The maximum value of the position to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
TimeSeriesList

List of Timeseries sensor_position.flapwise_bend_mom.

Examples:

List sensor_position.flapwise_bend_mom and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> sensor_positions = client.sensor_position.flapwise_bend_mom.list(limit=5)
Source code in examples/windmill/_api/sensor_position_flapwise_bend_mom.py
def list(
    self,
    min_position: float | None = None,
    max_position: float | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> TimeSeriesList:
    """List timeseries `sensor_position.flapwise_bend_mom`

    Args:
        min_position: The minimum value of the position to filter on.
        max_position: The maximum value of the position to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        List of Timeseries sensor_position.flapwise_bend_mom.

    Examples:

        List sensor_position.flapwise_bend_mom and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> sensor_positions = client.sensor_position.flapwise_bend_mom.list(limit=5)

    """
    filter_ = _create_sensor_position_filter(
        self._view_id,
        min_position,
        max_position,
        external_id_prefix,
        space,
        filter,
    )
    external_ids = _retrieve_timeseries_external_ids_with_extra_flapwise_bend_mom(
        self._client, self._view_id, filter_, limit
    )
    if external_ids:
        return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
    else:
        return TimeSeriesList([])

SensorPositionFlapwiseBendMomCrosstalkCorrectedAPI

Source code in examples/windmill/_api/sensor_position_flapwise_bend_mom_crosstalk_corrected.py
class SensorPositionFlapwiseBendMomCrosstalkCorrectedAPI:
    def __init__(self, client: CogniteClient, view_id: dm.ViewId):
        self._client = client
        self._view_id = view_id

    def __call__(
        self,
        min_position: float | None = None,
        max_position: float | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> SensorPositionFlapwiseBendMomCrosstalkCorrectedQuery:
        """Query timeseries `sensor_position.flapwise_bend_mom_crosstalk_corrected`

        Args:
            min_position: The minimum value of the position to filter on.
            max_position: The maximum value of the position to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query object that can be used to retrieve datapoins for the sensor_position.flapwise_bend_mom_crosstalk_corrected timeseries
            selected in this method.

        Examples:

            Retrieve all data for 5 sensor_position.flapwise_bend_mom_crosstalk_corrected timeseries:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> sensor_positions = client.sensor_position.flapwise_bend_mom_crosstalk_corrected(limit=5).retrieve()

        """
        filter_ = _create_sensor_position_filter(
            self._view_id,
            min_position,
            max_position,
            external_id_prefix,
            space,
            filter,
        )

        return SensorPositionFlapwiseBendMomCrosstalkCorrectedQuery(
            client=self._client,
            view_id=self._view_id,
            timeseries_limit=limit,
            filter=filter_,
        )

    def list(
        self,
        min_position: float | None = None,
        max_position: float | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> TimeSeriesList:
        """List timeseries `sensor_position.flapwise_bend_mom_crosstalk_corrected`

        Args:
            min_position: The minimum value of the position to filter on.
            max_position: The maximum value of the position to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            List of Timeseries sensor_position.flapwise_bend_mom_crosstalk_corrected.

        Examples:

            List sensor_position.flapwise_bend_mom_crosstalk_corrected and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> sensor_positions = client.sensor_position.flapwise_bend_mom_crosstalk_corrected.list(limit=5)

        """
        filter_ = _create_sensor_position_filter(
            self._view_id,
            min_position,
            max_position,
            external_id_prefix,
            space,
            filter,
        )
        external_ids = _retrieve_timeseries_external_ids_with_extra_flapwise_bend_mom_crosstalk_corrected(
            self._client, self._view_id, filter_, limit
        )
        if external_ids:
            return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
        else:
            return TimeSeriesList([])

__call__(min_position=None, max_position=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Query timeseries sensor_position.flapwise_bend_mom_crosstalk_corrected

Parameters:

Name Type Description Default
min_position float | None

The minimum value of the position to filter on.

None
max_position float | None

The maximum value of the position to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
SensorPositionFlapwiseBendMomCrosstalkCorrectedQuery

A query object that can be used to retrieve datapoins for the sensor_position.flapwise_bend_mom_crosstalk_corrected timeseries

SensorPositionFlapwiseBendMomCrosstalkCorrectedQuery

selected in this method.

Examples:

Retrieve all data for 5 sensor_position.flapwise_bend_mom_crosstalk_corrected timeseries:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> sensor_positions = client.sensor_position.flapwise_bend_mom_crosstalk_corrected(limit=5).retrieve()
Source code in examples/windmill/_api/sensor_position_flapwise_bend_mom_crosstalk_corrected.py
def __call__(
    self,
    min_position: float | None = None,
    max_position: float | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> SensorPositionFlapwiseBendMomCrosstalkCorrectedQuery:
    """Query timeseries `sensor_position.flapwise_bend_mom_crosstalk_corrected`

    Args:
        min_position: The minimum value of the position to filter on.
        max_position: The maximum value of the position to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query object that can be used to retrieve datapoins for the sensor_position.flapwise_bend_mom_crosstalk_corrected timeseries
        selected in this method.

    Examples:

        Retrieve all data for 5 sensor_position.flapwise_bend_mom_crosstalk_corrected timeseries:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> sensor_positions = client.sensor_position.flapwise_bend_mom_crosstalk_corrected(limit=5).retrieve()

    """
    filter_ = _create_sensor_position_filter(
        self._view_id,
        min_position,
        max_position,
        external_id_prefix,
        space,
        filter,
    )

    return SensorPositionFlapwiseBendMomCrosstalkCorrectedQuery(
        client=self._client,
        view_id=self._view_id,
        timeseries_limit=limit,
        filter=filter_,
    )

list(min_position=None, max_position=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

List timeseries sensor_position.flapwise_bend_mom_crosstalk_corrected

Parameters:

Name Type Description Default
min_position float | None

The minimum value of the position to filter on.

None
max_position float | None

The maximum value of the position to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
TimeSeriesList

List of Timeseries sensor_position.flapwise_bend_mom_crosstalk_corrected.

Examples:

List sensor_position.flapwise_bend_mom_crosstalk_corrected and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> sensor_positions = client.sensor_position.flapwise_bend_mom_crosstalk_corrected.list(limit=5)
Source code in examples/windmill/_api/sensor_position_flapwise_bend_mom_crosstalk_corrected.py
def list(
    self,
    min_position: float | None = None,
    max_position: float | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> TimeSeriesList:
    """List timeseries `sensor_position.flapwise_bend_mom_crosstalk_corrected`

    Args:
        min_position: The minimum value of the position to filter on.
        max_position: The maximum value of the position to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        List of Timeseries sensor_position.flapwise_bend_mom_crosstalk_corrected.

    Examples:

        List sensor_position.flapwise_bend_mom_crosstalk_corrected and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> sensor_positions = client.sensor_position.flapwise_bend_mom_crosstalk_corrected.list(limit=5)

    """
    filter_ = _create_sensor_position_filter(
        self._view_id,
        min_position,
        max_position,
        external_id_prefix,
        space,
        filter,
    )
    external_ids = _retrieve_timeseries_external_ids_with_extra_flapwise_bend_mom_crosstalk_corrected(
        self._client, self._view_id, filter_, limit
    )
    if external_ids:
        return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
    else:
        return TimeSeriesList([])

SensorPositionFlapwiseBendMomOffsetAPI

Source code in examples/windmill/_api/sensor_position_flapwise_bend_mom_offset.py
class SensorPositionFlapwiseBendMomOffsetAPI:
    def __init__(self, client: CogniteClient, view_id: dm.ViewId):
        self._client = client
        self._view_id = view_id

    def __call__(
        self,
        min_position: float | None = None,
        max_position: float | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> SensorPositionFlapwiseBendMomOffsetQuery:
        """Query timeseries `sensor_position.flapwise_bend_mom_offset`

        Args:
            min_position: The minimum value of the position to filter on.
            max_position: The maximum value of the position to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query object that can be used to retrieve datapoins for the sensor_position.flapwise_bend_mom_offset timeseries
            selected in this method.

        Examples:

            Retrieve all data for 5 sensor_position.flapwise_bend_mom_offset timeseries:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> sensor_positions = client.sensor_position.flapwise_bend_mom_offset(limit=5).retrieve()

        """
        filter_ = _create_sensor_position_filter(
            self._view_id,
            min_position,
            max_position,
            external_id_prefix,
            space,
            filter,
        )

        return SensorPositionFlapwiseBendMomOffsetQuery(
            client=self._client,
            view_id=self._view_id,
            timeseries_limit=limit,
            filter=filter_,
        )

    def list(
        self,
        min_position: float | None = None,
        max_position: float | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> TimeSeriesList:
        """List timeseries `sensor_position.flapwise_bend_mom_offset`

        Args:
            min_position: The minimum value of the position to filter on.
            max_position: The maximum value of the position to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            List of Timeseries sensor_position.flapwise_bend_mom_offset.

        Examples:

            List sensor_position.flapwise_bend_mom_offset and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> sensor_positions = client.sensor_position.flapwise_bend_mom_offset.list(limit=5)

        """
        filter_ = _create_sensor_position_filter(
            self._view_id,
            min_position,
            max_position,
            external_id_prefix,
            space,
            filter,
        )
        external_ids = _retrieve_timeseries_external_ids_with_extra_flapwise_bend_mom_offset(
            self._client, self._view_id, filter_, limit
        )
        if external_ids:
            return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
        else:
            return TimeSeriesList([])

__call__(min_position=None, max_position=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Query timeseries sensor_position.flapwise_bend_mom_offset

Parameters:

Name Type Description Default
min_position float | None

The minimum value of the position to filter on.

None
max_position float | None

The maximum value of the position to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
SensorPositionFlapwiseBendMomOffsetQuery

A query object that can be used to retrieve datapoins for the sensor_position.flapwise_bend_mom_offset timeseries

SensorPositionFlapwiseBendMomOffsetQuery

selected in this method.

Examples:

Retrieve all data for 5 sensor_position.flapwise_bend_mom_offset timeseries:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> sensor_positions = client.sensor_position.flapwise_bend_mom_offset(limit=5).retrieve()
Source code in examples/windmill/_api/sensor_position_flapwise_bend_mom_offset.py
def __call__(
    self,
    min_position: float | None = None,
    max_position: float | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> SensorPositionFlapwiseBendMomOffsetQuery:
    """Query timeseries `sensor_position.flapwise_bend_mom_offset`

    Args:
        min_position: The minimum value of the position to filter on.
        max_position: The maximum value of the position to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query object that can be used to retrieve datapoins for the sensor_position.flapwise_bend_mom_offset timeseries
        selected in this method.

    Examples:

        Retrieve all data for 5 sensor_position.flapwise_bend_mom_offset timeseries:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> sensor_positions = client.sensor_position.flapwise_bend_mom_offset(limit=5).retrieve()

    """
    filter_ = _create_sensor_position_filter(
        self._view_id,
        min_position,
        max_position,
        external_id_prefix,
        space,
        filter,
    )

    return SensorPositionFlapwiseBendMomOffsetQuery(
        client=self._client,
        view_id=self._view_id,
        timeseries_limit=limit,
        filter=filter_,
    )

list(min_position=None, max_position=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

List timeseries sensor_position.flapwise_bend_mom_offset

Parameters:

Name Type Description Default
min_position float | None

The minimum value of the position to filter on.

None
max_position float | None

The maximum value of the position to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
TimeSeriesList

List of Timeseries sensor_position.flapwise_bend_mom_offset.

Examples:

List sensor_position.flapwise_bend_mom_offset and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> sensor_positions = client.sensor_position.flapwise_bend_mom_offset.list(limit=5)
Source code in examples/windmill/_api/sensor_position_flapwise_bend_mom_offset.py
def list(
    self,
    min_position: float | None = None,
    max_position: float | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> TimeSeriesList:
    """List timeseries `sensor_position.flapwise_bend_mom_offset`

    Args:
        min_position: The minimum value of the position to filter on.
        max_position: The maximum value of the position to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        List of Timeseries sensor_position.flapwise_bend_mom_offset.

    Examples:

        List sensor_position.flapwise_bend_mom_offset and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> sensor_positions = client.sensor_position.flapwise_bend_mom_offset.list(limit=5)

    """
    filter_ = _create_sensor_position_filter(
        self._view_id,
        min_position,
        max_position,
        external_id_prefix,
        space,
        filter,
    )
    external_ids = _retrieve_timeseries_external_ids_with_extra_flapwise_bend_mom_offset(
        self._client, self._view_id, filter_, limit
    )
    if external_ids:
        return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
    else:
        return TimeSeriesList([])

SensorPositionFlapwiseBendMomOffsetCrosstalkCorrectedAPI

Source code in examples/windmill/_api/sensor_position_flapwise_bend_mom_offset_crosstalk_corrected.py
class SensorPositionFlapwiseBendMomOffsetCrosstalkCorrectedAPI:
    def __init__(self, client: CogniteClient, view_id: dm.ViewId):
        self._client = client
        self._view_id = view_id

    def __call__(
        self,
        min_position: float | None = None,
        max_position: float | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> SensorPositionFlapwiseBendMomOffsetCrosstalkCorrectedQuery:
        """Query timeseries `sensor_position.flapwise_bend_mom_offset_crosstalk_corrected`

        Args:
            min_position: The minimum value of the position to filter on.
            max_position: The maximum value of the position to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query object that can be used to retrieve datapoins for the sensor_position.flapwise_bend_mom_offset_crosstalk_corrected timeseries
            selected in this method.

        Examples:

            Retrieve all data for 5 sensor_position.flapwise_bend_mom_offset_crosstalk_corrected timeseries:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> sensor_positions = client.sensor_position.flapwise_bend_mom_offset_crosstalk_corrected(limit=5).retrieve()

        """
        filter_ = _create_sensor_position_filter(
            self._view_id,
            min_position,
            max_position,
            external_id_prefix,
            space,
            filter,
        )

        return SensorPositionFlapwiseBendMomOffsetCrosstalkCorrectedQuery(
            client=self._client,
            view_id=self._view_id,
            timeseries_limit=limit,
            filter=filter_,
        )

    def list(
        self,
        min_position: float | None = None,
        max_position: float | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> TimeSeriesList:
        """List timeseries `sensor_position.flapwise_bend_mom_offset_crosstalk_corrected`

        Args:
            min_position: The minimum value of the position to filter on.
            max_position: The maximum value of the position to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            List of Timeseries sensor_position.flapwise_bend_mom_offset_crosstalk_corrected.

        Examples:

            List sensor_position.flapwise_bend_mom_offset_crosstalk_corrected and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> sensor_positions = client.sensor_position.flapwise_bend_mom_offset_crosstalk_corrected.list(limit=5)

        """
        filter_ = _create_sensor_position_filter(
            self._view_id,
            min_position,
            max_position,
            external_id_prefix,
            space,
            filter,
        )
        external_ids = _retrieve_timeseries_external_ids_with_extra_flapwise_bend_mom_offset_crosstalk_corrected(
            self._client, self._view_id, filter_, limit
        )
        if external_ids:
            return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
        else:
            return TimeSeriesList([])

__call__(min_position=None, max_position=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Query timeseries sensor_position.flapwise_bend_mom_offset_crosstalk_corrected

Parameters:

Name Type Description Default
min_position float | None

The minimum value of the position to filter on.

None
max_position float | None

The maximum value of the position to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
SensorPositionFlapwiseBendMomOffsetCrosstalkCorrectedQuery

A query object that can be used to retrieve datapoins for the sensor_position.flapwise_bend_mom_offset_crosstalk_corrected timeseries

SensorPositionFlapwiseBendMomOffsetCrosstalkCorrectedQuery

selected in this method.

Examples:

Retrieve all data for 5 sensor_position.flapwise_bend_mom_offset_crosstalk_corrected timeseries:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> sensor_positions = client.sensor_position.flapwise_bend_mom_offset_crosstalk_corrected(limit=5).retrieve()
Source code in examples/windmill/_api/sensor_position_flapwise_bend_mom_offset_crosstalk_corrected.py
def __call__(
    self,
    min_position: float | None = None,
    max_position: float | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> SensorPositionFlapwiseBendMomOffsetCrosstalkCorrectedQuery:
    """Query timeseries `sensor_position.flapwise_bend_mom_offset_crosstalk_corrected`

    Args:
        min_position: The minimum value of the position to filter on.
        max_position: The maximum value of the position to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query object that can be used to retrieve datapoins for the sensor_position.flapwise_bend_mom_offset_crosstalk_corrected timeseries
        selected in this method.

    Examples:

        Retrieve all data for 5 sensor_position.flapwise_bend_mom_offset_crosstalk_corrected timeseries:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> sensor_positions = client.sensor_position.flapwise_bend_mom_offset_crosstalk_corrected(limit=5).retrieve()

    """
    filter_ = _create_sensor_position_filter(
        self._view_id,
        min_position,
        max_position,
        external_id_prefix,
        space,
        filter,
    )

    return SensorPositionFlapwiseBendMomOffsetCrosstalkCorrectedQuery(
        client=self._client,
        view_id=self._view_id,
        timeseries_limit=limit,
        filter=filter_,
    )

list(min_position=None, max_position=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

List timeseries sensor_position.flapwise_bend_mom_offset_crosstalk_corrected

Parameters:

Name Type Description Default
min_position float | None

The minimum value of the position to filter on.

None
max_position float | None

The maximum value of the position to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
TimeSeriesList

List of Timeseries sensor_position.flapwise_bend_mom_offset_crosstalk_corrected.

Examples:

List sensor_position.flapwise_bend_mom_offset_crosstalk_corrected and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> sensor_positions = client.sensor_position.flapwise_bend_mom_offset_crosstalk_corrected.list(limit=5)
Source code in examples/windmill/_api/sensor_position_flapwise_bend_mom_offset_crosstalk_corrected.py
def list(
    self,
    min_position: float | None = None,
    max_position: float | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> TimeSeriesList:
    """List timeseries `sensor_position.flapwise_bend_mom_offset_crosstalk_corrected`

    Args:
        min_position: The minimum value of the position to filter on.
        max_position: The maximum value of the position to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of sensor positions to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        List of Timeseries sensor_position.flapwise_bend_mom_offset_crosstalk_corrected.

    Examples:

        List sensor_position.flapwise_bend_mom_offset_crosstalk_corrected and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> sensor_positions = client.sensor_position.flapwise_bend_mom_offset_crosstalk_corrected.list(limit=5)

    """
    filter_ = _create_sensor_position_filter(
        self._view_id,
        min_position,
        max_position,
        external_id_prefix,
        space,
        filter,
    )
    external_ids = _retrieve_timeseries_external_ids_with_extra_flapwise_bend_mom_offset_crosstalk_corrected(
        self._client, self._view_id, filter_, limit
    )
    if external_ids:
        return self._client.time_series.retrieve_multiple(external_ids=list(external_ids))
    else:
        return TimeSeriesList([])

SensorPositionQueryAPI

Bases: QueryAPI[T_DomainModelList]

Source code in examples/windmill/_api/sensor_position_query.py
class SensorPositionQueryAPI(QueryAPI[T_DomainModelList]):
    _view_id = dm.ViewId("power-models", "SensorPosition", "1")

    def __init__(
        self,
        client: CogniteClient,
        builder: QueryBuilder[T_DomainModelList],
        filter_: dm.filters.Filter | None = None,
        limit: int = DEFAULT_QUERY_LIMIT,
    ):
        super().__init__(client, builder)
        from_ = self._builder.get_from()
        self._builder.append(
            NodeQueryStep(
                name=self._builder.create_name(from_),
                expression=dm.query.NodeResultSetExpression(
                    from_=from_,
                    filter=filter_,
                ),
                result_cls=SensorPosition,
                max_retrieve_limit=limit,
            )
        )

    def query(
        self,
    ) -> T_DomainModelList:
        """Execute query and return the result.

        Returns:
            The list of the source nodes of the query.

        """
        return self._query()

query()

Execute query and return the result.

Returns:

Type Description
T_DomainModelList

The list of the source nodes of the query.

Source code in examples/windmill/_api/sensor_position_query.py
def query(
    self,
) -> T_DomainModelList:
    """Execute query and return the result.

    Returns:
        The list of the source nodes of the query.

    """
    return self._query()

WindmillAPI

Bases: NodeAPI[Windmill, WindmillWrite, WindmillList, WindmillWriteList]

Source code in examples/windmill/_api/windmill.py
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
class WindmillAPI(NodeAPI[Windmill, WindmillWrite, WindmillList, WindmillWriteList]):
    _view_id = dm.ViewId("power-models", "Windmill", "1")
    _properties_by_field = _WINDMILL_PROPERTIES_BY_FIELD
    _class_type = Windmill
    _class_list = WindmillList
    _class_write_list = WindmillWriteList

    def __init__(self, client: CogniteClient):
        super().__init__(client=client)

        self.blades_edge = WindmillBladesAPI(client)
        self.metmast_edge = WindmillMetmastAPI(client)

    def __call__(
        self,
        min_capacity: float | None = None,
        max_capacity: float | None = None,
        nacelle: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        name: str | list[str] | None = None,
        name_prefix: str | None = None,
        rotor: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        windfarm: str | list[str] | None = None,
        windfarm_prefix: str | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_QUERY_LIMIT,
        filter: dm.Filter | None = None,
    ) -> WindmillQueryAPI[WindmillList]:
        """Query starting at windmills.

        Args:
            min_capacity: The minimum value of the capacity to filter on.
            max_capacity: The maximum value of the capacity to filter on.
            nacelle: The nacelle to filter on.
            name: The name to filter on.
            name_prefix: The prefix of the name to filter on.
            rotor: The rotor to filter on.
            windfarm: The windfarm to filter on.
            windfarm_prefix: The prefix of the windfarm to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of windmills to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            A query API for windmills.

        """
        has_data = dm.filters.HasData(views=[self._view_id])
        filter_ = _create_windmill_filter(
            self._view_id,
            min_capacity,
            max_capacity,
            nacelle,
            name,
            name_prefix,
            rotor,
            windfarm,
            windfarm_prefix,
            external_id_prefix,
            space,
            (filter and dm.filters.And(filter, has_data)) or has_data,
        )
        builder = QueryBuilder(WindmillList)
        return WindmillQueryAPI(self._client, builder, filter_, limit)

    def apply(
        self,
        windmill: WindmillWrite | Sequence[WindmillWrite],
        replace: bool = False,
        write_none: bool = False,
    ) -> ResourcesWriteResult:
        """Add or update (upsert) windmills.

        Note: This method iterates through all nodes and timeseries linked to windmill and creates them including the edges
        between the nodes. For example, if any of `blades`, `metmast`, `nacelle` or `rotor` are set, then these
        nodes as well as any nodes linked to them, and all the edges linking these nodes will be created.

        Args:
            windmill: Windmill or sequence of windmills to upsert.
            replace (bool): How do we behave when a property value exists? Do we replace all matching and existing values with the supplied values (true)?
                Or should we merge in new values for properties together with the existing values (false)? Note: This setting applies for all nodes or edges specified in the ingestion call.
            write_none (bool): This method, will by default, skip properties that are set to None. However, if you want to set properties to None,
                you can set this parameter to True. Note this only applies to properties that are nullable.
        Returns:
            Created instance(s), i.e., nodes, edges, and time series.

        Examples:

            Create a new windmill:

                >>> from windmill import WindmillClient
                >>> from windmill.data_classes import WindmillWrite
                >>> client = WindmillClient()
                >>> windmill = WindmillWrite(external_id="my_windmill", ...)
                >>> result = client.windmill.apply(windmill)

        """
        warnings.warn(
            "The .apply method is deprecated and will be removed in v1.0. "
            "Please use the .upsert method on the client instead. This means instead of "
            "`my_client.windmill.apply(my_items)` please use `my_client.upsert(my_items)`."
            "The motivation is that all apply methods are the same, and having one apply method per API "
            " class encourages users to create items in small batches, which is inefficient."
            "In addition, .upsert method is more descriptive of what the method does.",
            UserWarning,
            stacklevel=2,
        )
        return self._apply(windmill, replace, write_none)

    def delete(
        self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
    ) -> dm.InstancesDeleteResult:
        """Delete one or more windmill.

        Args:
            external_id: External id of the windmill to delete.
            space: The space where all the windmill are located.

        Returns:
            The instance(s), i.e., nodes and edges which has been deleted. Empty list if nothing was deleted.

        Examples:

            Delete windmill by id:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> client.windmill.delete("my_windmill")
        """
        warnings.warn(
            "The .delete method is deprecated and will be removed in v1.0. "
            "Please use the .delete method on the client instead. This means instead of "
            "`my_client.windmill.delete(my_ids)` please use `my_client.delete(my_ids)`."
            "The motivation is that all delete methods are the same, and having one delete method per API "
            " class encourages users to delete items in small batches, which is inefficient.",
            UserWarning,
            stacklevel=2,
        )
        return self._delete(external_id, space)

    @overload
    def retrieve(self, external_id: str, space: str = DEFAULT_INSTANCE_SPACE) -> Windmill | None: ...

    @overload
    def retrieve(self, external_id: SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE) -> WindmillList: ...

    def retrieve(
        self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
    ) -> Windmill | WindmillList | None:
        """Retrieve one or more windmills by id(s).

        Args:
            external_id: External id or list of external ids of the windmills.
            space: The space where all the windmills are located.

        Returns:
            The requested windmills.

        Examples:

            Retrieve windmill by id:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> windmill = client.windmill.retrieve("my_windmill")

        """
        return self._retrieve(
            external_id,
            space,
            retrieve_edges=True,
            edge_api_name_type_direction_view_id_penta=[
                (
                    self.blades_edge,
                    "blades",
                    dm.DirectRelationReference("power-models", "Windmill.blades"),
                    "outwards",
                    dm.ViewId("power-models", "Blade", "1"),
                ),
                (
                    self.metmast_edge,
                    "metmast",
                    dm.DirectRelationReference("power-models", "Windmill.metmast"),
                    "outwards",
                    dm.ViewId("power-models", "Metmast", "1"),
                ),
            ],
        )

    def search(
        self,
        query: str,
        properties: WindmillTextFields | SequenceNotStr[WindmillTextFields] | None = None,
        min_capacity: float | None = None,
        max_capacity: float | None = None,
        nacelle: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        name: str | list[str] | None = None,
        name_prefix: str | None = None,
        rotor: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        windfarm: str | list[str] | None = None,
        windfarm_prefix: str | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
        sort_by: WindmillFields | SequenceNotStr[WindmillFields] | None = None,
        direction: Literal["ascending", "descending"] = "ascending",
        sort: InstanceSort | list[InstanceSort] | None = None,
    ) -> WindmillList:
        """Search windmills

        Args:
            query: The search query,
            properties: The property to search, if nothing is passed all text fields will be searched.
            min_capacity: The minimum value of the capacity to filter on.
            max_capacity: The maximum value of the capacity to filter on.
            nacelle: The nacelle to filter on.
            name: The name to filter on.
            name_prefix: The prefix of the name to filter on.
            rotor: The rotor to filter on.
            windfarm: The windfarm to filter on.
            windfarm_prefix: The prefix of the windfarm to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of windmills to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
            sort_by: The property to sort by.
            direction: The direction to sort by, either 'ascending' or 'descending'.
            sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
                This will override the sort_by and direction. This allowos you to sort by multiple fields and
                specify the direction for each field as well as how to handle null values.

        Returns:
            Search results windmills matching the query.

        Examples:

           Search for 'my_windmill' in all text properties:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> windmills = client.windmill.search('my_windmill')

        """
        filter_ = _create_windmill_filter(
            self._view_id,
            min_capacity,
            max_capacity,
            nacelle,
            name,
            name_prefix,
            rotor,
            windfarm,
            windfarm_prefix,
            external_id_prefix,
            space,
            filter,
        )
        return self._search(
            query=query,
            properties=properties,
            filter_=filter_,
            limit=limit,
            sort_by=sort_by,  # type: ignore[arg-type]
            direction=direction,
            sort=sort,
        )

    @overload
    def aggregate(
        self,
        aggregate: Aggregations | dm.aggregations.MetricAggregation,
        group_by: None = None,
        property: WindmillFields | SequenceNotStr[WindmillFields] | None = None,
        query: str | None = None,
        search_property: WindmillTextFields | SequenceNotStr[WindmillTextFields] | None = None,
        min_capacity: float | None = None,
        max_capacity: float | None = None,
        nacelle: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        name: str | list[str] | None = None,
        name_prefix: str | None = None,
        rotor: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        windfarm: str | list[str] | None = None,
        windfarm_prefix: str | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> dm.aggregations.AggregatedNumberedValue: ...

    @overload
    def aggregate(
        self,
        aggregate: SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation],
        group_by: None = None,
        property: WindmillFields | SequenceNotStr[WindmillFields] | None = None,
        query: str | None = None,
        search_property: WindmillTextFields | SequenceNotStr[WindmillTextFields] | None = None,
        min_capacity: float | None = None,
        max_capacity: float | None = None,
        nacelle: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        name: str | list[str] | None = None,
        name_prefix: str | None = None,
        rotor: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        windfarm: str | list[str] | None = None,
        windfarm_prefix: str | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> list[dm.aggregations.AggregatedNumberedValue]: ...

    @overload
    def aggregate(
        self,
        aggregate: (
            Aggregations
            | dm.aggregations.MetricAggregation
            | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation]
        ),
        group_by: WindmillFields | SequenceNotStr[WindmillFields],
        property: WindmillFields | SequenceNotStr[WindmillFields] | None = None,
        query: str | None = None,
        search_property: WindmillTextFields | SequenceNotStr[WindmillTextFields] | None = None,
        min_capacity: float | None = None,
        max_capacity: float | None = None,
        nacelle: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        name: str | list[str] | None = None,
        name_prefix: str | None = None,
        rotor: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        windfarm: str | list[str] | None = None,
        windfarm_prefix: str | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> InstanceAggregationResultList: ...

    def aggregate(
        self,
        aggregate: (
            Aggregations
            | dm.aggregations.MetricAggregation
            | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation]
        ),
        group_by: WindmillFields | SequenceNotStr[WindmillFields] | None = None,
        property: WindmillFields | SequenceNotStr[WindmillFields] | None = None,
        query: str | None = None,
        search_property: WindmillTextFields | SequenceNotStr[WindmillTextFields] | None = None,
        min_capacity: float | None = None,
        max_capacity: float | None = None,
        nacelle: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        name: str | list[str] | None = None,
        name_prefix: str | None = None,
        rotor: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        windfarm: str | list[str] | None = None,
        windfarm_prefix: str | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> (
        dm.aggregations.AggregatedNumberedValue
        | list[dm.aggregations.AggregatedNumberedValue]
        | InstanceAggregationResultList
    ):
        """Aggregate data across windmills

        Args:
            aggregate: The aggregation to perform.
            group_by: The property to group by when doing the aggregation.
            property: The property to perform aggregation on.
            query: The query to search for in the text field.
            search_property: The text field to search in.
            min_capacity: The minimum value of the capacity to filter on.
            max_capacity: The maximum value of the capacity to filter on.
            nacelle: The nacelle to filter on.
            name: The name to filter on.
            name_prefix: The prefix of the name to filter on.
            rotor: The rotor to filter on.
            windfarm: The windfarm to filter on.
            windfarm_prefix: The prefix of the windfarm to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of windmills to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            Aggregation results.

        Examples:

            Count windmills in space `my_space`:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> result = client.windmill.aggregate("count", space="my_space")

        """

        filter_ = _create_windmill_filter(
            self._view_id,
            min_capacity,
            max_capacity,
            nacelle,
            name,
            name_prefix,
            rotor,
            windfarm,
            windfarm_prefix,
            external_id_prefix,
            space,
            filter,
        )
        return self._aggregate(
            aggregate=aggregate,
            group_by=group_by,  # type: ignore[arg-type]
            properties=property,  # type: ignore[arg-type]
            query=query,
            search_properties=search_property,  # type: ignore[arg-type]
            limit=limit,
            filter=filter_,
        )

    def histogram(
        self,
        property: WindmillFields,
        interval: float,
        query: str | None = None,
        search_property: WindmillTextFields | SequenceNotStr[WindmillTextFields] | None = None,
        min_capacity: float | None = None,
        max_capacity: float | None = None,
        nacelle: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        name: str | list[str] | None = None,
        name_prefix: str | None = None,
        rotor: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        windfarm: str | list[str] | None = None,
        windfarm_prefix: str | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
    ) -> dm.aggregations.HistogramValue:
        """Produces histograms for windmills

        Args:
            property: The property to use as the value in the histogram.
            interval: The interval to use for the histogram bins.
            query: The query to search for in the text field.
            search_property: The text field to search in.
            min_capacity: The minimum value of the capacity to filter on.
            max_capacity: The maximum value of the capacity to filter on.
            nacelle: The nacelle to filter on.
            name: The name to filter on.
            name_prefix: The prefix of the name to filter on.
            rotor: The rotor to filter on.
            windfarm: The windfarm to filter on.
            windfarm_prefix: The prefix of the windfarm to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of windmills to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

        Returns:
            Bucketed histogram results.

        """
        filter_ = _create_windmill_filter(
            self._view_id,
            min_capacity,
            max_capacity,
            nacelle,
            name,
            name_prefix,
            rotor,
            windfarm,
            windfarm_prefix,
            external_id_prefix,
            space,
            filter,
        )
        return self._histogram(
            property,
            interval,
            query,
            search_property,  # type: ignore[arg-type]
            limit,
            filter_,
        )

    def query(self) -> WindmillQuery:
        """Start a query for windmills."""
        warnings.warn("The .query is in alpha and is subject to breaking changes without notice.")
        return WindmillQuery(self._client)

    def list(
        self,
        min_capacity: float | None = None,
        max_capacity: float | None = None,
        nacelle: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        name: str | list[str] | None = None,
        name_prefix: str | None = None,
        rotor: (
            str
            | tuple[str, str]
            | dm.NodeId
            | dm.DirectRelationReference
            | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
            | None
        ) = None,
        windfarm: str | list[str] | None = None,
        windfarm_prefix: str | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit: int = DEFAULT_LIMIT_READ,
        filter: dm.Filter | None = None,
        sort_by: WindmillFields | Sequence[WindmillFields] | None = None,
        direction: Literal["ascending", "descending"] = "ascending",
        sort: InstanceSort | list[InstanceSort] | None = None,
        retrieve_connections: Literal["skip", "identifier", "full"] = "skip",
    ) -> WindmillList:
        """List/filter windmills

        Args:
            min_capacity: The minimum value of the capacity to filter on.
            max_capacity: The maximum value of the capacity to filter on.
            nacelle: The nacelle to filter on.
            name: The name to filter on.
            name_prefix: The prefix of the name to filter on.
            rotor: The rotor to filter on.
            windfarm: The windfarm to filter on.
            windfarm_prefix: The prefix of the windfarm to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of windmills to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
            filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
            sort_by: The property to sort by.
            direction: The direction to sort by, either 'ascending' or 'descending'.
            sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
                This will override the sort_by and direction. This allowos you to sort by multiple fields and
                specify the direction for each field as well as how to handle null values.
            retrieve_connections: Whether to retrieve `blades`, `metmast`, `nacelle` and `rotor` for the windmills. Defaults to 'skip'.
                'skip' will not retrieve any connections, 'identifier' will only retrieve the identifier of the connected items, and 'full' will retrieve the full connected items.

        Returns:
            List of requested windmills

        Examples:

            List windmills and limit to 5:

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> windmills = client.windmill.list(limit=5)

        """
        filter_ = _create_windmill_filter(
            self._view_id,
            min_capacity,
            max_capacity,
            nacelle,
            name,
            name_prefix,
            rotor,
            windfarm,
            windfarm_prefix,
            external_id_prefix,
            space,
            filter,
        )

        if retrieve_connections == "skip":
            return self._list(
                limit=limit,
                filter=filter_,
                sort_by=sort_by,  # type: ignore[arg-type]
                direction=direction,
                sort=sort,
            )

        builder = QueryBuilder(WindmillList)
        has_data = dm.filters.HasData(views=[self._view_id])
        builder.append(
            NodeQueryStep(
                builder.create_name(None),
                dm.query.NodeResultSetExpression(
                    filter=dm.filters.And(filter_, has_data) if filter_ else has_data,
                    sort=self._create_sort(sort_by, direction, sort),  # type: ignore[arg-type]
                ),
                Windmill,
                max_retrieve_limit=limit,
            )
        )
        from_root = builder.get_from()
        edge_blades = builder.create_name(from_root)
        builder.append(
            EdgeQueryStep(
                edge_blades,
                dm.query.EdgeResultSetExpression(
                    from_=from_root,
                    direction="outwards",
                    chain_to="destination",
                ),
            )
        )
        edge_metmast = builder.create_name(from_root)
        builder.append(
            EdgeQueryStep(
                edge_metmast,
                dm.query.EdgeResultSetExpression(
                    from_=from_root,
                    direction="outwards",
                    chain_to="destination",
                ),
            )
        )
        if retrieve_connections == "full":
            builder.append(
                NodeQueryStep(
                    builder.create_name(edge_blades),
                    dm.query.NodeResultSetExpression(
                        from_=edge_blades,
                        filter=dm.filters.HasData(views=[Blade._view_id]),
                    ),
                    Blade,
                )
            )
            builder.append(
                NodeQueryStep(
                    builder.create_name(edge_metmast),
                    dm.query.NodeResultSetExpression(
                        from_=edge_metmast,
                        filter=dm.filters.HasData(views=[Metmast._view_id]),
                    ),
                    Metmast,
                )
            )
            builder.append(
                NodeQueryStep(
                    builder.create_name(from_root),
                    dm.query.NodeResultSetExpression(
                        from_=from_root,
                        filter=dm.filters.HasData(views=[Nacelle._view_id]),
                        direction="outwards",
                        through=self._view_id.as_property_ref("nacelle"),
                    ),
                    Nacelle,
                )
            )
            builder.append(
                NodeQueryStep(
                    builder.create_name(from_root),
                    dm.query.NodeResultSetExpression(
                        from_=from_root,
                        filter=dm.filters.HasData(views=[Rotor._view_id]),
                        direction="outwards",
                        through=self._view_id.as_property_ref("rotor"),
                    ),
                    Rotor,
                )
            )

        return builder.execute(self._client)

__call__(min_capacity=None, max_capacity=None, nacelle=None, name=None, name_prefix=None, rotor=None, windfarm=None, windfarm_prefix=None, external_id_prefix=None, space=None, limit=DEFAULT_QUERY_LIMIT, filter=None)

Query starting at windmills.

Parameters:

Name Type Description Default
min_capacity float | None

The minimum value of the capacity to filter on.

None
max_capacity float | None

The maximum value of the capacity to filter on.

None
nacelle str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The nacelle to filter on.

None
name str | list[str] | None

The name to filter on.

None
name_prefix str | None

The prefix of the name to filter on.

None
rotor str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The rotor to filter on.

None
windfarm str | list[str] | None

The windfarm to filter on.

None
windfarm_prefix str | None

The prefix of the windfarm to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of windmills to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_QUERY_LIMIT
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
WindmillQueryAPI[WindmillList]

A query API for windmills.

Source code in examples/windmill/_api/windmill.py
def __call__(
    self,
    min_capacity: float | None = None,
    max_capacity: float | None = None,
    nacelle: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    name: str | list[str] | None = None,
    name_prefix: str | None = None,
    rotor: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    windfarm: str | list[str] | None = None,
    windfarm_prefix: str | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_QUERY_LIMIT,
    filter: dm.Filter | None = None,
) -> WindmillQueryAPI[WindmillList]:
    """Query starting at windmills.

    Args:
        min_capacity: The minimum value of the capacity to filter on.
        max_capacity: The maximum value of the capacity to filter on.
        nacelle: The nacelle to filter on.
        name: The name to filter on.
        name_prefix: The prefix of the name to filter on.
        rotor: The rotor to filter on.
        windfarm: The windfarm to filter on.
        windfarm_prefix: The prefix of the windfarm to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of windmills to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        A query API for windmills.

    """
    has_data = dm.filters.HasData(views=[self._view_id])
    filter_ = _create_windmill_filter(
        self._view_id,
        min_capacity,
        max_capacity,
        nacelle,
        name,
        name_prefix,
        rotor,
        windfarm,
        windfarm_prefix,
        external_id_prefix,
        space,
        (filter and dm.filters.And(filter, has_data)) or has_data,
    )
    builder = QueryBuilder(WindmillList)
    return WindmillQueryAPI(self._client, builder, filter_, limit)

aggregate(aggregate, group_by=None, property=None, query=None, search_property=None, min_capacity=None, max_capacity=None, nacelle=None, name=None, name_prefix=None, rotor=None, windfarm=None, windfarm_prefix=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

aggregate(aggregate: Aggregations | dm.aggregations.MetricAggregation, group_by: None = None, property: WindmillFields | SequenceNotStr[WindmillFields] | None = None, query: str | None = None, search_property: WindmillTextFields | SequenceNotStr[WindmillTextFields] | None = None, min_capacity: float | None = None, max_capacity: float | None = None, nacelle: str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference] | None = None, name: str | list[str] | None = None, name_prefix: str | None = None, rotor: str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference] | None = None, windfarm: str | list[str] | None = None, windfarm_prefix: str | None = None, external_id_prefix: str | None = None, space: str | list[str] | None = None, limit: int = DEFAULT_LIMIT_READ, filter: dm.Filter | None = None) -> dm.aggregations.AggregatedNumberedValue
aggregate(aggregate: SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation], group_by: None = None, property: WindmillFields | SequenceNotStr[WindmillFields] | None = None, query: str | None = None, search_property: WindmillTextFields | SequenceNotStr[WindmillTextFields] | None = None, min_capacity: float | None = None, max_capacity: float | None = None, nacelle: str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference] | None = None, name: str | list[str] | None = None, name_prefix: str | None = None, rotor: str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference] | None = None, windfarm: str | list[str] | None = None, windfarm_prefix: str | None = None, external_id_prefix: str | None = None, space: str | list[str] | None = None, limit: int = DEFAULT_LIMIT_READ, filter: dm.Filter | None = None) -> list[dm.aggregations.AggregatedNumberedValue]
aggregate(aggregate: Aggregations | dm.aggregations.MetricAggregation | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation], group_by: WindmillFields | SequenceNotStr[WindmillFields], property: WindmillFields | SequenceNotStr[WindmillFields] | None = None, query: str | None = None, search_property: WindmillTextFields | SequenceNotStr[WindmillTextFields] | None = None, min_capacity: float | None = None, max_capacity: float | None = None, nacelle: str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference] | None = None, name: str | list[str] | None = None, name_prefix: str | None = None, rotor: str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference] | None = None, windfarm: str | list[str] | None = None, windfarm_prefix: str | None = None, external_id_prefix: str | None = None, space: str | list[str] | None = None, limit: int = DEFAULT_LIMIT_READ, filter: dm.Filter | None = None) -> InstanceAggregationResultList

Aggregate data across windmills

Parameters:

Name Type Description Default
aggregate Aggregations | MetricAggregation | SequenceNotStr[Aggregations | MetricAggregation]

The aggregation to perform.

required
group_by WindmillFields | SequenceNotStr[WindmillFields] | None

The property to group by when doing the aggregation.

None
property WindmillFields | SequenceNotStr[WindmillFields] | None

The property to perform aggregation on.

None
query str | None

The query to search for in the text field.

None
search_property WindmillTextFields | SequenceNotStr[WindmillTextFields] | None

The text field to search in.

None
min_capacity float | None

The minimum value of the capacity to filter on.

None
max_capacity float | None

The maximum value of the capacity to filter on.

None
nacelle str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The nacelle to filter on.

None
name str | list[str] | None

The name to filter on.

None
name_prefix str | None

The prefix of the name to filter on.

None
rotor str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The rotor to filter on.

None
windfarm str | list[str] | None

The windfarm to filter on.

None
windfarm_prefix str | None

The prefix of the windfarm to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of windmills to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
AggregatedNumberedValue | list[AggregatedNumberedValue] | InstanceAggregationResultList

Aggregation results.

Examples:

Count windmills in space `my_space`:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> result = client.windmill.aggregate("count", space="my_space")
Source code in examples/windmill/_api/windmill.py
def aggregate(
    self,
    aggregate: (
        Aggregations
        | dm.aggregations.MetricAggregation
        | SequenceNotStr[Aggregations | dm.aggregations.MetricAggregation]
    ),
    group_by: WindmillFields | SequenceNotStr[WindmillFields] | None = None,
    property: WindmillFields | SequenceNotStr[WindmillFields] | None = None,
    query: str | None = None,
    search_property: WindmillTextFields | SequenceNotStr[WindmillTextFields] | None = None,
    min_capacity: float | None = None,
    max_capacity: float | None = None,
    nacelle: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    name: str | list[str] | None = None,
    name_prefix: str | None = None,
    rotor: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    windfarm: str | list[str] | None = None,
    windfarm_prefix: str | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> (
    dm.aggregations.AggregatedNumberedValue
    | list[dm.aggregations.AggregatedNumberedValue]
    | InstanceAggregationResultList
):
    """Aggregate data across windmills

    Args:
        aggregate: The aggregation to perform.
        group_by: The property to group by when doing the aggregation.
        property: The property to perform aggregation on.
        query: The query to search for in the text field.
        search_property: The text field to search in.
        min_capacity: The minimum value of the capacity to filter on.
        max_capacity: The maximum value of the capacity to filter on.
        nacelle: The nacelle to filter on.
        name: The name to filter on.
        name_prefix: The prefix of the name to filter on.
        rotor: The rotor to filter on.
        windfarm: The windfarm to filter on.
        windfarm_prefix: The prefix of the windfarm to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of windmills to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        Aggregation results.

    Examples:

        Count windmills in space `my_space`:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> result = client.windmill.aggregate("count", space="my_space")

    """

    filter_ = _create_windmill_filter(
        self._view_id,
        min_capacity,
        max_capacity,
        nacelle,
        name,
        name_prefix,
        rotor,
        windfarm,
        windfarm_prefix,
        external_id_prefix,
        space,
        filter,
    )
    return self._aggregate(
        aggregate=aggregate,
        group_by=group_by,  # type: ignore[arg-type]
        properties=property,  # type: ignore[arg-type]
        query=query,
        search_properties=search_property,  # type: ignore[arg-type]
        limit=limit,
        filter=filter_,
    )

apply(windmill, replace=False, write_none=False)

Add or update (upsert) windmills.

Note: This method iterates through all nodes and timeseries linked to windmill and creates them including the edges between the nodes. For example, if any of blades, metmast, nacelle or rotor are set, then these nodes as well as any nodes linked to them, and all the edges linking these nodes will be created.

Parameters:

Name Type Description Default
windmill WindmillWrite | Sequence[WindmillWrite]

Windmill or sequence of windmills to upsert.

required
replace bool

How do we behave when a property value exists? Do we replace all matching and existing values with the supplied values (true)? Or should we merge in new values for properties together with the existing values (false)? Note: This setting applies for all nodes or edges specified in the ingestion call.

False
write_none bool

This method, will by default, skip properties that are set to None. However, if you want to set properties to None, you can set this parameter to True. Note this only applies to properties that are nullable.

False

Returns: Created instance(s), i.e., nodes, edges, and time series.

Examples:

Create a new windmill:

    >>> from windmill import WindmillClient
    >>> from windmill.data_classes import WindmillWrite
    >>> client = WindmillClient()
    >>> windmill = WindmillWrite(external_id="my_windmill", ...)
    >>> result = client.windmill.apply(windmill)
Source code in examples/windmill/_api/windmill.py
def apply(
    self,
    windmill: WindmillWrite | Sequence[WindmillWrite],
    replace: bool = False,
    write_none: bool = False,
) -> ResourcesWriteResult:
    """Add or update (upsert) windmills.

    Note: This method iterates through all nodes and timeseries linked to windmill and creates them including the edges
    between the nodes. For example, if any of `blades`, `metmast`, `nacelle` or `rotor` are set, then these
    nodes as well as any nodes linked to them, and all the edges linking these nodes will be created.

    Args:
        windmill: Windmill or sequence of windmills to upsert.
        replace (bool): How do we behave when a property value exists? Do we replace all matching and existing values with the supplied values (true)?
            Or should we merge in new values for properties together with the existing values (false)? Note: This setting applies for all nodes or edges specified in the ingestion call.
        write_none (bool): This method, will by default, skip properties that are set to None. However, if you want to set properties to None,
            you can set this parameter to True. Note this only applies to properties that are nullable.
    Returns:
        Created instance(s), i.e., nodes, edges, and time series.

    Examples:

        Create a new windmill:

            >>> from windmill import WindmillClient
            >>> from windmill.data_classes import WindmillWrite
            >>> client = WindmillClient()
            >>> windmill = WindmillWrite(external_id="my_windmill", ...)
            >>> result = client.windmill.apply(windmill)

    """
    warnings.warn(
        "The .apply method is deprecated and will be removed in v1.0. "
        "Please use the .upsert method on the client instead. This means instead of "
        "`my_client.windmill.apply(my_items)` please use `my_client.upsert(my_items)`."
        "The motivation is that all apply methods are the same, and having one apply method per API "
        " class encourages users to create items in small batches, which is inefficient."
        "In addition, .upsert method is more descriptive of what the method does.",
        UserWarning,
        stacklevel=2,
    )
    return self._apply(windmill, replace, write_none)

delete(external_id, space=DEFAULT_INSTANCE_SPACE)

Delete one or more windmill.

Parameters:

Name Type Description Default
external_id str | SequenceNotStr[str]

External id of the windmill to delete.

required
space str

The space where all the windmill are located.

DEFAULT_INSTANCE_SPACE

Returns:

Type Description
InstancesDeleteResult

The instance(s), i.e., nodes and edges which has been deleted. Empty list if nothing was deleted.

Examples:

Delete windmill by id:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> client.windmill.delete("my_windmill")
Source code in examples/windmill/_api/windmill.py
def delete(
    self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
) -> dm.InstancesDeleteResult:
    """Delete one or more windmill.

    Args:
        external_id: External id of the windmill to delete.
        space: The space where all the windmill are located.

    Returns:
        The instance(s), i.e., nodes and edges which has been deleted. Empty list if nothing was deleted.

    Examples:

        Delete windmill by id:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> client.windmill.delete("my_windmill")
    """
    warnings.warn(
        "The .delete method is deprecated and will be removed in v1.0. "
        "Please use the .delete method on the client instead. This means instead of "
        "`my_client.windmill.delete(my_ids)` please use `my_client.delete(my_ids)`."
        "The motivation is that all delete methods are the same, and having one delete method per API "
        " class encourages users to delete items in small batches, which is inefficient.",
        UserWarning,
        stacklevel=2,
    )
    return self._delete(external_id, space)

histogram(property, interval, query=None, search_property=None, min_capacity=None, max_capacity=None, nacelle=None, name=None, name_prefix=None, rotor=None, windfarm=None, windfarm_prefix=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None)

Produces histograms for windmills

Parameters:

Name Type Description Default
property WindmillFields

The property to use as the value in the histogram.

required
interval float

The interval to use for the histogram bins.

required
query str | None

The query to search for in the text field.

None
search_property WindmillTextFields | SequenceNotStr[WindmillTextFields] | None

The text field to search in.

None
min_capacity float | None

The minimum value of the capacity to filter on.

None
max_capacity float | None

The maximum value of the capacity to filter on.

None
nacelle str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The nacelle to filter on.

None
name str | list[str] | None

The name to filter on.

None
name_prefix str | None

The prefix of the name to filter on.

None
rotor str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The rotor to filter on.

None
windfarm str | list[str] | None

The windfarm to filter on.

None
windfarm_prefix str | None

The prefix of the windfarm to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of windmills to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None

Returns:

Type Description
HistogramValue

Bucketed histogram results.

Source code in examples/windmill/_api/windmill.py
def histogram(
    self,
    property: WindmillFields,
    interval: float,
    query: str | None = None,
    search_property: WindmillTextFields | SequenceNotStr[WindmillTextFields] | None = None,
    min_capacity: float | None = None,
    max_capacity: float | None = None,
    nacelle: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    name: str | list[str] | None = None,
    name_prefix: str | None = None,
    rotor: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    windfarm: str | list[str] | None = None,
    windfarm_prefix: str | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
) -> dm.aggregations.HistogramValue:
    """Produces histograms for windmills

    Args:
        property: The property to use as the value in the histogram.
        interval: The interval to use for the histogram bins.
        query: The query to search for in the text field.
        search_property: The text field to search in.
        min_capacity: The minimum value of the capacity to filter on.
        max_capacity: The maximum value of the capacity to filter on.
        nacelle: The nacelle to filter on.
        name: The name to filter on.
        name_prefix: The prefix of the name to filter on.
        rotor: The rotor to filter on.
        windfarm: The windfarm to filter on.
        windfarm_prefix: The prefix of the windfarm to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of windmills to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

    Returns:
        Bucketed histogram results.

    """
    filter_ = _create_windmill_filter(
        self._view_id,
        min_capacity,
        max_capacity,
        nacelle,
        name,
        name_prefix,
        rotor,
        windfarm,
        windfarm_prefix,
        external_id_prefix,
        space,
        filter,
    )
    return self._histogram(
        property,
        interval,
        query,
        search_property,  # type: ignore[arg-type]
        limit,
        filter_,
    )

list(min_capacity=None, max_capacity=None, nacelle=None, name=None, name_prefix=None, rotor=None, windfarm=None, windfarm_prefix=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None, sort_by=None, direction='ascending', sort=None, retrieve_connections='skip')

List/filter windmills

Parameters:

Name Type Description Default
min_capacity float | None

The minimum value of the capacity to filter on.

None
max_capacity float | None

The maximum value of the capacity to filter on.

None
nacelle str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The nacelle to filter on.

None
name str | list[str] | None

The name to filter on.

None
name_prefix str | None

The prefix of the name to filter on.

None
rotor str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The rotor to filter on.

None
windfarm str | list[str] | None

The windfarm to filter on.

None
windfarm_prefix str | None

The prefix of the windfarm to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of windmills to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None
sort_by WindmillFields | Sequence[WindmillFields] | None

The property to sort by.

None
direction Literal['ascending', 'descending']

The direction to sort by, either 'ascending' or 'descending'.

'ascending'
sort InstanceSort | list[InstanceSort] | None

(Advanced) If sort_by and direction are not sufficient, you can write your own sorting. This will override the sort_by and direction. This allowos you to sort by multiple fields and specify the direction for each field as well as how to handle null values.

None
retrieve_connections Literal['skip', 'identifier', 'full']

Whether to retrieve blades, metmast, nacelle and rotor for the windmills. Defaults to 'skip'. 'skip' will not retrieve any connections, 'identifier' will only retrieve the identifier of the connected items, and 'full' will retrieve the full connected items.

'skip'

Returns:

Type Description
WindmillList

List of requested windmills

Examples:

List windmills and limit to 5:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> windmills = client.windmill.list(limit=5)
Source code in examples/windmill/_api/windmill.py
def list(
    self,
    min_capacity: float | None = None,
    max_capacity: float | None = None,
    nacelle: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    name: str | list[str] | None = None,
    name_prefix: str | None = None,
    rotor: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    windfarm: str | list[str] | None = None,
    windfarm_prefix: str | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
    sort_by: WindmillFields | Sequence[WindmillFields] | None = None,
    direction: Literal["ascending", "descending"] = "ascending",
    sort: InstanceSort | list[InstanceSort] | None = None,
    retrieve_connections: Literal["skip", "identifier", "full"] = "skip",
) -> WindmillList:
    """List/filter windmills

    Args:
        min_capacity: The minimum value of the capacity to filter on.
        max_capacity: The maximum value of the capacity to filter on.
        nacelle: The nacelle to filter on.
        name: The name to filter on.
        name_prefix: The prefix of the name to filter on.
        rotor: The rotor to filter on.
        windfarm: The windfarm to filter on.
        windfarm_prefix: The prefix of the windfarm to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of windmills to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
        sort_by: The property to sort by.
        direction: The direction to sort by, either 'ascending' or 'descending'.
        sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
            This will override the sort_by and direction. This allowos you to sort by multiple fields and
            specify the direction for each field as well as how to handle null values.
        retrieve_connections: Whether to retrieve `blades`, `metmast`, `nacelle` and `rotor` for the windmills. Defaults to 'skip'.
            'skip' will not retrieve any connections, 'identifier' will only retrieve the identifier of the connected items, and 'full' will retrieve the full connected items.

    Returns:
        List of requested windmills

    Examples:

        List windmills and limit to 5:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> windmills = client.windmill.list(limit=5)

    """
    filter_ = _create_windmill_filter(
        self._view_id,
        min_capacity,
        max_capacity,
        nacelle,
        name,
        name_prefix,
        rotor,
        windfarm,
        windfarm_prefix,
        external_id_prefix,
        space,
        filter,
    )

    if retrieve_connections == "skip":
        return self._list(
            limit=limit,
            filter=filter_,
            sort_by=sort_by,  # type: ignore[arg-type]
            direction=direction,
            sort=sort,
        )

    builder = QueryBuilder(WindmillList)
    has_data = dm.filters.HasData(views=[self._view_id])
    builder.append(
        NodeQueryStep(
            builder.create_name(None),
            dm.query.NodeResultSetExpression(
                filter=dm.filters.And(filter_, has_data) if filter_ else has_data,
                sort=self._create_sort(sort_by, direction, sort),  # type: ignore[arg-type]
            ),
            Windmill,
            max_retrieve_limit=limit,
        )
    )
    from_root = builder.get_from()
    edge_blades = builder.create_name(from_root)
    builder.append(
        EdgeQueryStep(
            edge_blades,
            dm.query.EdgeResultSetExpression(
                from_=from_root,
                direction="outwards",
                chain_to="destination",
            ),
        )
    )
    edge_metmast = builder.create_name(from_root)
    builder.append(
        EdgeQueryStep(
            edge_metmast,
            dm.query.EdgeResultSetExpression(
                from_=from_root,
                direction="outwards",
                chain_to="destination",
            ),
        )
    )
    if retrieve_connections == "full":
        builder.append(
            NodeQueryStep(
                builder.create_name(edge_blades),
                dm.query.NodeResultSetExpression(
                    from_=edge_blades,
                    filter=dm.filters.HasData(views=[Blade._view_id]),
                ),
                Blade,
            )
        )
        builder.append(
            NodeQueryStep(
                builder.create_name(edge_metmast),
                dm.query.NodeResultSetExpression(
                    from_=edge_metmast,
                    filter=dm.filters.HasData(views=[Metmast._view_id]),
                ),
                Metmast,
            )
        )
        builder.append(
            NodeQueryStep(
                builder.create_name(from_root),
                dm.query.NodeResultSetExpression(
                    from_=from_root,
                    filter=dm.filters.HasData(views=[Nacelle._view_id]),
                    direction="outwards",
                    through=self._view_id.as_property_ref("nacelle"),
                ),
                Nacelle,
            )
        )
        builder.append(
            NodeQueryStep(
                builder.create_name(from_root),
                dm.query.NodeResultSetExpression(
                    from_=from_root,
                    filter=dm.filters.HasData(views=[Rotor._view_id]),
                    direction="outwards",
                    through=self._view_id.as_property_ref("rotor"),
                ),
                Rotor,
            )
        )

    return builder.execute(self._client)

query()

Start a query for windmills.

Source code in examples/windmill/_api/windmill.py
def query(self) -> WindmillQuery:
    """Start a query for windmills."""
    warnings.warn("The .query is in alpha and is subject to breaking changes without notice.")
    return WindmillQuery(self._client)

retrieve(external_id, space=DEFAULT_INSTANCE_SPACE)

retrieve(external_id: str, space: str = DEFAULT_INSTANCE_SPACE) -> Windmill | None
retrieve(external_id: SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE) -> WindmillList

Retrieve one or more windmills by id(s).

Parameters:

Name Type Description Default
external_id str | SequenceNotStr[str]

External id or list of external ids of the windmills.

required
space str

The space where all the windmills are located.

DEFAULT_INSTANCE_SPACE

Returns:

Type Description
Windmill | WindmillList | None

The requested windmills.

Examples:

Retrieve windmill by id:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> windmill = client.windmill.retrieve("my_windmill")
Source code in examples/windmill/_api/windmill.py
def retrieve(
    self, external_id: str | SequenceNotStr[str], space: str = DEFAULT_INSTANCE_SPACE
) -> Windmill | WindmillList | None:
    """Retrieve one or more windmills by id(s).

    Args:
        external_id: External id or list of external ids of the windmills.
        space: The space where all the windmills are located.

    Returns:
        The requested windmills.

    Examples:

        Retrieve windmill by id:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> windmill = client.windmill.retrieve("my_windmill")

    """
    return self._retrieve(
        external_id,
        space,
        retrieve_edges=True,
        edge_api_name_type_direction_view_id_penta=[
            (
                self.blades_edge,
                "blades",
                dm.DirectRelationReference("power-models", "Windmill.blades"),
                "outwards",
                dm.ViewId("power-models", "Blade", "1"),
            ),
            (
                self.metmast_edge,
                "metmast",
                dm.DirectRelationReference("power-models", "Windmill.metmast"),
                "outwards",
                dm.ViewId("power-models", "Metmast", "1"),
            ),
        ],
    )

search(query, properties=None, min_capacity=None, max_capacity=None, nacelle=None, name=None, name_prefix=None, rotor=None, windfarm=None, windfarm_prefix=None, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ, filter=None, sort_by=None, direction='ascending', sort=None)

Search windmills

Parameters:

Name Type Description Default
query str

The search query,

required
properties WindmillTextFields | SequenceNotStr[WindmillTextFields] | None

The property to search, if nothing is passed all text fields will be searched.

None
min_capacity float | None

The minimum value of the capacity to filter on.

None
max_capacity float | None

The maximum value of the capacity to filter on.

None
nacelle str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The nacelle to filter on.

None
name str | list[str] | None

The name to filter on.

None
name_prefix str | None

The prefix of the name to filter on.

None
rotor str | tuple[str, str] | NodeId | DirectRelationReference | Sequence[str | tuple[str, str] | NodeId | DirectRelationReference] | None

The rotor to filter on.

None
windfarm str | list[str] | None

The windfarm to filter on.

None
windfarm_prefix str | None

The prefix of the windfarm to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit int

Maximum number of windmills to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ
filter Filter | None

(Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None
sort_by WindmillFields | SequenceNotStr[WindmillFields] | None

The property to sort by.

None
direction Literal['ascending', 'descending']

The direction to sort by, either 'ascending' or 'descending'.

'ascending'
sort InstanceSort | list[InstanceSort] | None

(Advanced) If sort_by and direction are not sufficient, you can write your own sorting. This will override the sort_by and direction. This allowos you to sort by multiple fields and specify the direction for each field as well as how to handle null values.

None

Returns:

Type Description
WindmillList

Search results windmills matching the query.

Examples:

Search for 'my_windmill' in all text properties:

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> windmills = client.windmill.search('my_windmill')
Source code in examples/windmill/_api/windmill.py
def search(
    self,
    query: str,
    properties: WindmillTextFields | SequenceNotStr[WindmillTextFields] | None = None,
    min_capacity: float | None = None,
    max_capacity: float | None = None,
    nacelle: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    name: str | list[str] | None = None,
    name_prefix: str | None = None,
    rotor: (
        str
        | tuple[str, str]
        | dm.NodeId
        | dm.DirectRelationReference
        | Sequence[str | tuple[str, str] | dm.NodeId | dm.DirectRelationReference]
        | None
    ) = None,
    windfarm: str | list[str] | None = None,
    windfarm_prefix: str | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit: int = DEFAULT_LIMIT_READ,
    filter: dm.Filter | None = None,
    sort_by: WindmillFields | SequenceNotStr[WindmillFields] | None = None,
    direction: Literal["ascending", "descending"] = "ascending",
    sort: InstanceSort | list[InstanceSort] | None = None,
) -> WindmillList:
    """Search windmills

    Args:
        query: The search query,
        properties: The property to search, if nothing is passed all text fields will be searched.
        min_capacity: The minimum value of the capacity to filter on.
        max_capacity: The maximum value of the capacity to filter on.
        nacelle: The nacelle to filter on.
        name: The name to filter on.
        name_prefix: The prefix of the name to filter on.
        rotor: The rotor to filter on.
        windfarm: The windfarm to filter on.
        windfarm_prefix: The prefix of the windfarm to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of windmills to return. Defaults to 25. Set to -1, float("inf") or None to return all items.
        filter: (Advanced) If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
        sort_by: The property to sort by.
        direction: The direction to sort by, either 'ascending' or 'descending'.
        sort: (Advanced) If sort_by and direction are not sufficient, you can write your own sorting.
            This will override the sort_by and direction. This allowos you to sort by multiple fields and
            specify the direction for each field as well as how to handle null values.

    Returns:
        Search results windmills matching the query.

    Examples:

       Search for 'my_windmill' in all text properties:

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> windmills = client.windmill.search('my_windmill')

    """
    filter_ = _create_windmill_filter(
        self._view_id,
        min_capacity,
        max_capacity,
        nacelle,
        name,
        name_prefix,
        rotor,
        windfarm,
        windfarm_prefix,
        external_id_prefix,
        space,
        filter,
    )
    return self._search(
        query=query,
        properties=properties,
        filter_=filter_,
        limit=limit,
        sort_by=sort_by,  # type: ignore[arg-type]
        direction=direction,
        sort=sort,
    )

WindmillBladesAPI

Bases: EdgeAPI

Source code in examples/windmill/_api/windmill_blades.py
class WindmillBladesAPI(EdgeAPI):
    def list(
        self,
        from_windmill: str | list[str] | dm.NodeId | list[dm.NodeId] | None = None,
        from_windmill_space: str = DEFAULT_INSTANCE_SPACE,
        to_blade: str | list[str] | dm.NodeId | list[dm.NodeId] | None = None,
        to_blade_space: str = DEFAULT_INSTANCE_SPACE,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit=DEFAULT_LIMIT_READ,
    ) -> dm.EdgeList:
        """List blade edges of a windmill.

        Args:
            from_windmill: ID of the source windmill.
            from_windmill_space: Location of the windmills.
            to_blade: ID of the target blade.
            to_blade_space: Location of the blades.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of blade edges to return. Defaults to 25. Set to -1, float("inf") or None
                to return all items.

        Returns:
            The requested blade edges.

        Examples:

            List 5 blade edges connected to "my_windmill":

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> windmill = client.windmill.blades_edge.list("my_windmill", limit=5)

        """
        filter_ = _create_edge_filter(
            dm.DirectRelationReference("power-models", "Windmill.blades"),
            from_windmill,
            from_windmill_space,
            to_blade,
            to_blade_space,
            external_id_prefix,
            space,
        )
        return self._list(filter_=filter_, limit=limit)

list(from_windmill=None, from_windmill_space=DEFAULT_INSTANCE_SPACE, to_blade=None, to_blade_space=DEFAULT_INSTANCE_SPACE, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ)

List blade edges of a windmill.

Parameters:

Name Type Description Default
from_windmill str | list[str] | NodeId | list[NodeId] | None

ID of the source windmill.

None
from_windmill_space str

Location of the windmills.

DEFAULT_INSTANCE_SPACE
to_blade str | list[str] | NodeId | list[NodeId] | None

ID of the target blade.

None
to_blade_space str

Location of the blades.

DEFAULT_INSTANCE_SPACE
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit

Maximum number of blade edges to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ

Returns:

Type Description
EdgeList

The requested blade edges.

Examples:

List 5 blade edges connected to "my_windmill":

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> windmill = client.windmill.blades_edge.list("my_windmill", limit=5)
Source code in examples/windmill/_api/windmill_blades.py
def list(
    self,
    from_windmill: str | list[str] | dm.NodeId | list[dm.NodeId] | None = None,
    from_windmill_space: str = DEFAULT_INSTANCE_SPACE,
    to_blade: str | list[str] | dm.NodeId | list[dm.NodeId] | None = None,
    to_blade_space: str = DEFAULT_INSTANCE_SPACE,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit=DEFAULT_LIMIT_READ,
) -> dm.EdgeList:
    """List blade edges of a windmill.

    Args:
        from_windmill: ID of the source windmill.
        from_windmill_space: Location of the windmills.
        to_blade: ID of the target blade.
        to_blade_space: Location of the blades.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of blade edges to return. Defaults to 25. Set to -1, float("inf") or None
            to return all items.

    Returns:
        The requested blade edges.

    Examples:

        List 5 blade edges connected to "my_windmill":

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> windmill = client.windmill.blades_edge.list("my_windmill", limit=5)

    """
    filter_ = _create_edge_filter(
        dm.DirectRelationReference("power-models", "Windmill.blades"),
        from_windmill,
        from_windmill_space,
        to_blade,
        to_blade_space,
        external_id_prefix,
        space,
    )
    return self._list(filter_=filter_, limit=limit)

WindmillMetmastAPI

Bases: EdgeAPI

Source code in examples/windmill/_api/windmill_metmast.py
class WindmillMetmastAPI(EdgeAPI):
    def list(
        self,
        from_windmill: str | list[str] | dm.NodeId | list[dm.NodeId] | None = None,
        from_windmill_space: str = DEFAULT_INSTANCE_SPACE,
        to_metmast: str | list[str] | dm.NodeId | list[dm.NodeId] | None = None,
        to_metmast_space: str = DEFAULT_INSTANCE_SPACE,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        limit=DEFAULT_LIMIT_READ,
    ) -> dm.EdgeList:
        """List metmast edges of a windmill.

        Args:
            from_windmill: ID of the source windmill.
            from_windmill_space: Location of the windmills.
            to_metmast: ID of the target metmast.
            to_metmast_space: Location of the metmasts.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            limit: Maximum number of metmast edges to return. Defaults to 25. Set to -1, float("inf") or None
                to return all items.

        Returns:
            The requested metmast edges.

        Examples:

            List 5 metmast edges connected to "my_windmill":

                >>> from windmill import WindmillClient
                >>> client = WindmillClient()
                >>> windmill = client.windmill.metmast_edge.list("my_windmill", limit=5)

        """
        filter_ = _create_edge_filter(
            dm.DirectRelationReference("power-models", "Windmill.metmast"),
            from_windmill,
            from_windmill_space,
            to_metmast,
            to_metmast_space,
            external_id_prefix,
            space,
        )
        return self._list(filter_=filter_, limit=limit)

list(from_windmill=None, from_windmill_space=DEFAULT_INSTANCE_SPACE, to_metmast=None, to_metmast_space=DEFAULT_INSTANCE_SPACE, external_id_prefix=None, space=None, limit=DEFAULT_LIMIT_READ)

List metmast edges of a windmill.

Parameters:

Name Type Description Default
from_windmill str | list[str] | NodeId | list[NodeId] | None

ID of the source windmill.

None
from_windmill_space str

Location of the windmills.

DEFAULT_INSTANCE_SPACE
to_metmast str | list[str] | NodeId | list[NodeId] | None

ID of the target metmast.

None
to_metmast_space str

Location of the metmasts.

DEFAULT_INSTANCE_SPACE
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
limit

Maximum number of metmast edges to return. Defaults to 25. Set to -1, float("inf") or None to return all items.

DEFAULT_LIMIT_READ

Returns:

Type Description
EdgeList

The requested metmast edges.

Examples:

List 5 metmast edges connected to "my_windmill":

    >>> from windmill import WindmillClient
    >>> client = WindmillClient()
    >>> windmill = client.windmill.metmast_edge.list("my_windmill", limit=5)
Source code in examples/windmill/_api/windmill_metmast.py
def list(
    self,
    from_windmill: str | list[str] | dm.NodeId | list[dm.NodeId] | None = None,
    from_windmill_space: str = DEFAULT_INSTANCE_SPACE,
    to_metmast: str | list[str] | dm.NodeId | list[dm.NodeId] | None = None,
    to_metmast_space: str = DEFAULT_INSTANCE_SPACE,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    limit=DEFAULT_LIMIT_READ,
) -> dm.EdgeList:
    """List metmast edges of a windmill.

    Args:
        from_windmill: ID of the source windmill.
        from_windmill_space: Location of the windmills.
        to_metmast: ID of the target metmast.
        to_metmast_space: Location of the metmasts.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        limit: Maximum number of metmast edges to return. Defaults to 25. Set to -1, float("inf") or None
            to return all items.

    Returns:
        The requested metmast edges.

    Examples:

        List 5 metmast edges connected to "my_windmill":

            >>> from windmill import WindmillClient
            >>> client = WindmillClient()
            >>> windmill = client.windmill.metmast_edge.list("my_windmill", limit=5)

    """
    filter_ = _create_edge_filter(
        dm.DirectRelationReference("power-models", "Windmill.metmast"),
        from_windmill,
        from_windmill_space,
        to_metmast,
        to_metmast_space,
        external_id_prefix,
        space,
    )
    return self._list(filter_=filter_, limit=limit)

WindmillQueryAPI

Bases: QueryAPI[T_DomainModelList]

Source code in examples/windmill/_api/windmill_query.py
class WindmillQueryAPI(QueryAPI[T_DomainModelList]):
    _view_id = dm.ViewId("power-models", "Windmill", "1")

    def __init__(
        self,
        client: CogniteClient,
        builder: QueryBuilder[T_DomainModelList],
        filter_: dm.filters.Filter | None = None,
        limit: int = DEFAULT_QUERY_LIMIT,
    ):
        super().__init__(client, builder)
        from_ = self._builder.get_from()
        self._builder.append(
            NodeQueryStep(
                name=self._builder.create_name(from_),
                expression=dm.query.NodeResultSetExpression(
                    from_=from_,
                    filter=filter_,
                ),
                result_cls=Windmill,
                max_retrieve_limit=limit,
            )
        )

    def blades(
        self,
        is_damaged: bool | None = None,
        name: str | list[str] | None = None,
        name_prefix: str | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        external_id_prefix_edge: str | None = None,
        space_edge: str | list[str] | None = None,
        filter: dm.Filter | None = None,
        limit: int = DEFAULT_QUERY_LIMIT,
        retrieve_nacelle: bool = False,
        retrieve_rotor: bool = False,
    ) -> BladeQueryAPI[T_DomainModelList]:
        """Query along the blade edges of the windmill.

        Args:
            is_damaged: The is damaged to filter on.
            name: The name to filter on.
            name_prefix: The prefix of the name to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            external_id_prefix_edge: The prefix of the external ID to filter on.
            space_edge: The space to filter on.
            filter: (Advanced) Filter applied to node. If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
            limit: Maximum number of blade edges to return. Defaults to 3. Set to -1, float("inf") or None
                to return all items.
            retrieve_nacelle: Whether to retrieve the nacelle for each windmill or not.
            retrieve_rotor: Whether to retrieve the rotor for each windmill or not.

        Returns:
            BladeQueryAPI: The query API for the blade.
        """
        from .blade_query import BladeQueryAPI

        # from is a string as we added a node query step in the __init__ method
        from_ = cast(str, self._builder.get_from())
        edge_filter = _create_edge_filter(
            dm.DirectRelationReference("power-models", "Windmill.blades"),
            external_id_prefix=external_id_prefix_edge,
            space=space_edge,
        )
        self._builder.append(
            EdgeQueryStep(
                name=self._builder.create_name(from_),
                expression=dm.query.EdgeResultSetExpression(
                    filter=edge_filter,
                    from_=from_,
                    direction="outwards",
                ),
                max_retrieve_limit=limit,
            )
        )

        view_id = BladeQueryAPI._view_id
        has_data = dm.filters.HasData(views=[view_id])
        node_filer = _create_blade_filter(
            view_id,
            is_damaged,
            name,
            name_prefix,
            external_id_prefix,
            space,
            (filter and dm.filters.And(filter, has_data)) or has_data,
        )
        if retrieve_nacelle:
            self._query_append_nacelle(from_)
        if retrieve_rotor:
            self._query_append_rotor(from_)
        return BladeQueryAPI(self._client, self._builder, node_filer, limit)

    def metmast(
        self,
        min_position: float | None = None,
        max_position: float | None = None,
        external_id_prefix: str | None = None,
        space: str | list[str] | None = None,
        external_id_prefix_edge: str | None = None,
        space_edge: str | list[str] | None = None,
        filter: dm.Filter | None = None,
        limit: int = DEFAULT_QUERY_LIMIT,
        retrieve_nacelle: bool = False,
        retrieve_rotor: bool = False,
    ) -> MetmastQueryAPI[T_DomainModelList]:
        """Query along the metmast edges of the windmill.

        Args:
            min_position: The minimum value of the position to filter on.
            max_position: The maximum value of the position to filter on.
            external_id_prefix: The prefix of the external ID to filter on.
            space: The space to filter on.
            external_id_prefix_edge: The prefix of the external ID to filter on.
            space_edge: The space to filter on.
            filter: (Advanced) Filter applied to node. If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
            limit: Maximum number of metmast edges to return. Defaults to 3. Set to -1, float("inf") or None
                to return all items.
            retrieve_nacelle: Whether to retrieve the nacelle for each windmill or not.
            retrieve_rotor: Whether to retrieve the rotor for each windmill or not.

        Returns:
            MetmastQueryAPI: The query API for the metmast.
        """
        from .metmast_query import MetmastQueryAPI

        # from is a string as we added a node query step in the __init__ method
        from_ = cast(str, self._builder.get_from())
        edge_filter = _create_edge_filter(
            dm.DirectRelationReference("power-models", "Windmill.metmast"),
            external_id_prefix=external_id_prefix_edge,
            space=space_edge,
        )
        self._builder.append(
            EdgeQueryStep(
                name=self._builder.create_name(from_),
                expression=dm.query.EdgeResultSetExpression(
                    filter=edge_filter,
                    from_=from_,
                    direction="outwards",
                ),
                max_retrieve_limit=limit,
            )
        )

        view_id = MetmastQueryAPI._view_id
        has_data = dm.filters.HasData(views=[view_id])
        node_filer = _create_metmast_filter(
            view_id,
            min_position,
            max_position,
            external_id_prefix,
            space,
            (filter and dm.filters.And(filter, has_data)) or has_data,
        )
        if retrieve_nacelle:
            self._query_append_nacelle(from_)
        if retrieve_rotor:
            self._query_append_rotor(from_)
        return MetmastQueryAPI(self._client, self._builder, node_filer, limit)

    def query(
        self,
        retrieve_nacelle: bool = False,
        retrieve_rotor: bool = False,
    ) -> T_DomainModelList:
        """Execute query and return the result.

        Args:
            retrieve_nacelle: Whether to retrieve the nacelle for each windmill or not.
            retrieve_rotor: Whether to retrieve the rotor for each windmill or not.

        Returns:
            The list of the source nodes of the query.

        """
        from_ = self._builder[-1].name
        if retrieve_nacelle:
            self._query_append_nacelle(from_)
        if retrieve_rotor:
            self._query_append_rotor(from_)
        return self._query()

    def _query_append_nacelle(self, from_: str) -> None:
        self._builder.append(
            NodeQueryStep(
                name=self._builder.create_name(from_),
                expression=dm.query.NodeResultSetExpression(
                    from_=from_,
                    through=self._view_id.as_property_ref("nacelle"),
                    direction="outwards",
                    filter=dm.filters.HasData(views=[Nacelle._view_id]),
                ),
                result_cls=Nacelle,
            ),
        )

    def _query_append_rotor(self, from_: str) -> None:
        self._builder.append(
            NodeQueryStep(
                name=self._builder.create_name(from_),
                expression=dm.query.NodeResultSetExpression(
                    from_=from_,
                    through=self._view_id.as_property_ref("rotor"),
                    direction="outwards",
                    filter=dm.filters.HasData(views=[Rotor._view_id]),
                ),
                result_cls=Rotor,
            ),
        )

blades(is_damaged=None, name=None, name_prefix=None, external_id_prefix=None, space=None, external_id_prefix_edge=None, space_edge=None, filter=None, limit=DEFAULT_QUERY_LIMIT, retrieve_nacelle=False, retrieve_rotor=False)

Query along the blade edges of the windmill.

Parameters:

Name Type Description Default
is_damaged bool | None

The is damaged to filter on.

None
name str | list[str] | None

The name to filter on.

None
name_prefix str | None

The prefix of the name to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
external_id_prefix_edge str | None

The prefix of the external ID to filter on.

None
space_edge str | list[str] | None

The space to filter on.

None
filter Filter | None

(Advanced) Filter applied to node. If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None
limit int

Maximum number of blade edges to return. Defaults to 3. Set to -1, float("inf") or None to return all items.

DEFAULT_QUERY_LIMIT
retrieve_nacelle bool

Whether to retrieve the nacelle for each windmill or not.

False
retrieve_rotor bool

Whether to retrieve the rotor for each windmill or not.

False

Returns:

Name Type Description
BladeQueryAPI BladeQueryAPI[T_DomainModelList]

The query API for the blade.

Source code in examples/windmill/_api/windmill_query.py
def blades(
    self,
    is_damaged: bool | None = None,
    name: str | list[str] | None = None,
    name_prefix: str | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    external_id_prefix_edge: str | None = None,
    space_edge: str | list[str] | None = None,
    filter: dm.Filter | None = None,
    limit: int = DEFAULT_QUERY_LIMIT,
    retrieve_nacelle: bool = False,
    retrieve_rotor: bool = False,
) -> BladeQueryAPI[T_DomainModelList]:
    """Query along the blade edges of the windmill.

    Args:
        is_damaged: The is damaged to filter on.
        name: The name to filter on.
        name_prefix: The prefix of the name to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        external_id_prefix_edge: The prefix of the external ID to filter on.
        space_edge: The space to filter on.
        filter: (Advanced) Filter applied to node. If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
        limit: Maximum number of blade edges to return. Defaults to 3. Set to -1, float("inf") or None
            to return all items.
        retrieve_nacelle: Whether to retrieve the nacelle for each windmill or not.
        retrieve_rotor: Whether to retrieve the rotor for each windmill or not.

    Returns:
        BladeQueryAPI: The query API for the blade.
    """
    from .blade_query import BladeQueryAPI

    # from is a string as we added a node query step in the __init__ method
    from_ = cast(str, self._builder.get_from())
    edge_filter = _create_edge_filter(
        dm.DirectRelationReference("power-models", "Windmill.blades"),
        external_id_prefix=external_id_prefix_edge,
        space=space_edge,
    )
    self._builder.append(
        EdgeQueryStep(
            name=self._builder.create_name(from_),
            expression=dm.query.EdgeResultSetExpression(
                filter=edge_filter,
                from_=from_,
                direction="outwards",
            ),
            max_retrieve_limit=limit,
        )
    )

    view_id = BladeQueryAPI._view_id
    has_data = dm.filters.HasData(views=[view_id])
    node_filer = _create_blade_filter(
        view_id,
        is_damaged,
        name,
        name_prefix,
        external_id_prefix,
        space,
        (filter and dm.filters.And(filter, has_data)) or has_data,
    )
    if retrieve_nacelle:
        self._query_append_nacelle(from_)
    if retrieve_rotor:
        self._query_append_rotor(from_)
    return BladeQueryAPI(self._client, self._builder, node_filer, limit)

metmast(min_position=None, max_position=None, external_id_prefix=None, space=None, external_id_prefix_edge=None, space_edge=None, filter=None, limit=DEFAULT_QUERY_LIMIT, retrieve_nacelle=False, retrieve_rotor=False)

Query along the metmast edges of the windmill.

Parameters:

Name Type Description Default
min_position float | None

The minimum value of the position to filter on.

None
max_position float | None

The maximum value of the position to filter on.

None
external_id_prefix str | None

The prefix of the external ID to filter on.

None
space str | list[str] | None

The space to filter on.

None
external_id_prefix_edge str | None

The prefix of the external ID to filter on.

None
space_edge str | list[str] | None

The space to filter on.

None
filter Filter | None

(Advanced) Filter applied to node. If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.

None
limit int

Maximum number of metmast edges to return. Defaults to 3. Set to -1, float("inf") or None to return all items.

DEFAULT_QUERY_LIMIT
retrieve_nacelle bool

Whether to retrieve the nacelle for each windmill or not.

False
retrieve_rotor bool

Whether to retrieve the rotor for each windmill or not.

False

Returns:

Name Type Description
MetmastQueryAPI MetmastQueryAPI[T_DomainModelList]

The query API for the metmast.

Source code in examples/windmill/_api/windmill_query.py
def metmast(
    self,
    min_position: float | None = None,
    max_position: float | None = None,
    external_id_prefix: str | None = None,
    space: str | list[str] | None = None,
    external_id_prefix_edge: str | None = None,
    space_edge: str | list[str] | None = None,
    filter: dm.Filter | None = None,
    limit: int = DEFAULT_QUERY_LIMIT,
    retrieve_nacelle: bool = False,
    retrieve_rotor: bool = False,
) -> MetmastQueryAPI[T_DomainModelList]:
    """Query along the metmast edges of the windmill.

    Args:
        min_position: The minimum value of the position to filter on.
        max_position: The maximum value of the position to filter on.
        external_id_prefix: The prefix of the external ID to filter on.
        space: The space to filter on.
        external_id_prefix_edge: The prefix of the external ID to filter on.
        space_edge: The space to filter on.
        filter: (Advanced) Filter applied to node. If the filtering available in the above is not sufficient, you can write your own filtering which will be ANDed with the filter above.
        limit: Maximum number of metmast edges to return. Defaults to 3. Set to -1, float("inf") or None
            to return all items.
        retrieve_nacelle: Whether to retrieve the nacelle for each windmill or not.
        retrieve_rotor: Whether to retrieve the rotor for each windmill or not.

    Returns:
        MetmastQueryAPI: The query API for the metmast.
    """
    from .metmast_query import MetmastQueryAPI

    # from is a string as we added a node query step in the __init__ method
    from_ = cast(str, self._builder.get_from())
    edge_filter = _create_edge_filter(
        dm.DirectRelationReference("power-models", "Windmill.metmast"),
        external_id_prefix=external_id_prefix_edge,
        space=space_edge,
    )
    self._builder.append(
        EdgeQueryStep(
            name=self._builder.create_name(from_),
            expression=dm.query.EdgeResultSetExpression(
                filter=edge_filter,
                from_=from_,
                direction="outwards",
            ),
            max_retrieve_limit=limit,
        )
    )

    view_id = MetmastQueryAPI._view_id
    has_data = dm.filters.HasData(views=[view_id])
    node_filer = _create_metmast_filter(
        view_id,
        min_position,
        max_position,
        external_id_prefix,
        space,
        (filter and dm.filters.And(filter, has_data)) or has_data,
    )
    if retrieve_nacelle:
        self._query_append_nacelle(from_)
    if retrieve_rotor:
        self._query_append_rotor(from_)
    return MetmastQueryAPI(self._client, self._builder, node_filer, limit)

query(retrieve_nacelle=False, retrieve_rotor=False)

Execute query and return the result.

Parameters:

Name Type Description Default
retrieve_nacelle bool

Whether to retrieve the nacelle for each windmill or not.

False
retrieve_rotor bool

Whether to retrieve the rotor for each windmill or not.

False

Returns:

Type Description
T_DomainModelList

The list of the source nodes of the query.

Source code in examples/windmill/_api/windmill_query.py
def query(
    self,
    retrieve_nacelle: bool = False,
    retrieve_rotor: bool = False,
) -> T_DomainModelList:
    """Execute query and return the result.

    Args:
        retrieve_nacelle: Whether to retrieve the nacelle for each windmill or not.
        retrieve_rotor: Whether to retrieve the rotor for each windmill or not.

    Returns:
        The list of the source nodes of the query.

    """
    from_ = self._builder[-1].name
    if retrieve_nacelle:
        self._query_append_nacelle(from_)
    if retrieve_rotor:
        self._query_append_rotor(from_)
    return self._query()