Skip to content

Conversation

@julianstirling
Copy link
Contributor

@julianstirling julianstirling commented Dec 18, 2025

This makes the broken unit test in #230 pass.

It only works for returns. But I think it is more likely to want to get an array of data from an instrument over HTTP than to send an array to an instrument over HTTP. It would be good to support both eventually.

This may not be the best way to do it, but creating it has helped me understand the codebase

  • Adds ArrayModel to the numpy tupes with a private _labthings_typehint (can't have non-private keys in a RootModel)
  • return_type catches np.ndarray and returns ArrayModel as the type instead
  • When converting to dataschema we use the format string to send the `_labthings_typehint
  • When creating the ThingClient we read the format string and pass it into invoke_action as a keyword arg
  • When returning from invoke_action the typehint is checked and used for conversion if available.

@julianstirling julianstirling force-pushed the ndarray-experimental-fix branch from 4b012b3 to 75bf89d Compare December 18, 2025 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants