Skip to content

Commit 3c8f0ef

Browse files
committed
fmt and update docs dependencies
1 parent 935dd64 commit 3c8f0ef

6 files changed

Lines changed: 51 additions & 43 deletions

File tree

python/lib/sift_client/_tests/integrated/calculated_channels.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,18 @@ async def main():
5656

5757
created_channels = []
5858
for i in range(num_channels):
59-
new_chan = CalculatedChannelCreate(name=f"test_channel_{unique_name_suffix}_{i}",
60-
description=f"Test calculated channel {i} - initial description",
61-
expression="$1 / $2", # $1 = mainmotor.velocity, $2 = voltage
62-
expression_channel_references=[
63-
ChannelReference(channel_reference="$1", channel_identifier="mainmotor.velocity"),
64-
ChannelReference(channel_reference="$2", channel_identifier="voltage"),
65-
],
66-
units="velocity/voltage",
67-
asset_ids=[asset_id],
68-
user_notes=f"Created for testing update fields - channel {i}",)
59+
new_chan = CalculatedChannelCreate(
60+
name=f"test_channel_{unique_name_suffix}_{i}",
61+
description=f"Test calculated channel {i} - initial description",
62+
expression="$1 / $2", # $1 = mainmotor.velocity, $2 = voltage
63+
expression_channel_references=[
64+
ChannelReference(channel_reference="$1", channel_identifier="mainmotor.velocity"),
65+
ChannelReference(channel_reference="$2", channel_identifier="voltage"),
66+
],
67+
units="velocity/voltage",
68+
asset_ids=[asset_id],
69+
user_notes=f"Created for testing update fields - channel {i}",
70+
)
6971
calculated_channel = client.calculated_channels.create(new_chan)
7072
created_channels.append(calculated_channel)
7173
print(

python/lib/sift_client/_tests/integrated/ingestion.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,12 @@ async def main():
4444
print(f" Deleting run: {run.name}")
4545
client.runs.archive(run=run)
4646

47-
run = client.runs.create(dict(
48-
name=f"test-run-{datetime.now(tz=timezone.utc).timestamp()}",
49-
description="A test run created via the API",
50-
tags=["api-created", "test"],)
47+
run = client.runs.create(
48+
dict(
49+
name=f"test-run-{datetime.now(tz=timezone.utc).timestamp()}",
50+
description="A test run created via the API",
51+
tags=["api-created", "test"],
52+
)
5153
)
5254

5355
regular_flow = Flow(

python/lib/sift_client/_tests/integrated/runs.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -213,15 +213,17 @@ async def main():
213213
print(f" Deleting run: {run.name}")
214214
client.runs.archive(run=run)
215215

216-
new_run = client.runs.create(dict(
217-
name=f"Example Test Run {datetime.now(tz=timezone.utc).strftime('%Y-%m-%d %H:%M:%S')}",
218-
description="A test run created via the API",
219-
tags=["api-created", "test"],
220-
start_time=start_time,
221-
stop_time=stop_time,
222-
# Use a unique client key for each run
223-
client_key=f"example-run-key-{datetime.now(tz=timezone.utc).timestamp()}",
224-
metadata=metadata,)
216+
new_run = client.runs.create(
217+
dict(
218+
name=f"Example Test Run {datetime.now(tz=timezone.utc).strftime('%Y-%m-%d %H:%M:%S')}",
219+
description="A test run created via the API",
220+
tags=["api-created", "test"],
221+
start_time=start_time,
222+
stop_time=stop_time,
223+
# Use a unique client key for each run
224+
client_key=f"example-run-key-{datetime.now(tz=timezone.utc).timestamp()}",
225+
metadata=metadata,
226+
)
225227
)
226228
print(f" Created run: {new_run.name} (ID: {new_run.id_})")
227229
print(f" Client key: {new_run.client_key}")

python/lib/sift_client/examples/generic_workflow_example.py

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,21 @@ async def main():
4848
else:
4949
# Create a calculated channel that divides mainmotor.velocity by voltage
5050
print("\nCreating calculated channel...")
51-
calculated_channel = client.calculated_channels.create(dict(
52-
name="velocity_per_voltage",
53-
description="Ratio of mainmotor velocity to voltage",
54-
expression="$1 / $2", # $1 = mainmotor.velocity, $2 = voltage
55-
channel_references=[
56-
ChannelReference(channel_reference="$1", channel_identifier="mainmotor.velocity"),
57-
ChannelReference(channel_reference="$2", channel_identifier="voltage"),
58-
],
59-
units="velocity/voltage",
60-
asset_ids=[asset_id],
61-
user_notes="Created to monitor velocity-to-voltage ratio",)
51+
calculated_channel = client.calculated_channels.create(
52+
dict(
53+
name="velocity_per_voltage",
54+
description="Ratio of mainmotor velocity to voltage",
55+
expression="$1 / $2", # $1 = mainmotor.velocity, $2 = voltage
56+
channel_references=[
57+
ChannelReference(
58+
channel_reference="$1", channel_identifier="mainmotor.velocity"
59+
),
60+
ChannelReference(channel_reference="$2", channel_identifier="voltage"),
61+
],
62+
units="velocity/voltage",
63+
asset_ids=[asset_id],
64+
user_notes="Created to monitor velocity-to-voltage ratio",
65+
)
6266
)
6367
print(
6468
f"Created calculated channel: {calculated_channel.name} (ID: {calculated_channel.calculated_channel_id})"

python/lib/sift_client/sift_types/calculated_channel.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,6 @@ class CalculatedChannel(BaseType[CalculatedChannelProto, "CalculatedChannel"]):
5050
created_by_user_id: str | None
5151
modified_by_user_id: str | None
5252

53-
@property
54-
def latest_version(self):
55-
...
56-
57-
@property
58-
def is_latest_version(self):
59-
...
60-
6153
@property
6254
def is_archived(self):
6355
"""Whether the calculated channel is archived."""

python/pyproject.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,13 @@ development = [
5757
"ruff~=0.12.10",
5858
]
5959
build = ["pdoc==14.5.0", "build==1.2.1"]
60-
docs = ["mkdocs", "mkdocs-material", "mkdocstrings[python]", "mkdocs-include-markdown-plugin", "mkdocs-api-autonav", "mike"]
60+
docs = ["mkdocs",
61+
"mkdocs-material",
62+
"mkdocstrings[python]",
63+
"mkdocs-include-markdown-plugin",
64+
"mkdocs-api-autonav",
65+
"mike",
66+
"griffe-pydantic"]
6167

6268
# May be required for certain library functionality
6369
openssl = ["pyOpenSSL<24.0.0", "types-pyOpenSSL<24.0.0", "cffi~=1.14"]

0 commit comments

Comments
 (0)