Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
9852f8d
Initial implementation
hunter-ni Nov 17, 2025
d8c866f
Minor clean-up
hunter-ni Nov 17, 2025
94f1056
Spacing clean-up
hunter-ni Nov 17, 2025
d3f031d
Fix build error
hunter-ni Nov 17, 2025
b38d053
Remove '_example_context' from import statement of ExampleContext
hunter-ni Nov 17, 2025
7a2971d
Build issue
hunter-ni Nov 17, 2025
3e42fdc
Review feedback.
hunter-ni Nov 18, 2025
475fb40
Fix spacing issue
hunter-ni Nov 18, 2025
aff2371
Adding DataStoreContext to acceptance tests
hunter-ni Nov 18, 2025
a4da73b
Adding documentation
hunter-ni Nov 18, 2025
436fdc0
Merge branch 'main' into users/hunter-ni/example-context
hunter-ni Nov 18, 2025
8a1cfe2
Merge branch 'main' into users/hunter-ni/example-context
hunter-ni Nov 19, 2025
cb9b6c2
Moving DataStoreContext into its own utilities project that is refere…
hunter-ni Nov 19, 2025
3b05e1f
Add py.typed
hunter-ni Nov 19, 2025
ddc14dd
Add example documentation
hunter-ni Nov 19, 2025
2337ad3
Exclude utilities from mypy
hunter-ni Nov 19, 2025
e445ceb
Add CI analysis of utilities
hunter-ni Nov 19, 2025
51e1bf3
Test - Introduce Analysis Error
hunter-ni Nov 19, 2025
36cced1
Revert "Test - Introduce Analysis Error"
hunter-ni Nov 19, 2025
e54f3a5
Single-sourcing DataStoreContext creation for acceptance testing
hunter-ni Nov 19, 2025
903f453
Remove py.typed. Update documentation.
hunter-ni Nov 20, 2025
afba1de
Add back py.typed
hunter-ni Nov 20, 2025
fafecc4
Review Feedback - Update 0.1.0-dev0 to 0.1.0.dev0
hunter-ni Nov 20, 2025
f9c2c58
Review feedback - update notebook section titles for clarity
hunter-ni Nov 20, 2025
5b7dda0
Introduce style errors in utilities
hunter-ni Nov 20, 2025
4a4a5c6
Revert "Introduce style errors in utilities"
hunter-ni Nov 20, 2025
722f778
Review feedback - add 'check_utilities' to 'checks_succeeded'
hunter-ni Nov 20, 2025
a2bad17
Review feedback - exclude utilities from broader style analyzer
hunter-ni Nov 20, 2025
c524ce4
Review feedback - Add README for notebooks
hunter-ni Nov 20, 2025
4f79f8d
Review feedback - restore original environment variables in DataStore…
hunter-ni Nov 20, 2025
3ad3099
Add type hint
hunter-ni Nov 20, 2025
7f665e9
Fully qualifying all environment variable names
hunter-ni Nov 20, 2025
f35e9ce
Convention - specify environment variables using all upper-case const…
hunter-ni Nov 20, 2025
bcf1b55
Merge branch 'main' into users/hunter-ni/example-context
hunter-ni Nov 20, 2025
0b0ff19
Update formatting
hunter-ni Nov 20, 2025
6919289
Updating dependency versions of metadata.v1.client and data.v1.client…
hunter-ni Nov 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@ jobs:
check_examples:
name: Check analyzers for examples
uses: ./.github/workflows/check_examples.yml
check_utilities:
name: Check analyzers for utilities
uses: ./.github/workflows/check_utilities.yml
check_docs:
name: Check docs for ni.datastore
uses: ./.github/workflows/check_docs.yml
checks_succeeded:
name: Checks succeeded
needs: [check_analyzers, check_examples, check_docs]
needs: [check_analyzers, check_examples, check_utilities, check_docs]
runs-on: ubuntu-latest
steps:
- run: exit 0
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/check_utilities.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Check utilities

on:
workflow_call:
workflow_dispatch:

jobs:
check_utilities:
name: Analyze utilities
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
python-version: [3.14]
runs-on: ${{ matrix.os }}
steps:
- name: Check out repo
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
submodules: true
- name: Set up Python
uses: ni/python-actions/setup-python@9768589f3e50672173dad75a6fc181e4a85d33fa # v0.7.0
id: setup-python
with:
python-version: ${{ matrix.python-version }}
- name: Set up Poetry
uses: ni/python-actions/setup-poetry@9768589f3e50672173dad75a6fc181e4a85d33fa # v0.7.0
- name: Analyze Python Project
uses: ni/python-actions/analyze-project@9768589f3e50672173dad75a6fc181e4a85d33fa # v0.7.0
with:
project-directory: ${{ github.workspace }}/utilities
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
# Byte-compiled / optimized / DLL files
__pycache__/

