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-04-28 01:25:40 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         230 : T rename_dims(T &self, const std::map<std::string, std::string> &name_dict) {
      11         230 :   std::vector<std::pair<Dim, Dim>> names;
      12         230 :   names.reserve(name_dict.size());
      13         570 :   for (const auto &[from, to] : name_dict)
      14         340 :     names.emplace_back(Dim{from}, Dim{to});
      15         458 :   return self.rename_dims(names);
      16         230 : }

Generated by: LCOV version 1.14