Skip to content

Commit 80b7c5f

Browse files
authored
Adding missing function docstring and typehint; Restricting directories for cmake
1 parent ca1396f commit 80b7c5f

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

cmake/ConfigureCrownlib.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
include_directories(${CMAKE_SOURCE_DIR}/src)
33
include_directories(${CMAKE_SOURCE_DIR}/include)
44

5-
include_directories(${CMAKE_SOURCE_DIR}/analysis_configurations/*/cpp_addons/src)
6-
include_directories(${CMAKE_SOURCE_DIR}/analysis_configurations/*/cpp_addons/include)
5+
include_directories(${CMAKE_SOURCE_DIR}/analysis_configurations/${ANALYSIS}/cpp_addons/src)
6+
include_directories(${CMAKE_SOURCE_DIR}/analysis_configurations/${ANALYSIS}/cpp_addons/include)
77

88
file(GLOB SOURCES_1 ${CMAKE_SOURCE_DIR}/src/*.cxx)
99
file(GLOB SOURCES_2 ${CMAKE_SOURCE_DIR}/src/utility/*.cxx
1010
${CMAKE_SOURCE_DIR}/src/RecoilCorrections/*.cxx
1111
${CMAKE_SOURCE_DIR}/src/SVFit/*.cxx)
1212

13-
file(GLOB SOURCES_3 ${CMAKE_SOURCE_DIR}/analysis_configurations/*/cpp_addons/src/*.cxx)
13+
file(GLOB SOURCES_3 ${CMAKE_SOURCE_DIR}/analysis_configurations/${ANALYSIS}/cpp_addons/src/*.cxx)
1414

1515
set(SOURCES ${SOURCES_1} ${SOURCES_2} ${SOURCES_3})
1616

code_generation/code_generation.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,11 +324,19 @@ def load_template(self, template_path: str) -> str:
324324
template = template_file.read()
325325
return template
326326

327-
def addon_includes(self):
327+
def addon_includes(self) -> str:
328+
"""
329+
Add the includes all .hxx files from analysis configuration folder:
330+
analysis_configurations/{analysis_name}/cpp_addons/include
331+
Args:
332+
None
333+
Returns:
334+
str - the include statements for the cpp addons
335+
"""
328336
path = f"analysis_configurations/{self.analysis_name}/cpp_addons/include"
329337
if os.path.exists(path) and os.path.isdir(path) and os.listdir(path):
330338
log.info(f"Adding addons from {path}: {' '.join(os.listdir(path))}")
331-
paths = "\n".join(f'#include "{os.path.join(path, item)}"' for item in os.listdir(path))
339+
paths = "\n".join(f'#include "{os.path.join(path, item)}"' for item in os.listdir(path) if item.endswith(".hxx"))
332340
return paths
333341
else:
334342
log.info(f"No addons found in {path}")

0 commit comments

Comments
 (0)