Skip to content

Commit

Permalink
Merge branch 'main' into fix/setup-script
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Nov 6, 2023
2 parents db3926f + 178a798 commit b0f3c4c
Show file tree
Hide file tree
Showing 375 changed files with 2,922 additions and 1,975 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ jobs:
&& du -sh build
- name: Coverage
run: >
pip3 install gcovr==5.0
pip3 install gcovr==6.0
&& cd build
&& /usr/bin/python3 ../CI/test_coverage
&& /usr/bin/python3 ../CI/test_coverage.py
- name: Upload coverage
uses: codecov/codecov-action@v3
with:
Expand Down
2 changes: 0 additions & 2 deletions CI/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,6 @@ async def pr_action(
token: Optional[str] = typer.Option(None, envvar="GH_TOKEN"),
repo: Optional[str] = typer.Option(None, envvar="GH_REPO"),
):

print("::group::Information")

context = os.environ.get("GITHUB_CONTEXT")
Expand Down Expand Up @@ -437,7 +436,6 @@ async def pr_action(
exit_code = 0

if existing_release is not None or existing_tag is not None:

if current_version == next_version:
body += (
"## :no_entry_sign: Merging this will not result in a new version (no `fix`, "
Expand Down
94 changes: 0 additions & 94 deletions CI/test_coverage

This file was deleted.

86 changes: 86 additions & 0 deletions CI/test_coverage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
#!/usr/bin/env python
import sys
import os
import subprocess
import argparse
import multiprocessing as mp
import re


if not os.path.exists("CMakeCache.txt"):
print("Not in CMake build dir. Not executing")
sys.exit(1)


def check_output(*args, **kwargs):
p = subprocess.Popen(
*args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, **kwargs
)
p.wait()
stdout, stderr = p.communicate()
stdout = stdout.decode("utf-8")
return (p.returncode, stdout.strip())


# call helper function
def call(cmd):
print(" ".join(cmd))
try:
subprocess.check_call(cmd)
except subprocess.CalledProcessError as e:
print("Failed, output: ", e.output)
raise e


p = argparse.ArgumentParser()
p.add_argument("--gcov", default=check_output(["which", "gcov"])[1])
args = p.parse_args()

ret, gcovr_exe = check_output(["which", "gcovr"])
assert ret == 0, "gcovr not installed. Use 'pip install gcovr'."

ret, gcovr_version_text = check_output(["gcovr", "--version"])
gcovr_version = tuple(
map(int, re.match("gcovr (\d+\.\d+)", gcovr_version_text).group(1).split("."))
)

extra_flags = []

print(f"Found gcovr version {gcovr_version[0]}.{gcovr_version[1]}")
if gcovr_version < (5,):
print("Consider upgrading to a newer gcovr version.")
elif gcovr_version == (5, 1):
assert False and "Version 5.1 does not support parallel processing of gcov data"
elif gcovr_version >= (6,):
extra_flags += ["--exclude-noncode-lines"]

gcovr = [gcovr_exe]

script_dir = os.path.dirname(__file__)
source_dir = os.path.abspath(os.path.join(script_dir, ".."))
coverage_dir = os.path.abspath("coverage")

if not os.path.exists(coverage_dir):
os.makedirs(coverage_dir)

excludes = ["-e", "../Tests/", "-e", ".*json\.hpp"]

# create the html report
call(
gcovr
+ ["-r", source_dir]
+ ["--gcov-executable", args.gcov]
+ ["-j", str(mp.cpu_count())]
+ excludes
+ extra_flags
+ ["--xml", "-o", "coverage/cov.xml"]
)

call(
gcovr
+ ["-r", source_dir]
+ ["-j", str(mp.cpu_count())]
+ ["--gcov-executable", args.gcov]
+ excludes
+ extra_flags
)
4 changes: 0 additions & 4 deletions Core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ target_compile_features(
ActsCore
PUBLIC ${ACTS_CXX_STANDARD_FEATURE})

if(ACTS_CONCEPTS_SUPPORTED)
target_compile_definitions(ActsCore PUBLIC ACTS_CONCEPTS_SUPPORTED)
endif()

target_include_directories(
ActsCore
PUBLIC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class GreedyAmbiguityResolution {
std::uint32_t maximumIterations = 1000;

/// Minimum number of measurement to form a track.
size_t nMeasurementsMin = 7;
std::size_t nMeasurementsMin = 7;
};

struct State {
Expand Down
9 changes: 5 additions & 4 deletions Core/include/Acts/Clusterization/Clusterization.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ struct Connect1D {
};

// Default connection type based on GridDim
template <typename Cell, size_t GridDim = 2>
template <typename Cell, std::size_t GridDim = 2>
struct DefaultConnect {
static_assert(GridDim != 1 && GridDim != 2,
"Only grid dimensions of 1 or 2 are supported");
Expand All @@ -67,7 +67,7 @@ struct DefaultConnect<Cell, 1> : public Connect1D<Cell> {};
///
/// @param [in] cells the cell collection to be labeled
/// @param [in] connect the connection type (see DefaultConnect)
template <typename CellCollection, size_t GridDim = 2,
template <typename CellCollection, std::size_t GridDim = 2,
typename Connect =
DefaultConnect<typename CellCollection::value_type, GridDim>>
void labelClusters(CellCollection& cells, Connect connect = Connect());
Expand All @@ -80,13 +80,14 @@ void labelClusters(CellCollection& cells, Connect connect = Connect());
/// void clusterAddCell(Cluster&, const Cell&)
///
/// @return nothing
template <typename CellCollection, typename ClusterCollection, size_t GridDim>
template <typename CellCollection, typename ClusterCollection,
std::size_t GridDim>
ClusterCollection mergeClusters(CellCollection& /*cells*/);

/// @brief createClusters
/// Convenience function which runs both labelClusters and createClusters.
template <typename CellCollection, typename ClusterCollection,
size_t GridDim = 2,
std::size_t GridDim = 2,
typename Connect =
DefaultConnect<typename CellCollection::value_type, GridDim>>
ClusterCollection createClusters(CellCollection& cells,
Expand Down
Loading

0 comments on commit b0f3c4c

Please sign in to comment.