• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

BlueBrain / MorphIO / 7286001939

21 Dec 2023 08:57AM UTC coverage: 76.104% (-0.8%) from 76.938%
7286001939

Pull #485

github

mgeplf
try scikit-build-core
Pull Request #485: try scikit-build-core

1930 of 2536 relevant lines covered (76.1%)

863.39 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

92.86
/src/shared_utils.hpp
1
/* Copyright (c) 2013-2023, EPFL/Blue Brain Project
2
 *
3
 * SPDX-License-Identifier: Apache-2.0
4
 */
5
#include <morphio/errorMessages.h>
6
#include <morphio/types.h>
7

8
#include "point_utils.h"
9

10

11
namespace morphio {
12

13
floatType _somaSurface(const SomaType type,
14
                       const range<const floatType>& diameters,
15
                       const range<const Point>& points);
16

17
template <typename T>
18
void _appendVector(std::vector<T>& to, const std::vector<T>& from, int offset) {
1,332✔
19
    to.insert(to.end(), from.begin() + offset, from.end());
1,332✔
20
}
1,332✔
21

22
template <typename T>
23
std::vector<typename T::Type> copySpan(const std::vector<typename T::Type>& data,
1,002✔
24
                                       SectionRange range) {
25
    if (data.empty()) {
1,002✔
26
        return {};
246✔
27
    }
28

29
    return {data.begin() + static_cast<long int>(range.first),
1,512✔
30
            data.begin() + static_cast<long int>(range.second)};
756✔
31
}
32

33
/**
34
 * Is `path` a directory?
35
 *
36
 * Symlinks to directories are considered directories.
37
 */
38
bool is_directory(const std::string& path);
39

40
/**
41
 * Is `path` a regular file?
42
 *
43
 * Symlinks to regular files are considered files.
44
 */
45
bool is_regular_file(const std::string& path);
46

47
/**
48
 * Join `dirname` and `filename` into one path.
49
 *
50
 * This follows the Python `os.path.join` semantics, i.e.,
51
 *   - join_path("", "foo") == "foo" (not "/foo")
52
 *   - join_path("/usr", "/home/foo") == "/home/foo" (not "/usr/home/foo")
53
 */
54
std::string join_path(const std::string& dirname, const std::string& filename);
55

56
namespace property {
57

58
template <typename T>
59
bool compare(const T& el1, const T& el2, const std::string& name, LogLevel logLevel) {
4✔
60
    if (el1 == el2) {
4✔
61
        return true;
×
62
    }
63

64
    if (logLevel > LogLevel::ERROR) {
4✔
65
        printError(Warning::UNDEFINED, name + " differs");
2✔
66
    }
67
    return false;
4✔
68
}
69
}  // namespace property
70

71
}  // namespace morphio
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc