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

BlueBrain / MorphIO / 11255477262

09 Oct 2024 12:28PM UTC coverage: 77.697% (+0.08%) from 77.615%
11255477262

Pull #476

github

mgeplf
comments
Pull Request #476: Efficient swc build

286 of 321 new or added lines in 10 files covered. (89.1%)

9 existing lines in 4 files now uncovered.

2125 of 2735 relevant lines covered (77.7%)

901.01 hits per line

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

18.42
/src/vasc/properties.cpp
1
/* Copyright (c) 2013-2023, EPFL/Blue Brain Project
2
 *
3
 * SPDX-License-Identifier: Apache-2.0
4
 */
5

6
#include <morphio/errorMessages.h>
7
#include <morphio/properties.h>
8
#include <morphio/vasc/properties.h>
9
#include <string>
10

11
#include "../point_utils.h"
12
#include "../shared_utils.hpp"
13

14
namespace {
15
bool compare_section_structure(
×
16
    const std::vector<morphio::vasculature::property::VascSection::Type>& vec1,
17
    const std::vector<morphio::vasculature::property::VascSection::Type>& vec2) {
18
    if (vec1.size() != vec2.size()) {
×
19
        return false;
×
20
    }
21

22
    for (size_t i = 1; i < vec1.size(); ++i) {
×
23
        if (vec1[i] - vec1[1] != vec2[i] - vec2[1]) {
×
24
            return false;
×
25
        }
26
    }
27
    return true;
×
28
}
29

30

31
}  // namespace
32

33

34
namespace morphio {
35
namespace vasculature {
36
namespace property {
37

38
VascPointLevel::VascPointLevel(const std::vector<Point::Type>& points,
8✔
39
                               const std::vector<Diameter::Type>& diameters)
8✔
40
    : _points(points)
41
    , _diameters(diameters) {
8✔
42
    if (_points.size() != _diameters.size()) {
8✔
43
        throw SectionBuilderError(
44
            "Point vector have size: " + std::to_string(_points.size()) +
×
45
            "while Diameter vector has size: " + std::to_string(_diameters.size()));
×
46
    }
47
}
8✔
48

49
VascPointLevel::VascPointLevel(const VascPointLevel& data)
8✔
50
    : VascPointLevel(data._points, data._diameters) {}
8✔
51

52
VascPointLevel::VascPointLevel(const VascPointLevel& data, SectionRange range) {
×
53
    _points = copySpan<property::Point>(data._points, range);
×
54
    _diameters = copySpan<property::Diameter>(data._diameters, range);
×
55
}
×
56

57
bool VascSectionLevel::diff(const VascSectionLevel& other) const {
×
58
    return this == &other ||
×
59
           (compare_section_structure(this->_sections, other._sections) &&
×
NEW
60
            morphio::property::compare(this->_sectionTypes, other._sectionTypes) &&
×
NEW
61
            morphio::property::compare(this->_predecessors, other._predecessors) &&
×
NEW
62
            morphio::property::compare(this->_successors, other._successors));
×
63
}
64

65
bool VascSectionLevel::operator==(const VascSectionLevel& other) const {
×
66
    return !diff(other);
×
67
}
68

69
bool VascSectionLevel::operator!=(const VascSectionLevel& other) const {
×
70
    return diff(other);
×
71
}
72

73
std::ostream& operator<<(std::ostream& os, const VascPointLevel& pointLevel) {
×
74
    os << "Point level properties:\n";
×
75
    os << "Point diameter"
76
       << (pointLevel._diameters.size() == pointLevel._points.size() ? " Diameter\n" : "\n");
×
77
    for (size_t i = 0; i < pointLevel._points.size(); ++i) {
×
78
        os << dumpPoint(pointLevel._points[i]) << ' ' << pointLevel._diameters[i] << '\n';
×
79
    }
80
    return os;
×
81
}
82

83
std::ostream& operator<<(std::ostream& os, const Properties& properties) {
×
84
    return os << properties._pointLevel << '\n';
×
85
}
86
}  // namespace property
87
}  // namespace vasculature
88
}  // 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