Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cb04a61

Browse filesBrowse files
authored
Update of datamodel-doc (#10675)
* Update of datamodel-doc . Update of PWG entries in inputCard.xml . Some minor modification of the python scripts * clang-format * Removed trailing blancsspaces * Remove more trailing spaces * Removing trailing spaces again * Removing space at the end of the line
1 parent a03fc7c commit cb04a61
Copy full SHA for cb04a61

File tree

Expand file treeCollapse file tree

5 files changed

+212
-43
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

5 files changed

+212
-43
lines changed
Open diff view settings
Collapse file

‎scripts/datamodel-doc/ALICEO2codeFile.py‎

Copy file name to clipboardExpand all lines: scripts/datamodel-doc/ALICEO2codeFile.py
+28-28Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@ class produces:
77
def __init__(self, name, templated=False):
88
self.name = name
99
self.templated = templated
10-
10+
1111
def tableName(self, arguments=list(), argumentValues=list()):
1212
tname = ""
1313
if len(arguments) != len(argumentValues):
1414
print("ATTENTION:")
1515
print(" ",arguments)
1616
print(" ",argumentValues)
1717
return tname
18-
18+
1919
if self.templated:
2020
for i in range(len(arguments)):
2121
if self.name == arguments[i]:
2222
tname = argumentValues[i]
2323
continue
2424
else:
2525
tname = self.name
26-
26+
2727
return tname
2828

2929
# -----------------------------------------------------------------------------
@@ -41,19 +41,19 @@ def __init__(self, name, cont, templateArguments=list()):
4141
def setTemplated(self, templateArguments):
4242
self.templateArguments = templateArguments
4343
self.templated = True
44-
44+
4545
def addProduces(self, prod):
4646
self.produces.append(prod)
47-
47+
4848
def getTableNames(self, argumentValues=list()):
4949
tableNames = list()
5050
for prod in self.produces:
5151
tableName = prod.tableName(self.templateArguments,argumentValues)
5252
if tableName != "":
5353
tableNames.append(tableName)
54-
54+
5555
return tableNames
56-
56+
5757
def print(self):
5858
print()
5959
print("Struct: ", self.name)
@@ -65,19 +65,19 @@ def print(self):
6565
print(" produces: ", len(self.produces))
6666
for prod in self.produces:
6767
print(" ", prod.name)
68-
68+
6969
# -----------------------------------------------------------------------------
7070
class codeFile:
7171
def __init__(self, cfile):
7272
self.structs = list()
7373
self.tableNames = list()
74-
74+
7575
with open(cfile, 'r') as file:
7676
# read the file
7777
lines_in_file = file.readlines()
7878
content = O2DMT.pickContent(lines_in_file)
7979
self.tableNames = self.parseContent(content)
80-
80+
8181
def addStruct(self, struct):
8282
self.structs.append(struct)
8383

@@ -87,19 +87,19 @@ def addStruct(self, struct):
8787
def parseContent(self, content):
8888
words = content[0]
8989
lines = content[1]
90-
90+
9191
# find template <...>
9292
# restLine is everything else than a templated block
9393
restLine = ""
9494
fullLine = O2DMT.block(words)
9595
nchFullLine = len(fullLine)
9696
sob = 0
97-
97+
9898
# loop over templates
9999
inds = [i for i, x in enumerate(words) if x.txt == 'template']
100100
for ind in inds:
101101
line = O2DMT.block(words[ind:])
102-
102+
103103
# templates can come without {} block!
104104
# find out what comes first '{' or ';'
105105
if ';' in line:
@@ -115,10 +115,10 @@ def parseContent(self, content):
115115
else:
116116
[oi, ci] = O2DMT.findInBrackets("{","}",line)
117117
tempBlock = line[:ci]
118-
118+
119119
if len(tempBlock) == 0:
120120
continue
121-
121+
122122
# extract template arguments
123123
tempLine = O2DMT.lineInBrackets("<",">",line)[1:-1]
124124
argWords = tempLine.split(',')
@@ -127,7 +127,7 @@ def parseContent(self, content):
127127
kvpair = arg.split()
128128
if len(kvpair) == 2:
129129
tempArgs.append(kvpair[-1])
130-
130+
131131
# find struct within tempBlock
132132
tempWords = O2DMT.split(tempBlock)
133133
istructs = [i for i, x in enumerate(tempWords) if x == 'struct']
@@ -136,26 +136,26 @@ def parseContent(self, content):
136136
structBlock = O2DMT.block(tempWords[istruct:])
137137
newStruct = struct(tempWords[istruct+1],
138138
O2DMT.lineInBrackets("{","}",structBlock), tempArgs)
139-
139+
140140
structWords = O2DMT.split(newStruct.cont)
141141
iprods = [i for i, x in enumerate(structWords) if x == 'Produces']
142142
for iprod in iprods:
143143
# get the table name
144144
tname = O2DMT.lineInBrackets("<",">",O2DMT.block(structWords[iprod:],False))[1:-1]
145145
newProd = produces(tname, True)
146146
newStruct.addProduces(newProd)
147-
147+
148148
if len(iprods) > 0:
149149
self.addStruct(newStruct)
150-
150+
151151
# update restLine
152152
eob = nchFullLine - len(line)
153153
restLine += fullLine[sob:eob]
154154
sob = eob+ci+1
155-
155+
156156
# update restLine
157157
restLine += fullLine[sob:]
158-
158+
159159
# find struct outside of template - in restLine
160160
restWords = O2DMT.split(restLine)
161161
istructs = [i for i, x in enumerate(restWords) if x == 'struct']
@@ -164,36 +164,36 @@ def parseContent(self, content):
164164
structBlock = O2DMT.block(restWords[istruct:])
165165
newStruct = struct(restWords[istruct+1],
166166
O2DMT.lineInBrackets("{","}",structBlock))
167-
167+
168168
structWords = O2DMT.split(newStruct.cont)
169169
iprods = [i for i, x in enumerate(structWords) if x == 'Produces']
170170
for iprod in iprods:
171171
# get the table name
172172
tname = O2DMT.lineInBrackets("<",">",O2DMT.block(structWords[iprod:],False))[1:-1]
173173
newProd = produces(tname, False)
174174
newStruct.addProduces(newProd)
175-
175+
176176
if len(iprods) > 0:
177177
self.addStruct(newStruct)
178-
178+
179179
# loop over structs
180180
tableNames = list()
181181
for strct in self.structs:
182-
182+
183183
# for all templated structs: find flavoured calls of structs
184184
if strct.templated:
185-
185+
186186
# extract flavouredStruct
187187
inds = [i for i, x in enumerate(restWords) if x == strct.name]
188188
for ind in inds:
189189
if "<" in restWords[ind:ind+2]:
190190
# extract argument values
191191
argValues = O2DMT.getArgumentValues(restWords[ind:])
192192
tableNames += strct.getTableNames(argValues)
193-
193+
194194
else:
195195
tableNames += strct.getTableNames()
196-
196+
197197
# uniqify tableNames
198198
tableNames = list(set(tableNames))
199199

Collapse file

‎scripts/datamodel-doc/ALICEO2includeFile.py‎

Copy file name to clipboardExpand all lines: scripts/datamodel-doc/ALICEO2includeFile.py
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,6 +1110,9 @@ def addRelations(self, fileName, ptype, dmname):
11101110
with open(fileName, 'r') as file:
11111111
# read the file
11121112
lines_in_file = file.readlines()
1113+
# skip commented lines (starting with #)
1114+
lines_in_file = [i for i in lines_in_file if not i.startswith("#")]
1115+
# extract content
11131116
content = O2DMT.pickContent(lines_in_file)
11141117

11151118
# parse CMakeLists file
Collapse file

‎scripts/datamodel-doc/extractDataModel.py‎

Copy file name to clipboardExpand all lines: scripts/datamodel-doc/extractDataModel.py
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,10 @@ def setProducers(O2Physicsdir, cerelations, dm, subDM, todo=0):
153153
# update the data model accordingly using setProducer
154154
for codefile in codefiles:
155155
codefile = codefile.rstrip("\n")
156-
156+
157157
CErelation = cerelations.getExecutable(codefile)
158+
if (len(CErelation) != 5):
159+
continue
158160
codeFile = O2CF.codeFile(codefile)
159161
for tableName in codeFile.tableNames:
160162
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -166,7 +168,7 @@ def setProducers(O2Physicsdir, cerelations, dm, subDM, todo=0):
166168
#
167169
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
168170
dm.setProducer(CErelation, tableName)
169-
171+
170172
return True
171173

172174
# -----------------------------------------------------------------------------

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.