# Directory for data generated from running examples and tests
temp_data/

# Unit tests
.pytest_cache/
test_results/
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ in the `datastore-python` repo. Here are the steps to follow to publish the pack

1. From the main GitHub repo page, select "Create a new release".
2. On the "New Release" page, create a new tag using the "Select Tag" drop down. The tag must be the package version, matching the
value found in pyproject.toml. Example: `0.1.0-dev0`.
value found in pyproject.toml. Example: `0.1.0.dev0`.
3. Enter a title in the "Release title" field. The title should contain the package name and
version in the format `ni.datastore <package-version>`. For example: `ni.datastore 0.1.0-dev0`.
version in the format `ni.datastore <package-version>`. For example: `ni.datastore 0.1.0.dev0`.
4. Click "Generate release notes" and edit the release notes.
- Delete entries for PRs that do not affect users, such as "chore(deps):" and "fix(deps):" PRs.
- Consider grouping related entries.
Expand Down
11 changes: 11 additions & 0 deletions examples/notebooks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Example Notebooks

The Jupyter Notebooks contained within the sub-directories of this directory demonstrate usage and functionality of the Measurement Data Store Python API.

These notebooks make use of the main Python environment / kernel of `ni.datastore`. To execute the code in these notebooks, first execute the following command from the repo's root directory:

```sh
poetry install
```

