Skip to content

Commit

Permalink
Merge pull request #26 from KxSystems/2-4-update
Browse files Browse the repository at this point in the history
2.4 release update
  • Loading branch information
cmccarthy1 authored Mar 20, 2024
2 parents d448911 + 64dbdcd commit bf21a0b
Show file tree
Hide file tree
Showing 119 changed files with 3,516 additions and 9,850 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,9 @@ KX only officially supports versions of PyKX built by KX, i.e. versions of PyKX
PyKX depends on the following third-party Python packages:

- `pandas>=1.2, < 2.2.0`
- `numpy~=1.22; python_version<'3.11'`
- `numpy~=1.23.2; python_version=='3.11'`
- `numpy~=1.22, <2.0; python_version<'3.11'`
- `numpy~=1.23, <2.0; python_version=='3.11'`
- `numpy~=1.26, <2.0; python_version=='3.12'`
- `pytz>=2022.1`
- `toml~=0.10.2`

Expand Down Expand Up @@ -142,6 +143,13 @@ Windows:
* [dlfcn-win32](https://github.com/dlfcn-win32/dlfcn-win32). Can be installed using [Vcpkg](https://github.com/microsoft/vcpkg).
* `msvcr100.dll`. Available in [Microsoft Visual C++ 2010 Redistributable](https://www.microsoft.com/en-ca/download/details.aspx?id=26999).

To install the above dependencies, you can run the `w64_install.ps1` script as an administrator:

```PowerShell
cd pykx
.\w64_install.ps1
```

### Building

Using a Python virtual environment is recommended:
Expand Down
1 change: 1 addition & 0 deletions conda-recipe/conda_build_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ python:
- 3.9
- 3.10
- 3.11
- 3.12
13 changes: 8 additions & 5 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,20 @@ requirements:
build:
- git
- python
- setuptools==60.9.3
- setuptools_scm[toml]>=6.0.1
- setuptools>=68.0
- setuptools_scm[toml]>=7.1.0 # [py==37]
- setuptools_scm[toml]>=8.0.0 # [py!=37]
- cython==3.0.0
- numpy==1.22.*
- numpy==1.26 # [py==312]
- numpy==1.22.* # [py!=37 and py<312]
- numpy==1.20 # [py==37]
- tomli>=2.0.1
- wheel>=0.36.2
- wheel>=0.36
- sysroot_linux-64 # [linux64]

run:
- python
- numpy>=1.22
- numpy>=1.22,<2.0
- pandas>=1.2, <2.2.0
- pytz>=2022.1
- toml>=0.10.2
Expand Down
12 changes: 12 additions & 0 deletions docs/api/compress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Compression and Encryption APIs

::: pykx.compress_encrypt
rendering:
show_root_heading: false
options:
show_root_heading: false
members_order: source
members:
- CompressionAlgorithm
- Compress
- Encrypt
3 changes: 0 additions & 3 deletions docs/api/console.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs/api/ctx.md

This file was deleted.

5 changes: 0 additions & 5 deletions docs/api/embedded_q.md

This file was deleted.

7 changes: 4 additions & 3 deletions docs/api/pykx-execution/q.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,9 @@ pykx.List(q('
Write global tables to disk as splayed, enumerated, indexed q tables.

```python
>>> pykx.q('t: ([] x: 1 2 3; y: 10 20 30)')
>>> pykx.q.dsave(':v', 't')
>>> from pathlib import Path
>>> pykx.q['t'] = kx.Table(data={'x': [1, 2, 3], 'y': [10, 20, 30]})
>>> pykx.q.dsave(Path('v'), 't')
pykx.SymbolAtom(q('`t'))
```

Expand All @@ -178,7 +179,7 @@ pykx.SymbolAtom(q('`t'))
Read or memory-map a variable or q data file.

```python
>>> pykx.q('a: 10')
>>> pykx.q['a'] = 10
>>> pykx.q.get('a')
pykx.LongAtom(q('10'))
```
Expand Down
22 changes: 15 additions & 7 deletions docs/api/pykx-q-data/type_conversions.md
Original file line number Diff line number Diff line change
Expand Up @@ -771,11 +771,11 @@ True
Converting these types to python will return a float object or a `float64` object in numpy's case.

```Python
>>> kx.q('0001.02.03T04:05:06.007, 0001.02.03T04:05:06.007').py(raw=True)
>>> kx.q('0001.02.03T04:05:06.007 0001.02.03T04:05:06.007').py(raw=True)
[-730085.8297915857, -730085.8297915857]
>>> kx.q('0001.02.03T04:05:06.007, 0001.02.03T04:05:06.007').np(raw=True)
>>> kx.q('0001.02.03T04:05:06.007 0001.02.03T04:05:06.007').np(raw=True)
array([-730085.82979159, -730085.82979159])
>>> kx.q('0001.02.03T04:05:06.007, 0001.02.03T04:05:06.007').np(raw=True).dtype
>>> kx.q('0001.02.03T04:05:06.007 0001.02.03T04:05:06.007').np(raw=True).dtype
dtype('float64')
```

Expand Down Expand Up @@ -1081,15 +1081,19 @@ True
Calling `.py()` on a `pykx.Table` will return a python `dict` object.

```Python
>>> kx.q('([] a: 10?10; b: 10?10)').py()
>>> kx.Table(data={
... 'a': kx.random.random(10, 10),
... 'b': kx.random.random(10, 10)}).py()
{'a': [5, 6, 4, 1, 3, 3, 7, 8, 2, 1], 'b': [8, 1, 7, 2, 4, 5, 4, 2, 7, 8]}
```

=== "Numpy"
Calling `.np()` on a `pykx.Table` will return a numpy `record` array of the rows of the table with each type converted to it closest analogous numpy type.

```Python
>>> kx.q('([] a: 10?10; b: 10?10)').np()
>>> kx.Table(data={
... 'a': kx.random.random(10, 10),
... 'b': kx.random.random(10, 10)}).np()
rec.array([(9, 9), (9, 7), (2, 6), (5, 6), (4, 4), (2, 7), (5, 8), (8, 4),
(7, 4), (9, 6)],
dtype=[('a', '<i8'), ('b', '<i8')])
Expand All @@ -1099,7 +1103,9 @@ True
Calling `.pd()` on a `pykx.Table` will return a pandas `DataFrame` with each column being converted to its closest pandas `dtype`.

```Python
>>> kx.q('([] a: 10?10; b: 10?10)').pd()
>>> kx.Table(data={
... 'a': kx.random.random(10, 10),
... 'b': kx.random.random(10, 10)}).pd()
a b
0 1 9
1 0 7
Expand Down Expand Up @@ -1137,7 +1143,9 @@ True
Calling `.pa()` on a `pykx.Table` will return a pyarrow `Table`.

```Python
>>> kx.q('([] a: 10?10; b: 10?10)').pa()
>>> kx.Table(data={
... 'a': kx.random.random(10, 10),
... 'b': kx.random.random(10, 10)}).pa()
pyarrow.Table
a: int64
b: int64
Expand Down
Loading

0 comments on commit bf21a0b

Please sign in to comment.