nominal 1.101.0__py3-none-any.whl → 1.103.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- CHANGELOG.md +23 -0
- nominal/core/__init__.py +3 -1
- nominal/core/_event_types.py +100 -0
- nominal/core/_types.py +6 -0
- nominal/core/_utils/query_tools.py +52 -1
- nominal/core/asset.py +87 -41
- nominal/core/attachment.py +3 -1
- nominal/core/client.py +24 -52
- nominal/core/connection.py +3 -3
- nominal/core/dataset.py +17 -16
- nominal/core/dataset_file.py +5 -2
- nominal/core/datasource.py +4 -4
- nominal/core/event.py +9 -82
- nominal/core/filetype.py +7 -5
- nominal/core/run.py +6 -3
- nominal/core/video.py +3 -2
- nominal/experimental/migration/migration_utils.py +189 -10
- nominal/experimental/rust_streaming/rust_write_stream.py +3 -2
- nominal/experimental/video_processing/video_conversion.py +5 -2
- nominal/nominal.py +9 -8
- nominal/thirdparty/tdms/_tdms.py +4 -3
- {nominal-1.101.0.dist-info → nominal-1.103.0.dist-info}/METADATA +1 -1
- {nominal-1.101.0.dist-info → nominal-1.103.0.dist-info}/RECORD +26 -24
- {nominal-1.101.0.dist-info → nominal-1.103.0.dist-info}/WHEEL +0 -0
- {nominal-1.101.0.dist-info → nominal-1.103.0.dist-info}/entry_points.txt +0 -0
- {nominal-1.101.0.dist-info → nominal-1.103.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -2,8 +2,9 @@ import json
|
|
|
2
2
|
import logging
|
|
3
3
|
import re
|
|
4
4
|
import uuid
|
|
5
|
+
from datetime import datetime, timedelta
|
|
5
6
|
from pathlib import Path
|
|
6
|
-
from typing import Any, BinaryIO, Mapping, Sequence, TypeVar, Union, cast, overload
|
|
7
|
+
from typing import Any, BinaryIO, Iterable, Mapping, Sequence, TypeVar, Union, cast, overload
|
|
7
8
|
|
|
8
9
|
import requests
|
|
9
10
|
from conjure_python_client import ConjureBeanType, ConjureEnumType, ConjureUnionType
|
|
@@ -11,7 +12,24 @@ from conjure_python_client._serde.decoder import ConjureDecoder
|
|
|
11
12
|
from conjure_python_client._serde.encoder import ConjureEncoder
|
|
12
13
|
from nominal_api import scout_layout_api, scout_template_api, scout_workbookcommon_api
|
|
13
14
|
|
|
14
|
-
from nominal.core import
|
|
15
|
+
from nominal.core import (
|
|
16
|
+
Asset,
|
|
17
|
+
Dataset,
|
|
18
|
+
DatasetFile,
|
|
19
|
+
Event,
|
|
20
|
+
FileType,
|
|
21
|
+
NominalClient,
|
|
22
|
+
Workbook,
|
|
23
|
+
WorkbookTemplate,
|
|
24
|
+
)
|
|
25
|
+
from nominal.core._event_types import EventType, SearchEventOriginType
|
|
26
|
+
from nominal.core._utils.api_tools import Link, LinkDict
|
|
27
|
+
from nominal.core.attachment import Attachment
|
|
28
|
+
from nominal.core.run import Run
|
|
29
|
+
from nominal.ts import (
|
|
30
|
+
IntegralNanosecondsDuration,
|
|
31
|
+
IntegralNanosecondsUTC,
|
|
32
|
+
)
|
|
15
33
|
|
|
16
34
|
logger = logging.getLogger(__name__)
|
|
17
35
|
|
|
@@ -278,7 +296,9 @@ def copy_workbook_template_from(
|
|
|
278
296
|
Returns:
|
|
279
297
|
The newly created WorkbookTemplate in the target workspace.
|
|
280
298
|
"""
|
|
281
|
-
log_extras = {
|
|
299
|
+
log_extras = {
|
|
300
|
+
"destination_client_workspace": destination_client.get_workspace(destination_client._clients.workspace_rid).rid
|
|
301
|
+
}
|
|
282
302
|
logger.debug(
|
|
283
303
|
"Cloning workbook template: %s (rid: %s)", source_template.title, source_template.rid, extra=log_extras
|
|
284
304
|
)
|
|
@@ -315,7 +335,7 @@ def copy_workbook_template_from(
|
|
|
315
335
|
layout=new_template_layout,
|
|
316
336
|
content=new_workbook_content,
|
|
317
337
|
commit_message="Cloned from template",
|
|
318
|
-
workspace_rid=destination_client.get_workspace().rid,
|
|
338
|
+
workspace_rid=destination_client.get_workspace(destination_client._clients.workspace_rid).rid,
|
|
319
339
|
)
|
|
320
340
|
logger.debug(
|
|
321
341
|
"New workbook template created %s from %s (rid: %s)",
|
|
@@ -418,7 +438,9 @@ def copy_dataset_from(
|
|
|
418
438
|
Returns:
|
|
419
439
|
The newly created Dataset in the destination client.
|
|
420
440
|
"""
|
|
421
|
-
log_extras = {
|
|
441
|
+
log_extras = {
|
|
442
|
+
"destination_client_workspace": destination_client.get_workspace(destination_client._clients.workspace_rid).rid
|
|
443
|
+
}
|
|
422
444
|
logger.debug(
|
|
423
445
|
"Copying dataset %s (rid: %s)",
|
|
424
446
|
source_dataset.name,
|
|
@@ -438,6 +460,141 @@ def copy_dataset_from(
|
|
|
438
460
|
return new_dataset
|
|
439
461
|
|
|
440
462
|
|
|
463
|
+
def clone_event(source_event: Event, destination_client: NominalClient) -> Event:
|
|
464
|
+
"""Clones an event, maintaining all properties and linked assets.
|
|
465
|
+
|
|
466
|
+
Args:
|
|
467
|
+
source_event (Event): The event to copy from.
|
|
468
|
+
destination_client (NominalClient): The destination client.
|
|
469
|
+
|
|
470
|
+
Returns:
|
|
471
|
+
The cloned event.
|
|
472
|
+
"""
|
|
473
|
+
return copy_event_from(source_event=source_event, destination_client=destination_client)
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
def copy_event_from(
|
|
477
|
+
source_event: Event,
|
|
478
|
+
destination_client: NominalClient,
|
|
479
|
+
*,
|
|
480
|
+
new_name: str | None = None,
|
|
481
|
+
new_type: EventType | None = None,
|
|
482
|
+
new_start: datetime | IntegralNanosecondsUTC | None = None,
|
|
483
|
+
new_duration: timedelta | IntegralNanosecondsDuration = timedelta(),
|
|
484
|
+
new_description: str | None = None,
|
|
485
|
+
new_assets: Iterable[Asset | str] = (),
|
|
486
|
+
new_properties: Mapping[str, str] | None = None,
|
|
487
|
+
new_labels: Iterable[str] = (),
|
|
488
|
+
) -> Event:
|
|
489
|
+
"""Copy an event from the source to the destination client.
|
|
490
|
+
|
|
491
|
+
Args:
|
|
492
|
+
source_event: The source Event to copy.
|
|
493
|
+
destination_client: The NominalClient to create the copied event in.
|
|
494
|
+
new_name: Optional new name for the copied event. If not provided, the original name is used.
|
|
495
|
+
new_type: Optional new type for the copied event. If not provided, the original type is used.
|
|
496
|
+
new_start: Optional new start time for the copied event. If not provided, the original start time is used.
|
|
497
|
+
new_duration: Optional new duration for the copied event. If not provided, the original duration is used.
|
|
498
|
+
new_description: Optional new description for the copied event. If not provided, the original description used.
|
|
499
|
+
new_assets: Optional new assets for the copied event. If not provided, the original assets are used.
|
|
500
|
+
new_properties: Optional new properties for the copied event. If not provided, the original properties are used.
|
|
501
|
+
new_labels: Optional new labels for the copied event. If not provided, the original labels are used.
|
|
502
|
+
|
|
503
|
+
Returns:
|
|
504
|
+
The newly created Event in the destination client.
|
|
505
|
+
"""
|
|
506
|
+
log_extras = {
|
|
507
|
+
"destination_client_workspace": destination_client.get_workspace(destination_client._clients.workspace_rid).rid
|
|
508
|
+
}
|
|
509
|
+
logger.debug(
|
|
510
|
+
"Copying event %s (rid: %s)",
|
|
511
|
+
source_event.name,
|
|
512
|
+
source_event.rid,
|
|
513
|
+
extra=log_extras,
|
|
514
|
+
)
|
|
515
|
+
new_event = destination_client.create_event(
|
|
516
|
+
name=new_name or source_event.name,
|
|
517
|
+
type=new_type or source_event.type,
|
|
518
|
+
start=new_start or source_event.start,
|
|
519
|
+
duration=new_duration or source_event.duration,
|
|
520
|
+
description=new_description or source_event.description,
|
|
521
|
+
assets=new_assets or source_event.asset_rids,
|
|
522
|
+
properties=new_properties or source_event.properties,
|
|
523
|
+
labels=new_labels or source_event.labels,
|
|
524
|
+
)
|
|
525
|
+
logger.debug("New event created: %s (rid: %s)", new_event.name, new_event.rid, extra=log_extras)
|
|
526
|
+
return new_event
|
|
527
|
+
|
|
528
|
+
|
|
529
|
+
def clone_run(source_run: Run, destination_client: NominalClient) -> Run:
|
|
530
|
+
"""Clones a run, maintaining all properties, linked assets, and attachments.
|
|
531
|
+
|
|
532
|
+
Args:
|
|
533
|
+
source_run: The run to copy from.
|
|
534
|
+
destination_client: The destination client.
|
|
535
|
+
|
|
536
|
+
Returns:
|
|
537
|
+
The cloned run.
|
|
538
|
+
"""
|
|
539
|
+
return copy_run_from(source_run=source_run, destination_client=destination_client)
|
|
540
|
+
|
|
541
|
+
|
|
542
|
+
def copy_run_from(
|
|
543
|
+
source_run: Run,
|
|
544
|
+
destination_client: NominalClient,
|
|
545
|
+
*,
|
|
546
|
+
new_name: str | None = None,
|
|
547
|
+
new_start: datetime | IntegralNanosecondsUTC | None = None,
|
|
548
|
+
new_end: datetime | IntegralNanosecondsUTC | None = None,
|
|
549
|
+
new_description: str | None = None,
|
|
550
|
+
new_properties: Mapping[str, str] | None = None,
|
|
551
|
+
new_labels: Sequence[str] = (),
|
|
552
|
+
new_links: Sequence[str | Link | LinkDict] = (),
|
|
553
|
+
new_attachments: Iterable[Attachment] | Iterable[str] = (),
|
|
554
|
+
new_assets: Sequence[Asset | str] = (),
|
|
555
|
+
) -> Run:
|
|
556
|
+
"""Copy a run from the source to the destination client.
|
|
557
|
+
|
|
558
|
+
Args:
|
|
559
|
+
source_run: The source Run to copy.
|
|
560
|
+
destination_client: The NominalClient to create the copied run in.
|
|
561
|
+
new_name: Optionally override the name of the copied run. Defaults to original name.
|
|
562
|
+
new_start: Optionally override the start time of the copied run. Defaults to original start time.
|
|
563
|
+
new_end: Optionally override the end time of the copied run. Defaults to original end time.
|
|
564
|
+
new_description: Optionally override the description of the copied run. Defaults to original description.
|
|
565
|
+
new_properties: Optionally override the properties of the copied run. Defaults to original properties.
|
|
566
|
+
new_labels: Optionally override the labels of the copied run. Defaults to original labels.
|
|
567
|
+
new_links: Optionally override the links of the copied run. Defaults to original links.
|
|
568
|
+
new_attachments: Optionally override the attachments of the copied run. Defaults to original attachments.
|
|
569
|
+
new_assets: Optionally override the linked assets of the copied run. Defaults to original linked assets.
|
|
570
|
+
|
|
571
|
+
Returns:
|
|
572
|
+
The newly created Run in the destination client.
|
|
573
|
+
"""
|
|
574
|
+
log_extras = {
|
|
575
|
+
"destination_client_workspace": destination_client.get_workspace(destination_client._clients.workspace_rid).rid
|
|
576
|
+
}
|
|
577
|
+
logger.debug(
|
|
578
|
+
"Copying run %s (rid: %s)",
|
|
579
|
+
source_run.name,
|
|
580
|
+
source_run.rid,
|
|
581
|
+
extra=log_extras,
|
|
582
|
+
)
|
|
583
|
+
new_run = destination_client.create_run(
|
|
584
|
+
name=new_name or source_run.name,
|
|
585
|
+
start=new_start or source_run.start,
|
|
586
|
+
end=new_end or source_run.end,
|
|
587
|
+
description=new_description or source_run.description,
|
|
588
|
+
properties=new_properties or source_run.properties,
|
|
589
|
+
labels=new_labels or source_run.labels,
|
|
590
|
+
assets=new_assets or source_run.assets,
|
|
591
|
+
links=new_links or source_run.links,
|
|
592
|
+
attachments=new_attachments or source_run.list_attachments(),
|
|
593
|
+
)
|
|
594
|
+
logger.debug("New run created: %s (rid: %s)", new_run.name, new_run.rid, extra=log_extras)
|
|
595
|
+
return new_run
|
|
596
|
+
|
|
597
|
+
|
|
441
598
|
def clone_asset(
|
|
442
599
|
source_asset: Asset,
|
|
443
600
|
destination_client: NominalClient,
|
|
@@ -451,7 +608,13 @@ def clone_asset(
|
|
|
451
608
|
Returns:
|
|
452
609
|
The newly created Asset in the target client.
|
|
453
610
|
"""
|
|
454
|
-
return copy_asset_from(
|
|
611
|
+
return copy_asset_from(
|
|
612
|
+
source_asset=source_asset,
|
|
613
|
+
destination_client=destination_client,
|
|
614
|
+
include_data=True,
|
|
615
|
+
include_events=True,
|
|
616
|
+
include_runs=True,
|
|
617
|
+
)
|
|
455
618
|
|
|
456
619
|
|
|
457
620
|
def copy_asset_from(
|
|
@@ -463,6 +626,8 @@ def copy_asset_from(
|
|
|
463
626
|
new_asset_properties: dict[str, Any] | None = None,
|
|
464
627
|
new_asset_labels: Sequence[str] | None = None,
|
|
465
628
|
include_data: bool = False,
|
|
629
|
+
include_events: bool = False,
|
|
630
|
+
include_runs: bool = False,
|
|
466
631
|
) -> Asset:
|
|
467
632
|
"""Copy an asset from the source to the destination client.
|
|
468
633
|
|
|
@@ -474,11 +639,15 @@ def copy_asset_from(
|
|
|
474
639
|
new_asset_properties: Optional new properties for the copied asset. If not provided, original properties used.
|
|
475
640
|
new_asset_labels: Optional new labels for the copied asset. If not provided, the original labels are used.
|
|
476
641
|
include_data: Whether to include data in the copied asset.
|
|
642
|
+
include_events: Whether to include events in the copied dataset.
|
|
643
|
+
include_runs: Whether to include runs in the copied asset.
|
|
477
644
|
|
|
478
645
|
Returns:
|
|
479
646
|
The new asset created.
|
|
480
647
|
"""
|
|
481
|
-
log_extras = {
|
|
648
|
+
log_extras = {
|
|
649
|
+
"destination_client_workspace": destination_client.get_workspace(destination_client._clients.workspace_rid).rid
|
|
650
|
+
}
|
|
482
651
|
logger.debug("Copying asset %s (rid: %s)", source_asset.name, source_asset.rid, extra=log_extras)
|
|
483
652
|
new_asset = destination_client.create_asset(
|
|
484
653
|
name=new_asset_name if new_asset_name is not None else source_asset.name,
|
|
@@ -488,14 +657,24 @@ def copy_asset_from(
|
|
|
488
657
|
)
|
|
489
658
|
if include_data:
|
|
490
659
|
source_datasets = source_asset.list_datasets()
|
|
491
|
-
new_datasets = []
|
|
492
660
|
for data_scope, source_dataset in source_datasets:
|
|
493
661
|
new_dataset = clone_dataset(
|
|
494
662
|
source_dataset=source_dataset,
|
|
495
663
|
destination_client=destination_client,
|
|
496
664
|
)
|
|
497
|
-
new_datasets.append(new_dataset)
|
|
498
665
|
new_asset.add_dataset(data_scope, new_dataset)
|
|
666
|
+
source_asset._list_dataset_scopes
|
|
667
|
+
|
|
668
|
+
if include_events:
|
|
669
|
+
source_events = source_asset.search_events(origin_types=SearchEventOriginType.get_manual_origin_types())
|
|
670
|
+
for source_event in source_events:
|
|
671
|
+
copy_event_from(source_event, destination_client, new_assets=[new_asset])
|
|
672
|
+
|
|
673
|
+
if include_runs:
|
|
674
|
+
source_runs = source_asset.list_runs()
|
|
675
|
+
for source_run in source_runs:
|
|
676
|
+
copy_run_from(source_run, destination_client, new_assets=[new_asset])
|
|
677
|
+
|
|
499
678
|
logger.debug("New asset created: %s (rid: %s)", new_asset, new_asset.rid, extra=log_extras)
|
|
500
679
|
return new_asset
|
|
501
680
|
|
|
@@ -518,7 +697,7 @@ def copy_resources_to_destination_client(
|
|
|
518
697
|
All of the created resources.
|
|
519
698
|
"""
|
|
520
699
|
log_extras = {
|
|
521
|
-
"destination_client_workspace": destination_client.get_workspace().rid,
|
|
700
|
+
"destination_client_workspace": destination_client.get_workspace(destination_client._clients.workspace_rid).rid,
|
|
522
701
|
}
|
|
523
702
|
|
|
524
703
|
if len(source_assets) != 1:
|
|
@@ -6,6 +6,7 @@ import pathlib
|
|
|
6
6
|
from nominal_streaming import NominalDatasetStream
|
|
7
7
|
|
|
8
8
|
from nominal.core._stream.write_stream import DataStream
|
|
9
|
+
from nominal.core._types import PathLike
|
|
9
10
|
from nominal.core.datasource import DataSource
|
|
10
11
|
|
|
11
12
|
|
|
@@ -22,7 +23,7 @@ class RustWriteStream(NominalDatasetStream, DataStream):
|
|
|
22
23
|
datasource_clients: DataSource._Clients,
|
|
23
24
|
batch_size: int,
|
|
24
25
|
max_wait: datetime.timedelta,
|
|
25
|
-
file_fallback:
|
|
26
|
+
file_fallback: PathLike | None = None,
|
|
26
27
|
log_level: str | None = None,
|
|
27
28
|
num_workers: int | None = None,
|
|
28
29
|
) -> RustWriteStream:
|
|
@@ -41,7 +42,7 @@ class RustWriteStream(NominalDatasetStream, DataStream):
|
|
|
41
42
|
).with_core_consumer(datasource_rid)
|
|
42
43
|
|
|
43
44
|
if file_fallback is not None:
|
|
44
|
-
stream = stream.with_file_fallback(file_fallback)
|
|
45
|
+
stream = stream.with_file_fallback(pathlib.Path(file_fallback))
|
|
45
46
|
|
|
46
47
|
if log_level is not None:
|
|
47
48
|
stream = stream.enable_logging(log_level)
|
|
@@ -6,6 +6,7 @@ import shlex
|
|
|
6
6
|
|
|
7
7
|
import ffmpeg
|
|
8
8
|
|
|
9
|
+
from nominal.core._types import PathLike
|
|
9
10
|
from nominal.experimental.video_processing.resolution import (
|
|
10
11
|
AnyResolutionType,
|
|
11
12
|
scale_factor_from_resolution,
|
|
@@ -20,8 +21,8 @@ DEFAULT_KEY_FRAME_INTERVAL_SEC = 2
|
|
|
20
21
|
|
|
21
22
|
|
|
22
23
|
def normalize_video(
|
|
23
|
-
input_path:
|
|
24
|
-
output_path:
|
|
24
|
+
input_path: PathLike,
|
|
25
|
+
output_path: PathLike,
|
|
25
26
|
key_frame_interval: int | None = DEFAULT_KEY_FRAME_INTERVAL_SEC,
|
|
26
27
|
force: bool = True,
|
|
27
28
|
resolution: AnyResolutionType | None = None,
|
|
@@ -59,6 +60,8 @@ def normalize_video(
|
|
|
59
60
|
|
|
60
61
|
NOTE: this requires that you have installed ffmpeg on your system with support for H264.
|
|
61
62
|
"""
|
|
63
|
+
input_path = pathlib.Path(input_path)
|
|
64
|
+
output_path = pathlib.Path(output_path)
|
|
62
65
|
assert input_path.exists(), "Input path must exist"
|
|
63
66
|
assert output_path.suffix.lower() in (".mkv", ".mp4")
|
|
64
67
|
|
nominal/nominal.py
CHANGED
|
@@ -24,6 +24,7 @@ from nominal.core import (
|
|
|
24
24
|
poll_until_ingestion_completed,
|
|
25
25
|
)
|
|
26
26
|
from nominal.core._constants import DEFAULT_API_BASE_URL
|
|
27
|
+
from nominal.core._types import PathLike
|
|
27
28
|
from nominal.core.connection import StreamingConnection
|
|
28
29
|
from nominal.core.data_review import DataReview, DataReviewBuilder
|
|
29
30
|
|
|
@@ -102,7 +103,7 @@ def get_user() -> User:
|
|
|
102
103
|
"Use `nominal.thirdparty.tdms.upload_tdms` instead."
|
|
103
104
|
)
|
|
104
105
|
def upload_tdms(
|
|
105
|
-
file:
|
|
106
|
+
file: PathLike,
|
|
106
107
|
name: str | None = None,
|
|
107
108
|
description: str | None = None,
|
|
108
109
|
timestamp_column: str | None = None,
|
|
@@ -213,7 +214,7 @@ def create_dataset(
|
|
|
213
214
|
"Use `nominal.create_dataset` or `nominal.get_dataset`, add data to an existing dataset instead."
|
|
214
215
|
)
|
|
215
216
|
def upload_csv(
|
|
216
|
-
file:
|
|
217
|
+
file: PathLike,
|
|
217
218
|
name: str | None,
|
|
218
219
|
timestamp_column: str,
|
|
219
220
|
timestamp_type: ts._AnyTimestampType,
|
|
@@ -245,7 +246,7 @@ def upload_csv(
|
|
|
245
246
|
|
|
246
247
|
def _upload_csv(
|
|
247
248
|
client: NominalClient,
|
|
248
|
-
file:
|
|
249
|
+
file: PathLike,
|
|
249
250
|
name: str | None,
|
|
250
251
|
timestamp_column: str,
|
|
251
252
|
timestamp_type: ts._AnyTimestampType,
|
|
@@ -317,7 +318,7 @@ def create_run(
|
|
|
317
318
|
f"see {AUTHENTICATION_DOCS_LINK}"
|
|
318
319
|
)
|
|
319
320
|
def create_run_csv(
|
|
320
|
-
file:
|
|
321
|
+
file: PathLike,
|
|
321
322
|
name: str,
|
|
322
323
|
timestamp_column: str,
|
|
323
324
|
timestamp_type: ts._LiteralAbsolute | ts.Iso8601 | ts.Epoch,
|
|
@@ -379,7 +380,7 @@ def search_runs(
|
|
|
379
380
|
f"Use `nominal.NominalClient.create_attachment` instead, see {AUTHENTICATION_DOCS_LINK}"
|
|
380
381
|
)
|
|
381
382
|
def upload_attachment(
|
|
382
|
-
file:
|
|
383
|
+
file: PathLike,
|
|
383
384
|
name: str,
|
|
384
385
|
description: str | None = None,
|
|
385
386
|
) -> Attachment:
|
|
@@ -406,7 +407,7 @@ def get_attachment(rid: str) -> Attachment:
|
|
|
406
407
|
"Use `nominal.NominalClient.get_attachment` and `nominal.core.Attachment.write` instead, "
|
|
407
408
|
f"see {AUTHENTICATION_DOCS_LINK}"
|
|
408
409
|
)
|
|
409
|
-
def download_attachment(rid: str, file:
|
|
410
|
+
def download_attachment(rid: str, file: PathLike) -> None:
|
|
410
411
|
"""Retrieve an attachment from the Nominal platform and save it to `file`."""
|
|
411
412
|
client = _get_default_client()
|
|
412
413
|
attachment = client.get_attachment(rid)
|
|
@@ -418,7 +419,7 @@ def download_attachment(rid: str, file: Path | str) -> None:
|
|
|
418
419
|
f"Use `nominal.NominalClient.create_video` instead, see {AUTHENTICATION_DOCS_LINK}"
|
|
419
420
|
)
|
|
420
421
|
def upload_video(
|
|
421
|
-
file:
|
|
422
|
+
file: PathLike, name: str, start: datetime | str | ts.IntegralNanosecondsUTC, description: str | None = None
|
|
422
423
|
) -> Video:
|
|
423
424
|
"""Upload a video to Nominal from a file."""
|
|
424
425
|
client = _get_default_client()
|
|
@@ -542,7 +543,7 @@ def get_checklist(checklist_rid: str) -> Checklist:
|
|
|
542
543
|
f"Use `nominal.NominalClient.create_mcap_video` instead, see {AUTHENTICATION_DOCS_LINK}"
|
|
543
544
|
)
|
|
544
545
|
def upload_mcap_video(
|
|
545
|
-
file:
|
|
546
|
+
file: PathLike,
|
|
546
547
|
topic: str,
|
|
547
548
|
name: str | None = None,
|
|
548
549
|
description: str | None = None,
|
nominal/thirdparty/tdms/_tdms.py
CHANGED
|
@@ -10,6 +10,7 @@ import pandas as pd
|
|
|
10
10
|
from nptdms import TdmsChannel, TdmsFile, TdmsGroup
|
|
11
11
|
|
|
12
12
|
from nominal import ts
|
|
13
|
+
from nominal.core._types import PathLike
|
|
13
14
|
from nominal.core.client import NominalClient
|
|
14
15
|
from nominal.core.dataset import Dataset
|
|
15
16
|
from nominal.core.dataset_file import DatasetFile
|
|
@@ -19,7 +20,7 @@ logger = logging.getLogger(__name__)
|
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
def _tdms_to_dataframe(
|
|
22
|
-
file:
|
|
23
|
+
file: PathLike,
|
|
23
24
|
timestamp_column: str | None = None,
|
|
24
25
|
timestamp_type: ts._AnyTimestampType | None = None,
|
|
25
26
|
) -> Tuple[str, ts._AnyTimestampType, pd.DataFrame]:
|
|
@@ -46,7 +47,7 @@ def _tdms_to_dataframe(
|
|
|
46
47
|
|
|
47
48
|
def upload_tdms_to_dataset(
|
|
48
49
|
dataset: Dataset,
|
|
49
|
-
file:
|
|
50
|
+
file: PathLike,
|
|
50
51
|
timestamp_column: str | None = None,
|
|
51
52
|
timestamp_type: ts._AnyTimestampType | None = None,
|
|
52
53
|
*,
|
|
@@ -91,7 +92,7 @@ def upload_tdms_to_dataset(
|
|
|
91
92
|
|
|
92
93
|
def upload_tdms(
|
|
93
94
|
client: NominalClient,
|
|
94
|
-
file:
|
|
95
|
+
file: PathLike,
|
|
95
96
|
name: str | None = None,
|
|
96
97
|
description: str | None = None,
|
|
97
98
|
timestamp_column: str | None = None,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
CHANGELOG.md,sha256=
|
|
1
|
+
CHANGELOG.md,sha256=dZLFxX1LixFKq5t-wqt4IkqEptjE12o8iDYP-SFO6L4,86532
|
|
2
2
|
LICENSE,sha256=zEGHG9mjDjaIS3I79O8mweQo-yiTbqx8jJvUPppVAwk,1067
|
|
3
3
|
README.md,sha256=KKe0dxh_pHXCtB7I9G4qWGQYvot_BZU8yW6MJyuyUHM,311
|
|
4
4
|
nominal/__init__.py,sha256=rbraORnXUrNn1hywLXM0XwSQCd9UmQt20PDYlsBalfE,2167
|
|
5
5
|
nominal/__main__.py,sha256=Q0LHBl9ecbFcF6q0ef83f65WEYEQ55q1gfHhp4IUqy0,285
|
|
6
|
-
nominal/nominal.py,sha256=
|
|
6
|
+
nominal/nominal.py,sha256=sbN7clV3OHfsaf72OXnTbP5R54B_WlzZlDUlRzTrPuk,23153
|
|
7
7
|
nominal/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
8
|
nominal/_utils/README.md,sha256=1qJE6MSjrHb-JF4L7TJC2r8_OXwnb3gaLvuevXMOOK0,364
|
|
9
9
|
nominal/_utils/__init__.py,sha256=v4WWEY4uC37KX_3xfHEJoF-qfIZ3dftMcuIdGnvtX_8,465
|
|
@@ -27,30 +27,32 @@ nominal/cli/util/global_decorators.py,sha256=SBxhz4KbMlWDcCV08feouftd3HLnBNR-JJt
|
|
|
27
27
|
nominal/cli/util/verify_connection.py,sha256=KU17ejaDfKBLmLiZ3MZSVLyfrqNE7c6mFBvskhqQLCo,1902
|
|
28
28
|
nominal/config/__init__.py,sha256=wV8cq8X3J4NTJ5H_uR5THaMT_NQpWQO5qCUGEb-rPnM,3157
|
|
29
29
|
nominal/config/_config.py,sha256=yKq_H1iYJDoxRfLz2iXLbbVdoL0MTEY0FS4eVL12w0g,2004
|
|
30
|
-
nominal/core/__init__.py,sha256=
|
|
30
|
+
nominal/core/__init__.py,sha256=1MiCC44cxHYFofP4hf2fz4EIkepK-OAhDzpPFIzHbWw,2422
|
|
31
31
|
nominal/core/_clientsbunch.py,sha256=YwciugX7rQ9AOPHyvKuavG7b9SlX1PURRquP37nvLqE,8458
|
|
32
32
|
nominal/core/_constants.py,sha256=SrxgaSqAEB1MvTSrorgGam3eO29iCmRr6VIdajxX3gI,56
|
|
33
|
-
nominal/core/
|
|
34
|
-
nominal/core/
|
|
33
|
+
nominal/core/_event_types.py,sha256=Cq_8x-zv_5EDvRo9UTbaOpenAy92bTfQxlsEuHPOhtE,3706
|
|
34
|
+
nominal/core/_types.py,sha256=FktMmcQ5_rD2rbXv8_p-WISzSo8T2NtO-exsLm-iadU,122
|
|
35
|
+
nominal/core/asset.py,sha256=-hNMGXiU1dPWfrzmOngbab-Hf6vfq2Rm_j0FP-woJ-s,23120
|
|
36
|
+
nominal/core/attachment.py,sha256=yOtDUdkLY5MT_Rk9kUlr1yupIJN7a5pt5sJWx4RLQV8,4355
|
|
35
37
|
nominal/core/bounds.py,sha256=742BWmGL3FBryRAjoiJRg2N6aVinjYkQLxN7kfnJ40Q,581
|
|
36
38
|
nominal/core/channel.py,sha256=dbe8wpfMiWqHu98x66w6GOmC9Ro33Wv9AhBVx2DvtVk,18970
|
|
37
39
|
nominal/core/checklist.py,sha256=rO1RPDYV3o2miPKF7DcCiYpj6bUN-sdtZNhJkXzkfYE,7110
|
|
38
|
-
nominal/core/client.py,sha256=
|
|
39
|
-
nominal/core/connection.py,sha256=
|
|
40
|
+
nominal/core/client.py,sha256=Awt9WPkE-YXBfOwJMTL7Su8AZFJY3UMH7IKp5hI26YQ,68328
|
|
41
|
+
nominal/core/connection.py,sha256=LYllr3a1H2xp8-i4MaX1M7yK8X-HnwuIkciyK9XgLtQ,5175
|
|
40
42
|
nominal/core/containerized_extractors.py,sha256=fUz3-NHoNWYKqOCD15gLwGXDKVfdsW-x_kpXnkOI3BE,10224
|
|
41
43
|
nominal/core/data_review.py,sha256=bEnRsd8LI4x9YOBPcF2H3h5-e12A7Gh8gQfsNUAZmPQ,7922
|
|
42
|
-
nominal/core/dataset.py,sha256=
|
|
43
|
-
nominal/core/dataset_file.py,sha256=
|
|
44
|
-
nominal/core/datasource.py,sha256=
|
|
45
|
-
nominal/core/event.py,sha256=
|
|
44
|
+
nominal/core/dataset.py,sha256=NRAKKoO6L3fiwd3voo_U-Ow6FZzW2UrfRXcyF2kPR3o,46636
|
|
45
|
+
nominal/core/dataset_file.py,sha256=8rCW6MO89MFbQ2NH0WtFWmJfRWeTxhmyuoGojuQQ4Qg,16545
|
|
46
|
+
nominal/core/datasource.py,sha256=V5UahbqsCNIdml978kOHiY6boIxKxbp76KscNBpN5xc,16934
|
|
47
|
+
nominal/core/event.py,sha256=8trZXyuAqRlKedgcqSgDIimXAAJBmEfDLyHkOOBwUC0,7762
|
|
46
48
|
nominal/core/exceptions.py,sha256=GUpwXRgdYamLl6684FE8ttCRHkBx6WEhOZ3NPE-ybD4,2671
|
|
47
|
-
nominal/core/filetype.py,sha256=
|
|
49
|
+
nominal/core/filetype.py,sha256=R8goHGW4SP0iO6AoQiUil2tNVuDgaQoHclftRbw44oc,5558
|
|
48
50
|
nominal/core/log.py,sha256=z3hI3CIEyMwpUSWjwBsJ6a3JNGzBbsmrVusSU6uI7CY,3885
|
|
49
|
-
nominal/core/run.py,sha256=
|
|
51
|
+
nominal/core/run.py,sha256=IqXCP24UhdHKkss0LbXU_zAhx-7Pf2MIQI-lic_-quw,17987
|
|
50
52
|
nominal/core/secret.py,sha256=Ckq48m60i7rktxL9GY-nxHU5v8gHv9F1-JN7_MSf4bM,2863
|
|
51
53
|
nominal/core/unit.py,sha256=Wa-Bvu0hD-nzxVaQJSnn5YqAfnhUd2kWw2SswXnbMHY,3161
|
|
52
54
|
nominal/core/user.py,sha256=FV333TN4pQzcLh5b2CfxvBnnXyB1TrOP8Ppx1-XdaiE,481
|
|
53
|
-
nominal/core/video.py,sha256=
|
|
55
|
+
nominal/core/video.py,sha256=xQhDAiKzKuLsS3O6orKMvxejWVwDNK1ik56j4phMobE,16113
|
|
54
56
|
nominal/core/video_file.py,sha256=dNAxFNAYwCBUiloCVt62fQymJtI_hK0NGgBXaVWqCXU,5669
|
|
55
57
|
nominal/core/workbook.py,sha256=lJo9ZaYm0TevAyIs239ZA-_1WUriTkj8i1lxvxH9TJw,8902
|
|
56
58
|
nominal/core/workbook_template.py,sha256=PBgQjEDVVQdZMlVea99BbhHdAr_bawknSvNKhNtDAq0,7125
|
|
@@ -67,7 +69,7 @@ nominal/core/_utils/multipart.py,sha256=0dA2XcTHuOQIyS0139O8WZiCjwePaD1sYDUmTgmW
|
|
|
67
69
|
nominal/core/_utils/multipart_downloader.py,sha256=16OJEPqxCwOnfjptYdrlwQVuSUQYoe9_iiW60ZSjWos,13859
|
|
68
70
|
nominal/core/_utils/networking.py,sha256=n9ZqYtnpwPCjz9C-4eixsTkrhFh-DW6lknBJlHckHhg,8200
|
|
69
71
|
nominal/core/_utils/pagination_tools.py,sha256=cEBY1WiA1d3cWJEM0myYF_pX8JdQ_e-5asngVXrUc_Y,12152
|
|
70
|
-
nominal/core/_utils/query_tools.py,sha256=
|
|
72
|
+
nominal/core/_utils/query_tools.py,sha256=0AuIZPtxR_BgrjBjRjc8fPjPKa9zicCe1xT9znVB_RA,16137
|
|
71
73
|
nominal/core/_utils/queueing.py,sha256=3qljc7dFI1UahlKjCaRVybM4poMCV5SayjyRPyXcPxg,3654
|
|
72
74
|
nominal/exceptions/__init__.py,sha256=W2r_GWJkZQQ6t3HooFjGRdhIgJq3fBvRV7Yn6gseoO0,415
|
|
73
75
|
nominal/experimental/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -85,15 +87,15 @@ nominal/experimental/logging/click_log_handler.py,sha256=ANLf4IGgmh95V0kJlr756wQ
|
|
|
85
87
|
nominal/experimental/logging/nominal_log_handler.py,sha256=hyTxyjsvFnE7vtyrDJpunAqADHmXekNWALwxXPIJGCk,5120
|
|
86
88
|
nominal/experimental/logging/rich_log_handler.py,sha256=8yz_VtxNgJg2oiesnXz2iXoBvQrUP5pAsYkxknOXgXA,1231
|
|
87
89
|
nominal/experimental/migration/__init__.py,sha256=E2IgWJLwJ5bN6jbl8k5nHECKFx5aT11jKAzVYcyXn3o,460
|
|
88
|
-
nominal/experimental/migration/migration_utils.py,sha256=
|
|
90
|
+
nominal/experimental/migration/migration_utils.py,sha256=hCfajIYn91U2_Q9UaXkYhbd5-u8HLEVA6aD7o5_ota8,30223
|
|
89
91
|
nominal/experimental/rust_streaming/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
90
|
-
nominal/experimental/rust_streaming/rust_write_stream.py,sha256=
|
|
92
|
+
nominal/experimental/rust_streaming/rust_write_stream.py,sha256=oQ6ixwm8ct8ZDc_qNB7AucDt8o5-_aBVlW2fFCQ_nmA,1541
|
|
91
93
|
nominal/experimental/stream_v2/__init__.py,sha256=W39vK46pssx5sXvmsImMuJiEPs7iGtwrbYBI0bWnXCY,2313
|
|
92
94
|
nominal/experimental/stream_v2/_serializer.py,sha256=DcGimcY1LsXNeCzOWrel3SwuvoRV4XLdOFjqjM7MgPY,1035
|
|
93
95
|
nominal/experimental/stream_v2/_write_stream.py,sha256=-EncNPXUDYaL1YpFlJFEkuLgcxMdyKEXS5JJzP_2LlI,9981
|
|
94
96
|
nominal/experimental/video_processing/__init__.py,sha256=08ksIeYuv4BbgTRqA5cnetKr8DRsPuuoAas0OTHirt0,654
|
|
95
97
|
nominal/experimental/video_processing/resolution.py,sha256=Z-34DaGDnJUcg-FvnxP-uNuNjXiE-7LvxZRugIvgOqk,3974
|
|
96
|
-
nominal/experimental/video_processing/video_conversion.py,sha256=
|
|
98
|
+
nominal/experimental/video_processing/video_conversion.py,sha256=JU7ELZjyFKQ7ij7nbyrpwwZCOiwYcQ3nrDk_Xh3GULY,6014
|
|
97
99
|
nominal/thirdparty/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
98
100
|
nominal/thirdparty/matlab/__init__.py,sha256=RANJJ6wbpGOrKRohcoFbRlOF8S4sZpSLWswElK954es,113
|
|
99
101
|
nominal/thirdparty/matlab/_matlab.py,sha256=qtrO_wP_o9J2oqiwhriSfL0LYO7rBzssoHygYQJiT30,10400
|
|
@@ -102,10 +104,10 @@ nominal/thirdparty/pandas/_pandas.py,sha256=QcM1tk-Z5W8bKd9oYz5rD6M3qIHZ0N5uUe_U
|
|
|
102
104
|
nominal/thirdparty/polars/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
103
105
|
nominal/thirdparty/polars/polars_export_handler.py,sha256=hGCSwXX9dC4MG01CmmjlTbcajktMYDb-GpNNTwLUsRw,32951
|
|
104
106
|
nominal/thirdparty/tdms/__init__.py,sha256=6n2ImFr2Wiil6JM1P5Q7Mpr0VzLcnDkmup_ftNpPq-s,142
|
|
105
|
-
nominal/thirdparty/tdms/_tdms.py,sha256=
|
|
107
|
+
nominal/thirdparty/tdms/_tdms.py,sha256=m4gxbpxB9MTLi2FuYvGlbUGSyDAZKFxbM3ia2x1wIz0,8746
|
|
106
108
|
nominal/ts/__init__.py,sha256=hmd0ENvDhxRnzDKGLxIub6QG8LpcxCgcyAct029CaEs,21442
|
|
107
|
-
nominal-1.
|
|
108
|
-
nominal-1.
|
|
109
|
-
nominal-1.
|
|
110
|
-
nominal-1.
|
|
111
|
-
nominal-1.
|
|
109
|
+
nominal-1.103.0.dist-info/METADATA,sha256=EigPuLvTA5TUP2SCA0vo49uLWuq4GDil1fN8D118I40,2277
|
|
110
|
+
nominal-1.103.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
111
|
+
nominal-1.103.0.dist-info/entry_points.txt,sha256=-mCLhxgg9R_lm5efT7vW9wuBH12izvY322R0a3TYxbE,66
|
|
112
|
+
nominal-1.103.0.dist-info/licenses/LICENSE,sha256=zEGHG9mjDjaIS3I79O8mweQo-yiTbqx8jJvUPppVAwk,1067
|
|
113
|
+
nominal-1.103.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|