LCOV - code coverage report
Current view: top level - dataset - variable_instantiate_dataset.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 3 4 75.0 %
Date: 2024-11-24 01:48:31 Functions: 1 1 100.0 %

          Line data    Source code
       1             : // SPDX-License-Identifier: BSD-3-Clause
       2             : // Copyright (c) 2023 Scipp contributors (https://github.com/scipp)
       3             : /// @file
       4             : /// @author Simon Heybrock
       5             : #include "scipp/dataset/dataset.h"
       6             : #include "scipp/dataset/except.h"
       7             : #include "scipp/variable/element_array_variable.tcc"
       8             : #include "scipp/variable/string.h"
       9             : 
      10             : namespace scipp::variable {
      11             : 
      12             : template <>
      13           1 : std::string Formatter<DataArray>::format(const Variable &var) const {
      14           1 :   if (var.dims().volume() == 1)
      15           2 :     return "DataArray" + format_variable_like(var.value<DataArray>());
      16           0 :   return "[multiple data arrays]";
      17             : }
      18             : 
      19             : INSTANTIATE_ELEMENT_ARRAY_VARIABLE(Dataset, scipp::dataset::Dataset)
      20             : INSTANTIATE_ELEMENT_ARRAY_VARIABLE(DataArray, scipp::dataset::DataArray)
      21             : } // namespace scipp::variable
      22             : 
      23             : namespace scipp::dataset {
      24             : REGISTER_FORMATTER(DataArray, DataArray)
      25             : REGISTER_FORMATTER(Dataset, Dataset)
      26             : } // namespace scipp::dataset

Generated by: LCOV version 1.14