LCOV - code coverage report
Current view: top level - python - rename.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 7 7 100.0 %
Date: 2024-11-17 01:47:58 Functions: 3 3 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             : #pragma once
       6             : 
       7             : #include "scipp/dataset/dataset.h"
       8             : 
       9             : template <class T>
      10         235 : T rename_dims(T &self, const std::map<std::string, std::string> &name_dict) {
      11         235 :   std::vector<std::pair<Dim, Dim>> names;
      12         235 :   names.reserve(name_dict.size());
      13         580 :   for (const auto &[from, to] : name_dict)
      14         345 :     names.emplace_back(Dim{from}, Dim{to});
      15         468 :   return self.rename_dims(names);
      16         235 : }

Generated by: LCOV version 1.14