{"id":24116,"library":"nitypes","title":"nitypes","description":"Data types for NI Python APIs, providing analog, complex, and digital waveforms, frequency spectrums, complex integers, and time conversion. Current stable version is 1.0.1 (latest release). Development releases (1.1.0.dev2) are available. Release cadence is irregular.","status":"active","version":"1.0.1","language":"python","source_language":"en","source_url":"https://github.com/ni/nitypes-python","tags":["ni","instrument-control","waveforms","data-types","numpy"],"install":[{"cmd":"pip install nitypes","lang":"bash","label":"Install latest stable"},{"cmd":"pip install nitypes==1.0.1","lang":"bash","label":"Install specific version"}],"dependencies":[{"reason":"Core dependency for array data types.","package":"numpy","optional":false}],"imports":[{"note":"Common mistake: submodule path not required; top-level import works.","wrong":"from nitypes.waveform import AnalogWaveform","symbol":"AnalogWaveform","correct":"from nitypes import AnalogWaveform"},{"note":"AttributeError if not imported directly; ensure correct import.","wrong":"import nitypes; nitypes.DigitalWaveform","symbol":"DigitalWaveform","correct":"from nitypes import DigitalWaveform"},{"note":"Scalar is available at top-level since version 0.1.0-dev7.","symbol":"Scalar","correct":"from nitypes import Scalar"},{"note":"Vector is available at top-level since version 0.1.0-dev7.","symbol":"Vector","correct":"from nitypes import Vector"},{"note":"Waveform is a base class; typically use specific subclasses.","symbol":"Waveform","correct":"from nitypes import Waveform"}],"quickstart":{"code":"from nitypes import AnalogWaveform, DigitalWaveform, Scalar, Vector\nimport numpy as np\n\n# Create an analog waveform\nanalog_data = np.array([0.5, 1.2, -0.3], dtype=np.float64)\nt0 = 0.0\ndt = 0.001\nwaveform = AnalogWaveform(data=analog_data, t0=t0, dt=dt)\nprint(waveform)\n\n# Create a digital waveform\ndigital_data = np.array([0b1010, 0b1100], dtype=np.uint8)\ndigital_waveform = DigitalWaveform(data=digital_data, t0=t0, dt=dt)\nprint(digital_waveform)\n\n# Create a scalar and vector\nscalar = Scalar(value=5.0)\nvector = Vector(data=np.array([1, 2, 3]))\nprint(scalar, vector)","lang":"python","description":"Quickstart: import and basic usage of nitypes data types."},"warnings":[{"fix":"Update to nitypes>=1.0.1 and adjust any logic that assumes signal 0 is the most significant bit.","message":"In nitypes 1.0.1, the ordering of Digital Waveform Signal Indices was reversed. signal_index now starts from leftmost bit as highest index, opposite to 1.0.0. Code relying on index ordering must be updated.","severity":"breaking","affected_versions":"<=1.0.0"},{"fix":"Upgrade to nitypes>=1.1.0.dev2 to fix pickling issues.","message":"nitypes classes like AnalogWaveform and DigitalWaveform are not fully picklable in versions before 1.1.0.dev2. Unpickling may raise errors or produce incorrect data.","severity":"gotcha","affected_versions":"<1.1.0.dev2"},{"fix":"Use `.units` instead of `.unit` when accessing unit metadata.","message":"The `unit` property was renamed to `units` for consistency in version 0.1.0-dev9. Using `unit` will raise AttributeError.","severity":"deprecated","affected_versions":">=0.1.0-dev9"},{"fix":"Upgrade to nitypes>=1.1.0.dev2 to get compatible type hints.","message":"Type hints may break with numpy >= 2.4.x on nitypes versions before 1.1.0.dev2. Incompatible type stubs cause mypy errors.","severity":"gotcha","affected_versions":"<1.1.0.dev2"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use 'from nitypes import AnalogWaveform'","cause":"Importing the module but not the class; top-level imports require explicit class import.","error":"AttributeError: module 'nitypes' has no attribute 'AnalogWaveform'"},{"fix":"Use 'waveform.units' instead of 'waveform.unit'","cause":"The property was renamed from 'unit' to 'units' in nitypes 0.1.0-dev9.","error":"AttributeError: 'DigitalWaveform' object has no attribute 'unit'"},{"fix":"Update to nitypes>=1.0.1 and adjust signal index logic as per release notes.","cause":"Signal index ordering changed in 1.0.1; existing code may assume different ordering.","error":"ValueError: signal_index out of range for DigitalWaveform"},{"fix":"Convert data to complex128 using np.complex128 before passing.","cause":"nitypes expects specific numpy dtypes; complex64 is not supported directly.","error":"TypeError: Cannot interpret dtype=complex64 as a complex waveform"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}