datamancer/formulaExp

Source   Edit  

Idents used for the generated code

Types

Assign = object
  asgnKind*: AssignKind
  node*: NimNode ## the exact node that will be replaced by this `Assign` instance
                 ## In case of `byCustom`, just the user input that will be inserted again
  element*: NimNode
  tensor*: NimNode
  col*: NimNode
  colType*: NimNode
  resType*: NimNode
  transformed*: NimNode
Source   Edit  
AssignKind = enum
  byIndex,                  ## assign by index
  byTensor,                 ## by tensor
  byCustom                   ## custom variable declaration in preface
                             ## replace occurence of nnkAccQuote, nnkCallStrLit, nnkBracketExpr(df) by:
Source   Edit  
FormulaCT = object
  funcKind*: FormulaKind
  preface*: Preface
  typeHint*: TypeHint
  resType*: NimNode
  name*: NimNode
  rawName*: string
  loop*: NimNode
  generateLoop*: bool
Source   Edit  
FormulaKind = enum
  fkNone = "none",          ## default value for uninitialized formula / no formula kind at CT yet
  fkVariable = "",          ## Nim variable as `Value`, pure
  fkAssign = "<-",          ## assignment op, pure
  fkVector = "~",           ## map operation, impure
  fkScalar = "<<"            ## reduce operation, impure
                             ## either: `t in df["foo", int]`
                             ## or: `t = df["foo", int]`
Source   Edit  
FormulaTypes = object
  inputType*: NimNode
  resType*: NimNode
Source   Edit  
Lift = object
  toLift*: NimNode
  liftedNode*: NimNode
Source   Edit  
Preface = object
  args*: seq[Assign]
Source   Edit  
TypeHint = object
  inputType*: Option[NimNode]
  resType*: Option[NimNode]
Source   Edit  

Consts

DtypeOrderMap = (data: [(1148029984, "Value", 1), (3464699359, "int", 8),
                        (0, "", 0), (0, "", 0),
                        (1169023076, "Tensor[float64]", 13), (0, "", 0),
                        (1521873350, "Tensor[float]", 11), (0, "", 0),
                        (1846008072, "Tensor[int]", 7),
                        (2624879753, "Tensor[int64]", 9),
                        (4266707305, "int64", 10), (2904652459, "string", 6),
                        (2516295656, "float", 12), (2412827210, "bool", 16),
                        (0, "", 0), (0, "", 0), (0, "", 0), (0, "", 0),
                        (0, "", 0), (4115314515, "T", 4),
                        (3306470387, "Tensor[bool]", 15), (0, "", 0),
                        (0, "", 0), (0, "", 0), (0, "", 0), (0, "", 0),
                        (0, "", 0), (0, "", 0), (1490866044, "Tensor[T]", 3),
                        (4270691677, "float64", 14),
                        (3580412414, "Tensor[string]", 5),
                        (1977826847, "Tensor[Value]", 2)], counter: 16)
Source   Edit  
Dtypes = ["float", "int", "string", "bool", "Value"]
Source   Edit  
DtypesAll = ["float", "float64", "int", "int64", "string", "bool", "Value"]
Source   Edit  

Procs

proc `$`(p: Preface): string {....raises: [ValueError, Exception],
                               tags: [RootEffect].}
Source   Edit  
proc extractCall(stmts: NimNode; id: string): NimNode {....raises: [], tags: [].}
Source   Edit  
proc generateClosure(fct: FormulaCT): NimNode {....raises: [ValueError, Exception],
    tags: [RootEffect].}
Source   Edit  
proc hasExplicitTypeHint(n: NimNode): bool {....raises: [], tags: [].}
Source   Edit  
proc isColumnType(n: NimNode): bool {....raises: [], tags: [].}
Source   Edit  
proc isValidType(n: NimNode): bool {....raises: [], tags: [].}
Source   Edit  
proc nodeIsDf(n: NimNode): bool {....raises: [], tags: [].}
Source   Edit  
proc nodeIsDfIdx(n: NimNode): bool {....raises: [], tags: [].}
Source   Edit  
proc parsePreface(n: NimNode): Preface {....raises: [], tags: [].}
Source   Edit  
proc sortTypes(s: seq[NimNode]): seq[string] {....raises: [KeyError], tags: [].}
Source   Edit  
proc sortTypes(s: seq[string]): seq[string] {....raises: [KeyError], tags: [].}
sorts the types according to our own "priority list" Source   Edit  
proc toStrType(n: NimNode): NimNode {....raises: [], tags: [].}
Source   Edit