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

BlueBrain / MorphIO / 6119563465

08 Sep 2023 08:34AM UTC coverage: 76.104% (-0.07%) from 76.174%
6119563465

push

github

web-flow
Minor build system tweaks (#293)

* build: use gnuinstall dirs

* build: version shared object

Initially, use 0.0.0 but ideally, the soversion should follow semver to
indicate ABI changes etc.

Using this will also create the necessary symlinks

References:
- https://cmake.org/cmake/help/latest/prop_tgt/SOVERSION.html
- https://semver.org/

* build: make cmake also install python binding shared object

9 of 9 new or added lines in 3 files covered. (100.0%)

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

13.21
/src/vasc/properties.cpp
1
/* Copyright (c) 2013-2023, EPFL/Blue Brain Project
2
 *
3
 * SPDX-License-Identifier: Apache-2.0
4
 */
5
#include <algorithm>
6
#include <cmath>
7

8
#include <morphio/errorMessages.h>
9
#include <morphio/properties.h>
10
#include <morphio/vasc/properties.h>
11
#include <string>
12

13
#include "../point_utils.h"
14
#include "../shared_utils.hpp"
15

16
namespace morphio {
17
namespace vasculature {
18
namespace property {
19

20
namespace details {
21
static bool compare_section_structure(
×
22
    const std::vector<morphio::vasculature::property::VascSection::Type>& vec1,
23
    const std::vector<morphio::vasculature::property::VascSection::Type>& vec2,
24
    const std::string& name,
25
    LogLevel logLevel) {
26
    if (vec1.size() != vec2.size()) {
×
27
        if (logLevel > LogLevel::ERROR) {
×
28
            morphio::printError(morphio::Warning::UNDEFINED,
×
29
                                "Error comparing " + name +
×
30
                                    ", size differs: " + std::to_string(vec1.size()) + " vs " +
×
31
                                    std::to_string(vec2.size()));
×
32
        }
33
        return false;
×
34
    }
35

36
    for (size_t i = 1; i < vec1.size(); ++i) {
×
37
        if (vec1[i] - vec1[1] != vec2[i] - vec2[1]) {
×
38
            if (logLevel > LogLevel::ERROR) {
×
39
                morphio::printError(morphio::Warning::UNDEFINED,
×
40
                                    "Error comparing " + name + ", elements differ:");
×
41
                morphio::printError(morphio::Warning::UNDEFINED,
×
42
                                    std::to_string(vec1[i] - vec1[1]) + " <--> " +
×
43
                                        std::to_string(vec2[i] - vec2[1]));
×
44
            }
45
            return false;
×
46
        }
47
    }
48
    return true;
×
49
}
50

51

52
}  // namespace details
53

54

55
VascPointLevel::VascPointLevel(const std::vector<Point::Type>& points,
8✔
56
                               const std::vector<Diameter::Type>& diameters)
8✔
57
    : _points(points)
58
    , _diameters(diameters) {
8✔
59
    if (_points.size() != _diameters.size()) {
8✔
60
        throw SectionBuilderError(
61
            "Point vector have size: " + std::to_string(_points.size()) +
×
62
            "while Diameter vector has size: " + std::to_string(_diameters.size()));
×
63
    }
64
}
8✔
65

66
VascPointLevel::VascPointLevel(const VascPointLevel& data)
8✔
67
    : VascPointLevel(data._points, data._diameters) {}
8✔
68

69
VascPointLevel::VascPointLevel(const VascPointLevel& data, SectionRange range) {
×
70
    _points = copySpan<property::Point>(data._points, range);
×
71
    _diameters = copySpan<property::Diameter>(data._diameters, range);
×
72
}
×
73

74
bool VascSectionLevel::diff(const VascSectionLevel& other, LogLevel logLevel) const {
×
75
    return this == &other ||
×
76
           (details::compare_section_structure(
×
77
                this->_sections, other._sections, "_sections", logLevel) &&
×
78
            morphio::property::compare(
×
79
                this->_sectionTypes, other._sectionTypes, "_sectionTypes", logLevel) &&
×
80
            morphio::property::compare(
×
81
                this->_predecessors, other._predecessors, "_predecessors", logLevel) &&
×
82
            morphio::property::compare(
×
83
                this->_successors, other._successors, "_successors", logLevel));
×
84
}
85

86
bool VascSectionLevel::operator==(const VascSectionLevel& other) const {
×
87
    return !diff(other, LogLevel::ERROR);
×
88
}
89

90
bool VascSectionLevel::operator!=(const VascSectionLevel& other) const {
×
91
    return diff(other, LogLevel::ERROR);
×
92
}
93

94
std::ostream& operator<<(std::ostream& os, const VascPointLevel& pointLevel) {
×
95
    os << "Point level properties:\n";
×
96
    os << "Point diameter"
97
       << (pointLevel._diameters.size() == pointLevel._points.size() ? " Diameter\n" : "\n");
×
98
    for (size_t i = 0; i < pointLevel._points.size(); ++i) {
×
99
        os << dumpPoint(pointLevel._points[i]) << ' ' << pointLevel._diameters[i] << '\n';
×
100
    }
101
    return os;
×
102
}
103

104
std::ostream& operator<<(std::ostream& os, const Properties& properties) {
×
105
    return os << properties._pointLevel << '\n';
×
106
}
107
}  // namespace property
108
}  // namespace vasculature
109
}  // 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