{"id":10214,"library":"scipp","title":"Scipp","description":"Scipp is a Python library for multi-dimensional data arrays with labeled dimensions, designed for scientific data analysis, especially in neutron and muon scattering. It provides unit-aware data structures and operations, enabling robust handling of physical quantities. The current version is 26.3.1, and it maintains a rapid release cadence with monthly major updates.","status":"active","version":"26.3.1","language":"en","source_language":"en","source_url":"https://github.com/scipp/scipp","tags":["data analysis","scientific computing","physics","units","multi-dimensional arrays","data structures"],"install":[{"cmd":"pip install scipp","lang":"bash","label":"Install with pip"}],"dependencies":[{"reason":"Core array manipulation backend.","package":"numpy","optional":false},{"reason":"HDF5 file format support.","package":"h5py","optional":true}],"imports":[{"symbol":"scipp","correct":"import scipp as sc"},{"symbol":"Variable","correct":"from scipp import Variable"},{"symbol":"DataArray","correct":"from scipp import DataArray"},{"symbol":"Dataset","correct":"from scipp import Dataset"}],"quickstart":{"code":"import scipp as sc\nimport numpy as np\n\n# Create a variable with units\nx = sc.linspace(dim='x', start=0.1, stop=0.9, num=10, unit='m')\ny = sc.sin(x)\n\n# Create a DataArray, including coordinates and data\ndata_array = sc.DataArray(data=y, coords={'x': x})\n\nprint(\"Original DataArray:\\n\", data_array)\n\n# Perform a unit-aware operation (e.g., sum over 'x' dimension)\nsum_result = data_array.sum('x')\nprint(\"\\nSum along 'x' dimension:\\n\", sum_result)\n","lang":"python","description":"This quickstart demonstrates how to create a unit-aware `Variable` and then encapsulate it within a `DataArray` along with its coordinates. It then performs a basic operation (sum) that respects Scipp's unit-aware nature."},"warnings":[{"fix":"Upgrade your Python environment to 3.11 or a later version.","message":"Scipp dropped support for Python 3.10. Users must upgrade to Python 3.11 or newer.","severity":"breaking","affected_versions":">=25.08.0"},{"fix":"No direct fix; observe the new default text-based representation. If custom visualization is needed, consider external plotting libraries or manual rendering.","message":"The custom HTML representation for Scipp objects in Jupyter notebooks (`sc` notebook HTML repr) was removed. Objects now rely on their standard `__repr__` method.","severity":"breaking","affected_versions":">=26.3.0"},{"fix":"Ensure units are compatible for operations, convert units using `.to()` method, or explicitly strip units with `var.without_units()` if desired.","message":"Scipp is strictly unit-aware. Operations on `Variable` or `DataArray` objects with incompatible units will raise a `UnitError`.","severity":"gotcha","affected_versions":"All versions"},{"fix":"To get the NumPy array from a `Variable` or `DataArray`'s data, use `my_var.values` or `my_data_array.values`.","message":"Accessing the underlying NumPy array data requires using the `.values` attribute. Directly indexing a `Variable` object will result in a `TypeError`.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"Run `pip install scipp` to install the library.","cause":"The scipp package is not installed in the current Python environment.","error":"ModuleNotFoundError: No module named 'scipp'"},{"fix":"Ensure all operands have compatible units. Use `my_var.to(target_unit)` to convert units or `my_var.without_units()` to remove units before the operation.","cause":"Attempting an operation (e.g., addition, subtraction) on Scipp variables or data arrays that have incompatible physical units.","error":"scipp.core.UnitError: Units do not match"},{"fix":"Access the underlying NumPy array first using `.values` attribute: `my_variable.values[0]`.","cause":"Trying to access elements of a `scipp.Variable` object using array indexing (e.g., `my_variable[0]`) instead of its underlying NumPy array.","error":"TypeError: 'Variable' object is not subscriptable"},{"fix":"Ensure dimensions align or explicitly broadcast/reorder them. For element-wise operations, dimensions and their order must match. Use `my_da.transpose()` or ensure common dimensions are present.","cause":"Operations between data arrays with non-matching dimensions, dimension labels, or dimension order without explicit alignment.","error":"scipp.core.DimensionError: Cannot perform operation ... dimensions ... do not align"}]}