MCPcopy Index your code
hub / github.com/SLiCAP/SLiCAP_python / _doNoise

Function _doNoise

SLiCAP/SLiCAPexecute.py:358–398  ·  view source on GitHub ↗

Adds the instr of a noise analysis to instr. :param instr: SLiCAP instruction object that holds instruction data. :type instr: SLiCAPinstruction.instruction :return: instr of the execution of the instruction. :rtype: SLiCAPinstruction.instruction

(instr)

Source from the content-addressed store, hash-verified

356 return instr
357
358def _doNoise(instr):
359 """
360 Adds the instr of a noise analysis to instr.
361
362 :param instr: SLiCAP instruction object that holds instruction data.
363 :type instr: SLiCAPinstruction.instruction
364
365 :return: instr of the execution of the instruction.
366 :rtype: SLiCAPinstruction.instruction
367 """
368 if instr.step:
369 if ini.step_function:
370 noiseinstr = _doPyNoise(instr)
371 instr.onoise = _stepFunctions(instr.stepDict, noiseinstr.onoise[0])
372 instr.inoise = _stepFunctions(instr.stepDict, noiseinstr.inoise[0])
373 for srcName in list(noiseinstr.onoiseTerms.keys()):
374 instr.onoiseTerms[srcName] = _stepFunctions(instr.stepDict, noiseinstr.onoiseTerms[srcName][0])
375 instr.inoiseTerms[srcName] = _stepFunctions(instr.stepDict, noiseinstr.inoiseTerms[srcName][0])
376 else:
377 stepVars = list(instr.stepDict.keys())
378 numSteps = len(instr.stepDict[stepVars[0]])
379 for i in range(numSteps):
380 for j in range(len(stepVars)):
381 instr.parDefs[stepVars[j]]=instr.stepDict[stepVars[j]][i]
382 instr = _doPyNoise(instr)
383 else:
384 instr = _doPyNoise(instr)
385 instr.onoise = instr.onoise[0]
386 instr.inoise = instr.inoise[0]
387 for key in list(instr.onoiseTerms.keys()):
388 if type(instr.onoiseTerms[key]) == list and len(instr.onoiseTerms[key]) != 0 :
389 instr.onoiseTerms[key] = instr.onoiseTerms[key][0]
390 if instr.source != [None, None] and instr.source != None:
391 instr.inoiseTerms[key] = instr.inoiseTerms[key][0]
392 else:
393 del(instr.onoiseTerms[key])
394 if instr.source != [None, None] and instr.source != None:
395 del(instr.inoiseTerms[key])
396 instr = _correctDMcurrentinstr(instr)
397 instr = _updateSRCnames(instr)
398 return instr
399
400def _doDCvar(instr):
401 """

Callers 1

_doInstructionFunction · 0.85

Calls 4

_doPyNoiseFunction · 0.85
_stepFunctionsFunction · 0.85
_correctDMcurrentinstrFunction · 0.85
_updateSRCnamesFunction · 0.85

Tested by

no test coverage detected