Skip to content

Commit

Permalink
Merge pull request #1159 from t3kt/0.38
Browse files Browse the repository at this point in the history
0.38
  • Loading branch information
t3kt authored Jan 17, 2024
2 parents 8eb07aa + 3acbdbb commit fb54c08
Show file tree
Hide file tree
Showing 563 changed files with 3,932 additions and 1,398 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ CrashAutoSave.*
*.dmp
*.ngfx-proj
build/**/*.tox
build/*.zip
docs/.instagram/access_token
etc/*unpack*
build/log/*.txt
56 changes: 41 additions & 15 deletions devel/analysis/analysis.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import json

from raytkUtil import RaytkContext, ROPInfo, InputInfo, CategoryInfo
from typing import Dict, List, Optional
import raytkDocs

# noinspection PyUnreachableCode
Expand All @@ -24,7 +23,6 @@
'Macrotable',
'Variabletable',
'Referencetable',
'Dispatchtable',
'Librarynames',
'Help',
'Helpurl',
Expand All @@ -35,7 +33,7 @@
'Raytkopversion',
]

def _formatPar(par: 'Optional[Par]'):
def _formatPar(par: Par | None):
if par is None:
return ''
if par.mode == ParMode.CONSTANT:
Expand All @@ -49,7 +47,7 @@ def _formatPar(par: 'Optional[Par]'):
else:
return '??'

def buildOpInfoTable(dat: 'DAT'):
def buildOpInfoTable(dat: DAT):
dat.clear()
dat.appendRow(
[
Expand Down Expand Up @@ -118,14 +116,14 @@ def _opHasInputVarSettings(info: 'ROPInfo'):
return True
return False

def _parHasSetting(par: 'Par'):
def _parHasSetting(par: Par):
if par.eval():
return True
if par.expr or par.bindExpr:
return True
return False

def buildOpParamsTable(dat: 'DAT'):
def buildOpParamsTable(dat: DAT):
dat.clear()
dat.appendRow(['path', 'kind'])
for rop in RaytkContext().allMasterOperators():
Expand All @@ -150,7 +148,7 @@ def buildOpParamsTable(dat: 'DAT'):
else:
cell.val = par.style

def buildOpVariablesTable(dat: 'DAT'):
def buildOpVariablesTable(dat: DAT):
dat.clear()
dat.appendRow(['path'])
for rop in RaytkContext().allMasterOperators():
Expand All @@ -172,7 +170,7 @@ def buildOpVariablesTable(dat: 'DAT'):
cell = dat[info.path, name]
cell.val = dataType

def buildOpInputsTable(dat: 'DAT'):
def buildOpInputsTable(dat: DAT):
dat.clear()
parNames = [
'Source',
Expand Down Expand Up @@ -218,7 +216,7 @@ def buildOpInputsTable(dat: 'DAT'):
for parName in parNames
])

def buildOpCurrentExpandedParamsTable(dat: 'DAT'):
def buildOpCurrentExpandedParamsTable(dat: DAT):
dat.clear()
dat.appendRow(['path', 'expandedParams'])
for rop in RaytkContext().allMasterOperators():
Expand All @@ -234,14 +232,14 @@ def buildOpCurrentExpandedParamsTable(dat: 'DAT'):
expanded,
])

def buildOpTestTable(dat: 'DAT', testTable: 'DAT'):
def buildOpTestTable(dat: DAT, testTable: DAT):
dat.clear()
dat.appendRow([
'path',
'testCount',
'test1',
])
testsByOpType = {} # type: Dict[str, List[str]]
testsByOpType = {} # type: dict[str, list[str]]
for i in range(1, testTable.numRows):
opType = str(testTable[i, 'opType'])
name = str(testTable[i, 'filePath']).rsplit('/', maxsplit=1)[1].replace('.tox', '')
Expand All @@ -262,10 +260,38 @@ def buildOpTestTable(dat: 'DAT', testTable: 'DAT'):
for cell in dat.row(0)[2:]:
cell.val = 'test' + str(cell.col - 1)

def buildOpTagTable(dat: 'DAT'):
def buildOpSnippetTable(dat: DAT, testTable: DAT):
dat.clear()
opPaths = [] # type: List[str]
opTagExprs = {} # type: Dict[str, Dict[str, str]]
dat.appendRow([
'path',
'snippetCount',
'snippet1',
])
testsByOpType = {} # type: dict[str, list[str]]
for i in range(1, testTable.numRows):
opType = str(testTable[i, 'opType'])
name = str(testTable[i, 'filePath']).rsplit('/', maxsplit=1)[1].replace('.tox', '')
if not opType:
continue
elif opType not in testsByOpType:
testsByOpType[opType] = [name]
else:
testsByOpType[opType].append(name)
for rop in RaytkContext().allMasterOperators():
opType = ROPInfo(rop).opType
tests = testsByOpType.get(opType) or []
tests.sort()
dat.appendRow([
rop.path,
len(tests),
] + tests)
for cell in dat.row(0)[2:]:
cell.val = 'snippet' + str(cell.col - 1)

def buildOpTagTable(dat: DAT):
dat.clear()
opPaths = [] # type: list[str]
opTagExprs = {} # type: dict[str, dict[str, str]]
for rop in RaytkContext().allMasterOperators():
info = ROPInfo(rop)
if not info or not info.isROP:
Expand Down Expand Up @@ -299,6 +325,6 @@ def buildToolkitIndexJson():
}
return json.dumps(toolkitIndex, indent=' ')

def _buildCategoryIndexObj(cat: 'COMP'):
def _buildCategoryIndexObj(cat: COMP):
catHelp = raytkDocs.CategoryHelp.extractFromComp(cat)
return catHelp.toFrontMatterData()
Binary file modified devel/analysis/analysis.tox
Binary file not shown.
Binary file modified devel/build/build.tox
Binary file not shown.
Loading

0 comments on commit fb54c08

Please sign in to comment.