Example #1
0
            from datatable.nff import save_nff
            return save_nff(self, path, _strategy=_strategy)
        else:
            raise ValueError("Unknown `format` value: %s" % format)


#-------------------------------------------------------------------------------
# Global settings
#-------------------------------------------------------------------------------

core._register_function(7, Frame)
core._install_buffer_hooks(Frame)

options.register_option(
    "core_logger",
    xtype=callable,
    default=None,
    doc="If you set this option to a Logger object, then every call to any "
    "core function will be recorded via this object.")

options.register_option(
    "sort.insert_method_threshold",
    xtype=int,
    default=64,
    doc="Largest n at which sorting will be performed using insert sort "
    "method. This setting also governs the recursive parts of the "
    "radix sort algorithm, when we need to sort smaller sub-parts of "
    "the input.")

options.register_option("sort.thread_multiplier", xtype=int, default=2)

options.register_option("sort.max_chunk_length", xtype=int, default=1024)
Example #2
0
class _DefaultLogger:
    def debug(self, message):
        if message[0] != "[":
            message = "  " + message
        print(term.color("bright_black", message), flush=True)

    def warning(self, message):
        warnings.warn(message, category=FreadWarning)


# os.PathLike interface was added in Python 3.6
_pathlike = (str, bytes, os.PathLike) if hasattr(os, "PathLike") else \
            (str, bytes)

options.register_option(
    "fread.anonymize", xtype=bool, default=False)

core._register_function(8, fread)



#-------------------------------------------------------------------------------

# Corresponds to RT enum in "reader_parsers.h"
class rtype(enum.Enum):
    rdrop    = 0
    rauto    = 1
    rbool    = 2
    rint     = 3
    rint32   = 4
    rint64   = 5
Example #3
0

class _Divider:
    def __init__(self):
        self.width = 3
        self.margin = ""
        self.header = term.color("bright_black", " | ")
        self.divider = term.color("bright_black", "-+ ")

    def value(self, row):
        return self.header



def _float_tail(x):
    idot = x.rfind(".")
    if idot >= 0:
        return len(x) - idot - 1
    else:
        return -1


options.register_option(
    "display.interactive_hint", xtype=bool, default=True,
    doc="Display navigation hint at the bottom of a Frame when viewing "
        "its contents in the console.")

options.register_option(
    "display.interactive", xtype=bool, default=False,
    doc="Show datatable Frame interactively in a Python console.")
Example #4
0
    print("Refcnt: %d" % col.refcount)
    widget = DataFrameWidget((datasize + 15) // 16, 17, data_viewer)
    widget.render()


core.register_function(1, column_hexview)
core.register_function(4, TTypeError)
core.register_function(5, TValueError)
core.register_function(6, DatatableWarning)
core.install_buffer_hooks(Frame())

options.register_option(
    "nthreads",
    xtype=int,
    default=0,
    core=True,
    doc="The number of OMP threads to be used by datatable. The value of 0 "
    "(default) allows datatable to use the maximum number of threads. "
    "Values less than zero allow to use that fewer threads than the "
    "maximum. Finally, nthreads=1 indicates single-threaded mode.")

options.register_option(
    "core_logger",
    xtype=object,
    default=None,
    core=True,
    doc="If you set this option to a Logger object, then every call to any "
    "core function will be recorded via this object.")

options.register_option(
    "sort.insert_method_threshold",
Example #5
0
            v if v == "nan" else v + " " * (maxtail - tails[j])
            for j, v in enumerate(self._strdata)
        ]

    def _format(self, value):
        diff = self._width - term.length(value)
        if diff >= 0:
            whitespace = " " * diff
            if self._alignleft:
                return value + whitespace
            else:
                return whitespace + value
        else:
            return value[:self._width - 1] + "…"


def _float_tail(x):
    idot = x.rfind(".")
    if idot >= 0:
        return len(x) - idot - 1
    else:
        return -1


options.register_option(
    "display.interactive_hint",
    xtype=bool,
    default=True,
    doc="Display navigation hint at the bottom of a Frame when viewing "
    "its contents in the console.")
Example #6
0
    print("Meta: %s" % col.meta)
    print("Refcnt: %d" % col.refcount)
    widget = DataFrameWidget((datasize + 15) // 16, 17, data_viewer)
    widget.render()


core.register_function(1, column_hexview)
core.register_function(4, TTypeError)
core.register_function(5, TValueError)
core.install_buffer_hooks(Frame())

options.register_option(
    "nthreads",
    xtype=int,
    default=0,
    core=True,
    doc="The number of OMP threads to be used by datatable. The value of 0 "
    "(default) allows datatable to use the maximum number of threads. "
    "Values less than zero allow to use that fewer threads than the "
    "maximum. Finally, nthreads=1 indicates single-threaded mode.")

options.register_option(
    "core_logger",
    xtype=object,
    default=None,
    core=True,
    doc="If you set this option to a Logger object, then every call to any "
    "core function will be recorded via this object.")

options.register_option(
    "sort.insert_method_threshold",