After executing this command, select the environment that it creates as the kernel to use for executing any of the provided notebooks that is of interest to you.
12 changes: 10 additions & 2 deletions examples/notebooks/alias/alias.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
"metadata": {},
"outputs": [],
"source": [
"# Perform example-specific setup with the DataStoreContext. This is not needed when writing production code.\n",
"from utilities import DataStoreContext\n",
"data_store_context = DataStoreContext()\n",
"data_store_context.initialize()\n",
"\n",
"from ni.datastore.metadata import MetadataStoreClient, Operator\n",
"\n",
"metadata_store_client = MetadataStoreClient()\n",
Expand Down Expand Up @@ -201,7 +206,7 @@
"id": "1b253668",
"metadata": {},
"source": [
"## Close the client"
"## Clean up"
]
},
{
Expand All @@ -211,7 +216,10 @@
"metadata": {},
"outputs": [],
"source": [
"metadata_store_client.close()"
"metadata_store_client.close()\n",
"\n",
"# Perform example-specific cleanup. This is not needed when writing production code.\n",
"data_store_context.close()"
]
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
"metadata": {},
"outputs": [],
"source": [
"# Perform example-specific setup with the DataStoreContext. This is not needed when writing production code.\n",
"from utilities import DataStoreContext\n",
"data_store_context = DataStoreContext()\n",
"data_store_context.initialize()\n",
"\n",
"from ni.datastore.metadata import MetadataStoreClient\n",
"\n",
"metadata_store_client = MetadataStoreClient()\n",
Expand Down Expand Up @@ -177,7 +182,7 @@
"id": "f5e0fcfd",
"metadata": {},
"source": [
"## Close the Clients"
"## Clean Up"
]
},
{
Expand All @@ -188,7 +193,10 @@
"outputs": [],
"source": [
"metadata_store_client.close()\n",
"data_store_client.close()"
"data_store_client.close()\n",
"\n",
"# Perform example-specific cleanup. This is not needed when writing production code.\n",
"data_store_context.close()"
]
}
],
Expand Down
12 changes: 10 additions & 2 deletions examples/notebooks/overview/publish_measurement.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
"metadata": {},
"outputs": [],
"source": [
"# Perform example-specific setup with the DataStoreContext. This is not needed when writing production code.\n",
"from utilities import DataStoreContext\n",
"data_store_context = DataStoreContext()\n",
"data_store_context.initialize()\n",
"\n",
"from ni.datastore.data import DataStoreClient\n",
"from ni.datastore.metadata import MetadataStoreClient\n",
"\n",
Expand Down Expand Up @@ -270,7 +275,7 @@
"id": "9f731b1e",
"metadata": {},
"source": [
"## Close the clients"
"## Clean up"
]
},
{
Expand All @@ -281,7 +286,10 @@
"outputs": [],
"source": [
"metadata_store_client.close()\n",
"data_store_client.close()"
"data_store_client.close()\n",
"\n",
"# Perform example-specific cleanup. This is not needed when writing production code.\n",
"data_store_context.close()"
]
}
],
Expand Down
27 changes: 27 additions & 0 deletions examples/notebooks/query/publish_sample_data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@
"metadata": {},
"outputs": [],
"source": [
"# Perform example-specific setup with the DataStoreContext. This is not needed when writing production code.\n",
"from utilities import DataStoreContext\n",
"data_store_context = DataStoreContext()\n",
"data_store_context.initialize()\n",
"\n",
"from ni.datastore.metadata import (\n",
" MetadataStoreClient,\n",
" HardwareItem,\n",
Expand Down Expand Up @@ -489,6 +494,28 @@
"print(f\" 📓 Then: query_measurements.ipynb - Query test results and measurements\")"
]
},
{
"cell_type": "markdown",
"id": "9dd49a41",
"metadata": {},
"source": [
"## Clean up"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "636a5c4b",
"metadata": {},
"outputs": [],
"source": [
"data_store_client.close()\n",
"metadata_store_client.close()\n",
"\n",
"# Perform example-specific cleanup. This is not needed when writing production code.\n",
"data_store_context.close()"
]
},
{
"cell_type": "markdown",
"id": "ecc3a180",
Expand Down
12 changes: 10 additions & 2 deletions examples/notebooks/query/query_measurements.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
"metadata": {},
"outputs": [],
"source": [
"# Perform example-specific setup with the DataStoreContext. This is not needed when writing production code.\n",
"from utilities import DataStoreContext\n",
"data_store_context = DataStoreContext()\n",
"data_store_context.initialize()\n",
"\n",
"from ni.datastore.data import DataStoreClient\n",
"\n",
"data_store_client = DataStoreClient()"
Expand Down Expand Up @@ -210,7 +215,7 @@
"id": "bb446f20",
"metadata": {},
"source": [
"## Close the client"
"## Clean up"
]
},
{
Expand All @@ -220,7 +225,10 @@
"metadata": {},
"outputs": [],
"source": [
"data_store_client.close()"
"data_store_client.close()\n",
"\n",
"# Perform example-specific cleanup. This is not needed when writing production code.\n",
"data_store_context.close()"
]
}
],
Expand Down
26 changes: 26 additions & 0 deletions examples/notebooks/query/query_metadata.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
"metadata": {},
"outputs": [],
"source": [
"# Perform example-specific setup with the DataStoreContext. This is not needed when writing production code.\n",
"from utilities import DataStoreContext\n",
"data_store_context = DataStoreContext()\n",
"data_store_context.initialize()\n",
"\n",
"from ni.datastore.metadata import MetadataStoreClient\n",
"\n",
"metadata_store_client = MetadataStoreClient()"
Expand Down Expand Up @@ -372,6 +377,27 @@
" target_type_name = get_target_type_name(alias.target_type)\n",
" print(f\" {alias.name} -> {target_type_name}\")\n"
]
},
{
"cell_type": "markdown",
"id": "9bafa1e4",
"metadata": {},
"source": [
"## Clean up"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "d9f68454",
"metadata": {},
"outputs": [],
"source": [
"metadata_store_client.close()\n",
"\n",
"# Perform example-specific cleanup. This is not needed when writing production code.\n",
"data_store_context.close()"
]
}
],
"metadata": {
Expand Down
12 changes: 10 additions & 2 deletions examples/notebooks/voltage-regulator/publish_waveforms.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
"metadata": {},
"outputs": [],
"source": [
"# Perform example-specific setup with the DataStoreContext. This is not needed when writing production code.\n",
"from utilities import DataStoreContext\n",
"data_store_context = DataStoreContext()\n",
"data_store_context.initialize()\n",
"\n",
"from ni.datastore.metadata import (\n",
" MetadataStoreClient,\n",
" HardwareItem,\n",
Expand Down Expand Up @@ -271,7 +276,7 @@
"id": "a0317fe8",
"metadata": {},
"source": [
"## Close the clients"
"## Clean Up"
]
},
{
Expand All @@ -282,7 +287,10 @@
"outputs": [],
"source": [
"metadata_store_client.close()\n",
"data_store_client.close()"
"data_store_client.close()\n",
"\n",
"# Perform example-specific cleanup. This is not needed when writing production code.\n",
"data_store_context.close()"
]
}
],
Expand Down
Loading