Cheat sheet#
Everything starts from a nominal.Client, and each object hands you the next.
Client#
c = nominal.Client.fromProfile()
Action |
MATLAB |
|---|---|
Connect from a stored profile |
|
Connect with an API key |
|
Either, whichever is available |
|
Who am I (also a credential check) |
|
Search assets by name |
|
Search datasets by name |
|
Search runs |
|
List every asset (slow, unpaginated) |
|
List every dataset (slow, unpaginated) |
|
Get an asset by RID |
|
Get an asset by name, creating if absent |
|
Create an asset, even if the name exists |
|
Get a dataset by RID |
|
Create a dataset attached to no asset |
|
Get a run by RID |
|
Create a run from tagged data, no asset |
|
Create an event |
|
…with properties |
|
Upload and ingest a CSV or Parquet file |
|
…tagging every point in it |
|
Run a SQL query |
|
SQL result too big for memory |
|
Workspace / base URL |
|
Asset#
a = c.getOrCreateAsset("<asset name>")
Action |
MATLAB |
|---|---|
Identity and metadata |
|
Read one property |
|
All properties, as a |
|
Set or remove one, keeping the rest |
|
Everything attached to it, with tag filters |
|
…re-read from Nominal |
|
Read a channel as the asset sees it |
|
A dataset already on it, by name |
|
Attach a dataset you already have |
|
…only the series with these tags |
|
…a tag key that isn’t a field name |
|
Rename a reference name |
|
Detach a data source |
|
Ensure it has a dataset of that name |
|
…without adopting an existing one |
|
Start a run on it |
|
Change metadata |
|
An asset object is a snapshot taken when it was fetched. update() returns a new object
instead of changing the one you have. datasources() asks Nominal once and reuses the
answer until you pass Refresh=true.
Dataset names are not unique in Nominal, so getOrCreateDataset resolves in three steps and
prints which one it took:
A dataset of that name already on the asset is returned.
Otherwise a dataset of that exact name elsewhere in the workspace is attached to the asset and returned.
Otherwise one is created.
Step 2 is how “the dataset for serial 12345678” finds the one a colleague already made. Because
it changes your asset based on a name match, you can turn it off with AttachExisting=false.
If several datasets share the name, it errors and lists their RIDs. Attach the one you meant
with a.addDataset(c.datasetByRid(rid)).
refName is the dataset’s name within the asset. It is only used when attaching, and you can
leave it out: a free one is chosen ("default" on an asset with none, otherwise the dataset’s
own name). Supply one when an asset has two sources measuring the same thing, such as a CAN
log and a test rig both reporting engine temp, and you want to tell them apart.
An asset holds a dataset once per tag filter. Attaching the same dataset again with the same
Tags moves it to the new refName. Attaching it with different Tags adds it alongside.
Dataset#
ds = a.getOrCreateDataset("<dataset name>")
Action |
MATLAB |
|---|---|
Identity and metadata |
|
Read one property |
|
All properties, as a |
|
Set or remove one, keeping the rest |
|
What channels are in it |
|
Which assets hold it |
|
Open a live stream |
|
Write a block already in memory |
|
…tagging every point |
|
Read one channel back |
|
Read it decimated, for plotting |
|
…one tag set, when it has several |
|
Export channels to a file |
|
Export to a download link instead |
|
Read one channel’s units |
|
Declare a channel’s units |
|
Change metadata |
|
Run#
r = a.run("burn-12")
Action |
MATLAB |
|---|---|
Identity and metadata |
|
Timing |
|
Assets it belongs to |
|
Put it on another asset too |
|
Take it off one |
|
Read one property |
|
All properties, as a |
|
Set or remove one, keeping the rest |
|
Close it |
|
Read a channel over the run’s window |
|
Change metadata |
|
Stream and Channel#
s = ds.stream()
Action |
MATLAB |
|---|---|
Get a write address for a channel |
|
Push an N-by-C block across channels |
|
Push one channel |
|
Tag every later point on an address |
|
Flush and close |
|
Event#
e = c.createEvent(rids, "overspeed")
Action |
MATLAB |
|---|---|
Read it back |
|
Read one property |
|
All properties, as a |
|
IngestJob#
job = c.ingest("<file>.csv", …)
Action |
MATLAB |
|---|---|
Where the data is landing |
|
Check progress |
|
Block until it finishes |
|
Free functions#
Action |
MATLAB |
|---|---|
Current time, full nanosecond precision |
|
datetime → int64 nanoseconds |
|
int64 nanoseconds → UTC datetime |
|
Shut the toolbox down, closing every connection |
|