diff --git a/master/nimlite/funcs/column_selector.nim b/master/nimlite/funcs/column_selector.nim index 96d17e4a..7fbc5ee5 100644 --- a/master/nimlite/funcs/column_selector.nim +++ b/master/nimlite/funcs/column_selector.nim @@ -7,223 +7,3 @@ export toPyObj export collectColumnSelectInfo export doSliceConvert export fromPyObjToDesiredInfos - -when isMainModule and appType != "lib": - - import std/[os, tables, sugar, sets, sequtils, paths, macros] - import nimpy - from ../nimpyext import `!` - import std/options as opt - import ../pymodules - import ../numpy - import typetraits - - proc columnSelect(table: nimpy.PyObject, cols: nimpy.PyObject, tqdm: nimpy.PyObject, dir_pid: Path, TaskManager: nimpy.PyObject): (nimpy.PyObject, nimpy.PyObject) = - # this is nim-only implementation, the library build doesn't need it because we need TaskManager to be used for slices - let TableClass = modules().getType(table) - var pbar = tqdm!(total: 100, desc: "column select") - let colInfoResult = collectColumnSelectInfo(table, cols, string dir_pid, pbar) - - if toSeq(colInfoResult.isCorrectType.values).all(proc (x: bool): bool = x): - let tblPassColumns = collect(initTable()): - for (desiredName, desiredInfo) in colInfoResult.desiredColumnMap.pairs(): - {desiredName: table[desiredInfo.originalName]} - - let tblFailColumns = collect(initTable()): - for desiredName in colInfoResult.failedColumnData: - {desiredName: newSeq[nimpy.PyObject]()} - - let tblPass = TableClass!(columns: tblPassColumns) - let tblFail = TableClass!(columns: tblFailColumns) - - return (tblPass, tblFail) - - template ordered2PyDict(keys: seq[string]): nimpy.PyObject = - let dict = modules().builtins.classes.DictClass!() - - for k in keys: - dict[k] = newSeq[nimpy.PyObject]() - - dict - - var tblPass = TableClass!(columns = colInfoResult.passedColumnData.ordered2PyDict()) - var tblFail = TableClass!(columns = colInfoResult.failedColumnData.ordered2PyDict()) - - var taskListInp = collect: - for i in 0.. 0: + let pgid = base.classes.SimplePageClass.next_id(string basedir).to(string) + let pgPath = string(pagedir / Path(pgid & ".npy")) + let page = originalPage[slice] + page.save(pgPath) + + let pyPage = newPyPage(page, string basedir, pgid) + + discard column.pages.append(pyPage) while true: var len = getPageLen(columns[firstPage]) @@ -225,17 +237,15 @@ proc filter*(table: nimpy.PyObject, pyExpressions: seq[nimpy.PyObject], filterTy inc firstPage currentOffset = currentOffset + len - var maskOffset = 0 - - let indiceOffset = offset - currentOffset + var indiceOffset = offset - currentOffset + var maskLeftOver = bitNum - maskOffset - while maskOffset < bitNum: + while maskLeftOver > 0: let page = readNumpy(columns[firstPage]) - let len = page.len - let sliceMax = min((bitNum - maskOffset), len) - let sliceLen = sliceMax - maskOffset - let slice = maskOffset..=", value2: 2), - # m.builtins.classes.DictClass!(column1: "b", criteria: "==", value2: 20), - m.builtins.classes.DictClass!(column1: "a", criteria: "==", column2: "c"), - ] - - Config.PAGE_SIZE = 2 - - let (tblPass, tblFail) = filter(table, pyExpressions, "all", nil) - - discard tblPass.show() - discard tblFail.show() diff --git a/master/nimlite/funcs/groupby.nim b/master/nimlite/funcs/groupby.nim index d52bd703..66fed6b5 100644 --- a/master/nimlite/funcs/groupby.nim +++ b/master/nimlite/funcs/groupby.nim @@ -3,27 +3,27 @@ import std/[math, tables, strutils, strformat, sequtils, enumerate, sugar, optio import ../[pytypes, numpy, pymodules, nimpyext] import ./imputation -type Accumulator = enum +type Accumulator* = enum Max, Min, Sum, First, Last, Product, Count, CountUnique, Average, StandardDeviation, Median, Mode proc str2Accumulator*(str: string): Accumulator = - let lower = str.toLower() - case lower: - of "max": result = Max - of "min": result = Min - of "sum": result = Sum - of "first": result = First - of "last": result = Last - of "product": result = Product - of "count": result = Count - of "count_unique": result = CountUnique - of "avg": result = Average - of "stdev": result = StandardDeviation - of "median": result = Median - of "mode": result = Mode - else: - raise newException(ValueError, &"Unrecognized groupby accumulator - {str}.") + return ( + case str.toLower(): + of "max": Max + of "min": Min + of "sum": Sum + of "first": First + of "last": Last + of "product": Product + of "count": Count + of "countunique", "count_unique": CountUnique + of "avg", "average": Average + of "stdev", "standarddeviation": StandardDeviation + of "median": Median + of "mode": Mode + else: raise newException(ValueError, &"Unrecognized groupby accumulator - {str}.") + ) # ============================================================= type GroupByFunction = ref object of RootObj @@ -446,33 +446,21 @@ method value*(self: GroupByMode): Option[PY_ObjectND] = # ============================================================= proc getGroupByFunction(acc: Accumulator): GroupByFunction = - case acc: - of Accumulator.Max: - return newGroupbyMax() - of Accumulator.Min: - return newGroupbyMin() - of Accumulator.Sum: - return newGroupBySum() - of Accumulator.Product: - return newGroupByProduct() - of Accumulator.First: - return newGroupByFirst() - of Accumulator.Last: - return newGroupByLast() - of Accumulator.Count: - return newGroupByCount() - of Accumulator.CountUnique: - return newGroupByCountUnique() - of Accumulator.Average: - return newGroupByAverage() - of Accumulator.StandardDeviation: - return newGroupByStandardDeviation() - of Accumulator.Median: - return newGroupByMedian() - of Accumulator.Mode: - return newGroupByMode() - else: - raise newException(ValueError, &"unknown accumulator - {acc}") + return ( + case acc: + of Max: newGroupbyMax() + of Min: newGroupbyMin() + of Sum: newGroupBySum() + of Product: newGroupByProduct() + of First: newGroupByFirst() + of Last: newGroupByLast() + of Count: newGroupByCount() + of CountUnique: newGroupByCountUnique() + of Average: newGroupByAverage() + of StandardDeviation: newGroupByStandardDeviation() + of Median: newGroupByMedian() + of Mode: newGroupByMode() + ) proc getPages(indices: seq[seq[PY_ObjectND]], columnIndex: int): seq[nimpy.PyObject] = let @@ -642,7 +630,8 @@ proc groupby*(T: nimpy.PyObject, keys: seq[string], functions: seq[(string, Accu var columnsPaths: OrderedTable[string, seq[string]] = collect(initOrderedTable()): for cn in columnNames: {cn: tabliteBase.collectPages(T[cn])} - var pbar = tqdm!(desc: &"groupby", total: len(columnsPaths[toSeq(columnsPaths.keys)[0]])) + var TqdmClass = if tqdm.isNone: m.tqdm.classes.TqdmClass else: tqdm + var pbar = TqdmClass!(desc: &"groupby", total: len(columnsPaths[toSeq(columnsPaths.keys)[0]])) var aggregationFuncs = initOrderedTable[seq[PY_ObjectND], seq[(string, GroupByFunction)]]() for pagesZipped in pageZipper(columnsPaths): for row in iteratePages(pagesZipped): @@ -691,61 +680,3 @@ proc groupby*(T: nimpy.PyObject, keys: seq[string], functions: seq[(string, Accu newTable[cn] = column discard pbar.close() return newTable - -# when appType != "lib": -# modules().tablite.modules.config.classes.Config.PAGE_SIZE = 1 -# let columns = modules().builtins.classes.DictClass!() - - - # columns["A"] = @[nimValueToPy(nil), nimValueToPy(2), nimValueToPy(2), nimValueToPy(4), nimValueToPy(nil)] - # columns["B"] = @[nimValueToPy(2), nimValueToPy(3), nimValueToPy(4), nimValueToPy(7), nimValueToPy(6)] - - # columns["a"] = @[0, 1, 2, 3, 4, 0, 1, 2, 3, 4] - # columns["b"] = @[0, 1, 2, 3, 4, 0, 1, 2, 3, 4] - # columns["c"] = @[0, 1, 2, 3, 4, 0, 1, 2, 3, 4] - # columns["d"] = @[0, 1, 2, 3, 4, 0, 1, 2, 3, 4] - # columns["e"] = @[0, 1, 2, 3, 4, 0, 1, 2, 3, 4] - # columns["f"] = @[1, 4, 5, 10, 13, 1, 4, 7, 10, 13] - # columns["g"] = @[0, 1, 8, 27, 64, 0, 1, 8, 27, 64] - - # columns["a"] = @[1, 1, 1, 1, 1, 1] - # columns["b"] = @[-2, -1, 0, 1, 2, 3] - - # let table = modules().tablite.classes.TableClass!(columns = columns) - - # discard table.show() - - # var r = table.groupby(keys = @["A"], functions = @[]) # None, 2, 4 - # var r = table.groupby(keys = @["A", "B"], functions = @[]) # just like original - # var r = table.groupby(keys = @["A", "B"], functions = @[("A", Accumulator.Min)]) # Min(A) None, 2, 2, 4, None - # var r = table.groupby(keys = @["A", "B"], functions = @[("A", Accumulator.Max)]) # Max(A) None, 2, 2, 4, None - # var r = table.groupby(keys = @["A"], functions = @[("B", Accumulator.Sum)]) # 8, 7, 7 - # var r = table.groupby(keys = @["A"], functions = @[("B", Accumulator.Product)]) # 12, 12, 7 - # var r = table.groupby(keys = @["A"], functions = @[("B", Accumulator.First)]) # 2, 3, 7 - # var r = table.groupby(keys = @["A"], functions = @[("B", Accumulator.Last)]) # 6, 4, 7 - # var r = table.groupby(keys = @["A"], functions = @[("B", Accumulator.Count)]) # 2, 2, 1 - # var r = table.groupby(keys = @["A"], functions = @[("B", Accumulator.CountUnique)]) # 2, 2, 1 - # var r = table.groupby(keys = @["A"], functions = @[("B", Accumulator.Average)]) # 4, 3.5, 7 - # var r = table.groupby(keys = @["A"], functions = @[("B", Accumulator.StandardDeviation)]) # 2.8284, 0.7071, 0.0 - # var r = table.groupby(keys = @["A"], functions = @[("B", Accumulator.Median)]) # 4, 3.5, 7 - # var r = table.groupby(keys = @["A"], functions = @[("B", Accumulator.Mode)]) # 6, 4, 7 - - # var r = table.groupby(keys = @["a", "b"], functions = @[ - # ("f", Accumulator.Max), - # ("f", Accumulator.Min), - # ("f", Accumulator.Sum), - # ("f", Accumulator.Product), - # ("f", Accumulator.First), - # ("f", Accumulator.Last), - # ("f", Accumulator.Count), - # ("f", Accumulator.CountUnique), - # ("f", Accumulator.Average), - # ("f", Accumulator.StandardDeviation), - # ("a", Accumulator.StandardDeviation), - # ("f", Accumulator.Median), - # ("f", Accumulator.Mode), - # ("g", Accumulator.Median), - # ]) - - # var r = table.groupby(keys = @["a"], functions = @[("b", Accumulator.Max)]) - # discard r.show() diff --git a/master/nimlite/funcs/imputation.nim b/master/nimlite/funcs/imputation.nim index ca12d314..811e3581 100644 --- a/master/nimlite/funcs/imputation.nim +++ b/master/nimlite/funcs/imputation.nim @@ -156,7 +156,8 @@ proc nearestNeighbourImputation*(T: nimpy.PyObject, sources: seq[string], var missingValsCounts = collect: (for v in missing_value_index.values(): len(v)) totalSteps = sum(missingValsCounts) - pbar = tqdm!(desc: &"imputation.nearest_neighbour", total: totalSteps) + TqdmClass = if tqdm.isNone: m.tqdm.classes.TqdmClass else: tqdm + pbar = TqdmClass!(desc: &"imputation.nearest_neighbour", total: totalSteps) ranks: seq[PY_ObjectND] = @[] newOrder = initTable[seq[int], seq[PY_ObjectND]]() @@ -265,35 +266,3 @@ proc nearestNeighbourImputation*(T: nimpy.PyObject, sources: seq[string], discard pbar.close() return newTable - -when appType != "lib": - modules().tablite.modules.config.classes.Config.PAGE_SIZE = 1 - let columns = modules().builtins.classes.DictClass!() - # 1 - columns["A"] = @[nimValueToPy(0), nimValueToPy(1), nimValueToPy(nil), nimValueToPy(3), nimValueToPy(0)] - columns["B"] = @[nimValueToPy("4"), nimValueToPy(5), nimValueToPy(6), nimValueToPy(7), nimValueToPy(4)] - - # 2 - # columns["a"] = @[1, 1, 5, 5, 6, 6] - # columns["b"] = @[2, 2, 5, 5, 6, -1] - # columns["c"] = @[nimValueToPy(3), nimValueToPy(nil), nimValueToPy(5), nimValueToPy("NULL"), nimValueToPy(6), nimValueToPy(6)] - - # 3 - # columns["a"] = @[nimValueToPy(nil), nimValueToPy(1), nimValueToPy(2), nimValueToPy(3)] - # columns["b"] = @[nimValueToPy(0), nimValueToPy(nil), nimValueToPy(2), nimValueToPy(3)] - # columns["c"] = @[nimValueToPy(0), nimValueToPy(1), nimValueToPy(nil), nimValueToPy(3)] - # columns["d"] = @[nimValueToPy(0), nimValueToPy(1), nimValueToPy(2), nimValueToPy(nil)] - - let table = modules().tablite.classes.TableClass!(columns = columns) - - discard table.show() - - # echo index(table, @["A", "B"]) - # 1 - var r = nearestNeighbourImputation(table, @["A", "B"], @[PY_ObjectND(PY_None)], @["A"]) - # 2 - # var r = nearestNeighbourImputation(table, @["a", "b", "c"], @[PY_ObjectND(PY_None), newPY_Object("NULL"), newPY_Object(-1)], @["b", "c"]) - # 3 - # var r = nearestNeighbourImputation(table, @["a", "b", "c", "d"], @[PY_ObjectND(PY_None)], @["a", "b", "c", "d"]) - - discard r.show() diff --git a/master/nimlite/funcs/text_reader.nim b/master/nimlite/funcs/text_reader.nim index a60b910f..2097a107 100644 --- a/master/nimlite/funcs/text_reader.nim +++ b/master/nimlite/funcs/text_reader.nim @@ -13,163 +13,3 @@ export text_reader export table export encfile export csvparse - -when isMainModule and appType != "lib": - import nimpy - import std/[paths, osproc, times, enumerate, strutils, options, os] - import ../[numpy, pymodules, nimpyext] - - proc toTaskArgs*(path: string, encoding: string, dialect: TabliteDialect, task: TabliteTask, import_fields: seq[uint], guess_dtypes: bool, skip_empty: string): TaskArgs {.inline.} = - return toTaskArgs( - path = path, - encoding = encoding, - dia_delimiter = dialect.delimiter, - dia_quotechar = dialect.quotechar, - dia_escapechar = dialect.escapechar, - dia_doublequote = dialect.doublequote, - dia_quoting = dialect.quoting, - dia_skipinitialspace = dialect.skipinitialspace, - dia_skiptrailingspace = dialect.skiptrailingspace, - dia_lineterminator = dialect.lineterminator, - dia_strict = dialect.strict, - guess_dtypes = guess_dtypes, - tsk_pages = task.pages, - tsk_offset = task.offset, - tsk_count = task.count, - import_fields = import_fields, - skip_empty = skip_empty - ) - - proc runTask*(taskArgs: TaskArgs, pageInfo: PageInfo): void = - discard taskArgs.textReaderTask(pageInfo) - - proc executeParallel*(path: string): void = - echo "Executing tasks: '" & path & "'" - let args = @[ - "--progress", - "-a", - "\"" & path & "\"" - ] - - let para = "/usr/bin/parallel" - let ret_code = execCmd(para & " " & args.join(" ")) - - if ret_code != 0: - raise newException(Exception, "Process failed with errcode: " & $ret_code) - - proc importFile*( - pid: string, taskname: string, path: string, encoding: FileEncoding, dialect: Dialect, - cols: Option[seq[string]], first_row_has_headers: bool, header_row_index: uint, - page_size: uint, guess_dtypes: bool, skipEmpty: SkipEmpty, - start: Option[int], limit: Option[int] - ): PyObject = - let d0 = getTime() - - let table = importTextFile(pid, path, encoding, dialect, cols, first_row_has_headers, header_row_index, page_size, guess_dtypes, skipEmpty, start, limit) - let task = table.task - - for i, column_task in enumerate(task.tasks): - let taskArgs = toTaskArgs(task.path, task.encoding, task.dialect, column_task, task.import_fields, task.guess_dtypes, $skipEmpty) - let pageInfo = taskArgs.collectPageInfoTask() - - taskArgs.runTask(pageInfo) - echo "Dumped " & $(i + 1) & "/" & $task.tasks.len - - let d1 = getTime() - echo $(d1 - d0) - - let pyTable = modules().tablite.classes.TableClass!() - - for cInfo in table.columns: - let pyColumn = modules().tablite.modules.base.classes.ColumnClass!(pid) - pyTable[cInfo.name] = pyColumn - - for page in cInfo.pages: - let pPage = Path(page) - - let workdir = string pPage.parentDir.parentDir - let id = string pPage.extractFilename.changeFileExt("") - - let len = getPageLen(page) - let dtypes = getPageTypes(page) - let page = newPyPage(id, workdir, len, dtypes) - - discard pyColumn.pages.append(page) - - return pyTable - - let m = modules() - let Config = m.tablite.modules.config.classes.Config - let workdir = Path(m.toStr(Config.workdir)) - - var path_csv: string - var encoding = str2Enc($ENC_UTF8) - var dialect: Dialect - var cols = none[seq[string]]() - var guess_dtypes = true - var pid = string (workdir / Path("nim")) - var taskname = "task" - var page_size = uint Config.PAGE_SIZE.to(int) - - var delimiter = ',' - var quotechar = '"' - var escapechar = '\\' - var lineterminator = '\n' - var doublequote = true - var quoting = QUOTE_MINIMAL - - var skipinitialspace = false - var skiptrailingspace = false - var skipEmpty = SkipEmpty.ALL - - dialect = newDialect( - delimiter = delimiter, - quotechar = quotechar, - escapechar = escapechar, - doublequote = doublequote, - quoting = quoting, - skipinitialspace = skipinitialspace, - skiptrailingspace = skiptrailingspace, - lineterminator = lineterminator, - ) - - let dirdata = os.getEnv("DATA_DIR", ".") - - # (path_csv, encoding) = ("tests/data/split_lines.csv", str2Enc($ENC_UTF8)) - # (path_csv, encoding) = (dirdata & "/Dealz Poland v1.csv", str2Enc($ENC_UTF8)) - # (path_csv, encoding) = ("tests/data/floats.csv", str2Enc($ENC_UTF8)) - # (path_csv, encoding) = ("tests/data/bad_empty.csv", str2Enc($ENC_UTF8)) - # (path_csv, encoding) = ("tests/data/book1.csv", str2Enc($ENC_UTF8)) - # (path_csv, encoding) = ("tests/data/detect_misalignment.csv", str2Enc($ENC_UTF8)) - # (path_csv, encoding) = (dirdata & "/Ritual B2B orderlines updated.csv", str2Enc($ENC_UTF8)) - # (path_csv, encoding) = (dirdata & "/Ritual B2B orderlines_small.csv", str2Enc($ENC_UTF8)) - # (path_csv, encoding) = ("tests/data/utf16_test.csv", str2Enc($ENC_UTF16)) - # (path_csv, encoding) = ("tests/data/win1250_test.csv", str2ConvEnc("Windows-1252")) - - # (path_csv, encoding) = ("tests/data/book1.txt", str2Enc($ENC_UTF8)) - # (path_csv, encoding) = ("tests/data/gdocs1.csv", str2Enc($ENC_UTF8)) - # (path_csv, encoding) = ("tests/data/with_empty_lines.csv", str2Enc($ENC_UTF8)) - (path_csv, encoding) = ("tests/data/with_escape.csv", str2Enc($ENC_UTF8)) - # (path_csv, encoding) = (dirdata & "/Dematic YDC Order Data.csv", str2Enc($ENC_UTF8)) - # (path_csv, encoding) = (dirdata & "/Dematic YDC Order Data_1M.csv", str2Enc($ENC_UTF8)) - # (path_csv, encoding) = (dirdata & "/Dematic YDC Order Data_1M_1col.csv", str2Enc($ENC_UTF8)) - # (path_csv, encoding) = (dirdata & "/gesaber_data.csv", str2Enc($ENC_UTF8)) - # (path_csv, encoding) = ("tests/data/utf16_be.csv", str2Enc($ENC_UTF16)) - # (path_csv, encoding) = ("tests/data/utf16_le.csv", str2Enc($ENC_UTF16)) - - # cols = some(@["\"Item\"", "\"Materiál\"", "\"Objem\"", "\"Jednotka objemu\"", "\"Free Inv Pcs\""]) - # dialect.quoting = Quoting.QUOTE_NONE - # dialect.delimiter = ';' - - let start = some[int](0) - let limit = some[int](-1) - let first_row_has_headers = true - let header_row_index = uint 0 - - guess_dtypes = true - # cols = some(@["a", "c"]) - # page_size = 2 - - let pyTable = importFile(pid, taskname, path_csv, encoding, dialect, cols, first_row_has_headers, header_row_index, page_size, guess_dtypes, skipEmpty, start, limit) - - discard pyTable.show(dtype=true) diff --git a/master/nimlite/libnimlite.so b/master/nimlite/libnimlite.so index 0ae346da..1a3424d3 100644 Binary files a/master/nimlite/libnimlite.so and b/master/nimlite/libnimlite.so differ diff --git a/master/nimlite/numpy.nim b/master/nimlite/numpy.nim index 532f000a..015d7c34 100644 --- a/master/nimlite/numpy.nim +++ b/master/nimlite/numpy.nim @@ -1462,36 +1462,4 @@ proc index*(table: nimpy.PyObject, columnNames: openArray[string]): TableIndices d[row] = newSeq[int]() d[row].add(ix) inc ix - return d - -when isMainModule and appType != "lib": - let tabliteConfig = modules().tablite.modules.config.classes.Config - # let workdir = Path(modules().toStr(tabliteConfig.workdir)) - let pid = "nim" - # let pagedir = workdir / Path(pid) / Path("pages") - - echo readNumpy("tests/data/pages/scalar.npy").len - - # createDir(string pagedir) - - tabliteConfig.pid = pid - tabliteConfig.PAGE_SIZE = 2 - - let columns = modules().builtins.classes.DictClass!({"A": @["1", "22", "333", "4444", "55555", "666666", "7777777"]}.toTable) - let table = modules().tablite.classes.TableClass!(columns = columns) - let pages = collect: (for p in table["A"].pages: modules().toStr(p.path)) - - let newPages = repaginate(pages) - - echo newPages - - for i in toSeq(iterateColumn[string](table["A"])): - echo i - - echo newNDArray[DateNDArray](@[now().utc]) - echo newNDArray[DateTimeNDArray](@[now().utc]) - echo newNDArray(@[false, false, true]) - echo newNDArray(@[1, 2, 3]) - echo newNDArray(@[1.0, 2.0, 3.0]) - echo newNDArray(@["a", "bb", "ccc"]) - echo newNDArray(@[newPY_Object()]) + return d \ No newline at end of file diff --git a/master/nimlite/pymodules.nim b/master/nimlite/pymodules.nim index f7b95807..c4296030 100644 --- a/master/nimlite/pymodules.nim +++ b/master/nimlite/pymodules.nim @@ -1,4 +1,13 @@ -from std/os import getEnv +import dotenv +import nimpy/py_lib +from std/os import getEnv, existsEnv, fileExists + +if fileExists("./.env"): + load() + +if existsEnv("LIB_PYTHON"): + pyInitLibPath(getEnv("LIB_PYTHON")) + from std/strutils import split from std/sugar import collect from nimpyext import `!` @@ -151,7 +160,7 @@ proc getLen*(inst: PyModule[PyBuiltins], obj: PyObject): int {.inline.} = inst.m proc fromFile*(inst: PyModule[PyTablite], path: string): PyObject {.inline.} = inst.classes.TableClass.from_file(path) proc collectPages*(inst: PyModule[PyTabliteBase], column: PyObject): seq[string] {.inline.} = let builtins = modules().builtins - + if not builtins.isinstance(column, inst.classes.ColumnClass): raise newException(ValueError, "not a column") @@ -168,7 +177,6 @@ proc toStr*(self: PyModules, obj: PyObject): string {.inline.} = self.builtins.t proc toRepr*(self: PyModules, obj: PyObject): string {.inline.} = self.builtins.toRepr(obj) proc getLen*(self: PyModules, obj: PyObject): int {.inline.} = self.builtins.getLen(obj) - proc isNone*(obj: PyObject): bool {.inline.} = modules().builtins.isinstance(obj, py.get.builtins.classes.NoneTypeClass) proc `in`*[T](a: T, b: nimpy.PyObject): bool {.inline.} = let m = modules() @@ -184,4 +192,4 @@ proc contains*[T](a: T, b: nimpy.PyObject): bool {.inline.} = return isIn.to(bool) -proc `notin`*[T](a: T, b: nimpy.PyObject): bool {.inline.} = return not (a in b) \ No newline at end of file +proc `notin`*[T](a: T, b: nimpy.PyObject): bool {.inline.} = return not (a in b) diff --git a/master/objects.inv b/master/objects.inv index 6d942a2e..ec2db1bc 100644 Binary files a/master/objects.inv and b/master/objects.inv differ diff --git a/master/reference/groupby_utils/index.html b/master/reference/groupby_utils/index.html index 3354ee59..4b0161c8 100644 --- a/master/reference/groupby_utils/index.html +++ b/master/reference/groupby_utils/index.html @@ -1510,7 +1510,7 @@
Attributes
- tablite.groupby_utils.GroupBy.max = 'max' + tablite.groupby_utils.GroupBy.max = 'Max' class-attribute @@ -1530,7 +1530,7 @@
- tablite.groupby_utils.GroupBy.min = 'min' + tablite.groupby_utils.GroupBy.min = 'Min' class-attribute @@ -1550,7 +1550,7 @@
- tablite.groupby_utils.GroupBy.sum = 'sum' + tablite.groupby_utils.GroupBy.sum = 'Sum' class-attribute @@ -1570,7 +1570,7 @@
- tablite.groupby_utils.GroupBy.product = 'product' + tablite.groupby_utils.GroupBy.product = 'Product' class-attribute @@ -1590,7 +1590,7 @@
- tablite.groupby_utils.GroupBy.first = 'first' + tablite.groupby_utils.GroupBy.first = 'First' class-attribute @@ -1610,7 +1610,7 @@
- tablite.groupby_utils.GroupBy.last = 'last' + tablite.groupby_utils.GroupBy.last = 'Last' class-attribute @@ -1630,7 +1630,7 @@
- tablite.groupby_utils.GroupBy.count = 'count' + tablite.groupby_utils.GroupBy.count = 'Count' class-attribute @@ -1650,7 +1650,7 @@
- tablite.groupby_utils.GroupBy.count_unique = 'count_unique' + tablite.groupby_utils.GroupBy.count_unique = 'CountUnique' class-attribute @@ -1670,7 +1670,7 @@
- tablite.groupby_utils.GroupBy.avg = 'avg' + tablite.groupby_utils.GroupBy.avg = 'Average' class-attribute @@ -1690,7 +1690,7 @@
- tablite.groupby_utils.GroupBy.stdev = 'stdev' + tablite.groupby_utils.GroupBy.stdev = 'StandardDeviation' class-attribute @@ -1710,7 +1710,7 @@
- tablite.groupby_utils.GroupBy.median = 'median' + tablite.groupby_utils.GroupBy.median = 'Median' class-attribute @@ -1730,7 +1730,7 @@
- tablite.groupby_utils.GroupBy.mode = 'mode' + tablite.groupby_utils.GroupBy.mode = 'Mode' class-attribute diff --git a/master/reference/pivots/index.html b/master/reference/pivots/index.html index 928c7512..c44e6568 100644 --- a/master/reference/pivots/index.html +++ b/master/reference/pivots/index.html @@ -944,15 +944,6 @@