klongpy 0.7.0__py3-none-any.whl → 0.7.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- klongpy/__init__.py +0 -2
- klongpy/adverbs.py +84 -82
- klongpy/autograd.py +0 -9
- klongpy/backend.py +9 -142
- klongpy/backends/__init__.py +9 -77
- klongpy/backends/base.py +154 -5
- klongpy/backends/numpy_backend.py +2 -1
- klongpy/backends/registry.py +76 -0
- klongpy/backends/torch_backend.py +83 -31
- klongpy/cli.py +50 -7
- klongpy/core.py +113 -1094
- klongpy/db/sys_fn_db.py +3 -3
- klongpy/db/sys_fn_kvs.py +2 -4
- klongpy/dyads.py +203 -162
- klongpy/interpreter.py +32 -15
- klongpy/monads.py +99 -89
- klongpy/parser.py +328 -0
- klongpy/repl.py +2 -2
- klongpy/sys_fn.py +53 -15
- klongpy/sys_fn_ipc.py +4 -9
- klongpy/types.py +503 -0
- klongpy/writer.py +122 -0
- klongpy/ws/sys_fn_ws.py +5 -8
- {klongpy-0.7.0.dist-info → klongpy-0.7.1.dist-info}/METADATA +146 -95
- klongpy-0.7.1.dist-info/RECORD +52 -0
- klongpy-0.7.0.dist-info/RECORD +0 -48
- {klongpy-0.7.0.dist-info → klongpy-0.7.1.dist-info}/WHEEL +0 -0
- {klongpy-0.7.0.dist-info → klongpy-0.7.1.dist-info}/entry_points.txt +0 -0
- {klongpy-0.7.0.dist-info → klongpy-0.7.1.dist-info}/licenses/LICENSE +0 -0
- {klongpy-0.7.0.dist-info → klongpy-0.7.1.dist-info}/top_level.txt +0 -0
klongpy/db/sys_fn_db.py
CHANGED
|
@@ -4,8 +4,8 @@ import duckdb
|
|
|
4
4
|
import numpy as np
|
|
5
5
|
import pandas as pd
|
|
6
6
|
|
|
7
|
-
from klongpy.core import (KGCall, KGLambda, KlongException,
|
|
8
|
-
reserved_fn_symbol_map)
|
|
7
|
+
from klongpy.core import (KGCall, KGLambda, KlongException, KLONG_UNDEFINED,
|
|
8
|
+
reserved_fn_args, reserved_fn_symbol_map)
|
|
9
9
|
from klongpy.backend import np as backend_np
|
|
10
10
|
|
|
11
11
|
|
|
@@ -42,7 +42,7 @@ class Table(dict):
|
|
|
42
42
|
|
|
43
43
|
def get(self, x):
|
|
44
44
|
v = self._df.get(x)
|
|
45
|
-
return
|
|
45
|
+
return KLONG_UNDEFINED if v is None else v.values
|
|
46
46
|
|
|
47
47
|
def set(self, x, y):
|
|
48
48
|
self._df[x] = y
|
klongpy/db/sys_fn_kvs.py
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import sys
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
from klongpy.core import KlongException
|
|
3
|
+
from klongpy.core import KlongException, KLONG_UNDEFINED
|
|
6
4
|
|
|
7
5
|
from .df_cache import PandasDataFrameCache
|
|
8
6
|
from .file_cache import FileCache
|
|
@@ -33,7 +31,7 @@ class TableStorage(dict):
|
|
|
33
31
|
if not isinstance(x,str):
|
|
34
32
|
raise KlongKvsException(x, "key must be a str")
|
|
35
33
|
df = self.cache.get_dataframe(key_to_file_path(x), default_empty=False)
|
|
36
|
-
return
|
|
34
|
+
return KLONG_UNDEFINED if df is None else Table(df)
|
|
37
35
|
|
|
38
36
|
def set(self, x, y):
|
|
39
37
|
if not isinstance(x,str):
|