Skip to content

Commit 57a42b4

Browse files
authored
Merge pull request #31 from KxSystems/pykx-2.5.1
PyKX 2.5.1
2 parents 80cee70 + 1c63196 commit 57a42b4

File tree

23 files changed

+390
-112
lines changed

23 files changed

+390
-112
lines changed

docs/contributors.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ The aim of this page is to include a list of the contributors to our project bot
2121
- [neutropolis](https://github.com/neutropolis)
2222
- [nipsn](https://github.com/nipsn)
2323
- [marcosvm13](https://github.com/marcosvm13)
24+
- [tortolavivo23](https://github.com/tortolavivo23)

docs/getting-started/installing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ _This section explains how to install PyKX on your machine._
1414
Before you start, make sure you have:
1515

1616
- **Python** (versions 3.8-3.12)
17-
- **Pip**
17+
- **pip**
1818

1919
Recommended: a virtual environment with packages such as [venv](https://docs.python.org/3/library/venv.html) from the standard library.
2020

docs/getting-started/quickstart.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,17 @@ To complete the quickstart guide below you will need to have completed the follo
1313
To access PyKX and it's functionality import it within your Python code using the following syntax
1414

1515
```python
16-
import pykx as kx
16+
>>> import pykx as kx
1717
```
1818

1919
The use of the shortened name `kx` is intended to provide a terse convention for interacting with methods and objects from this library.
2020

2121
## How to generate PyKX objects
2222

23-
The generation of PyKX objects is supported pricipally in two ways
23+
The generation of PyKX objects is supported principally in two ways
2424

2525
1. Execution of q code to create these entities
26-
2. Conversion of Python objects to analagous PyKX objects
27-
26+
2. Conversion of Python objects to analogous PyKX objects
2827

2928
### Creation of PyKX objects using inbuilt PyKX functions
3029

@@ -52,19 +51,21 @@ x x1
5251

5352
### Creation of PyKX objects from Python data types
5453

55-
Generation of PyKX objects from Python, Numpy, Pandas and PyArrow objects can be completed as follows using the `kx.toq` method.
54+
Generation of PyKX objects from Python, NumPy, Pandas and PyArrow objects can be completed as follows using the `kx.toq` method.
5655

5756
```python
5857
>>> pylist = [10, 20, 30]
5958
>>> qlist = kx.toq(pylist)
6059
>>> qlist
6160
pykx.LongVector(pykx.q('10 20 30'))
6261

62+
>>> import numpy as np
6363
>>> nplist = np.arange(0, 10, 2)
6464
>>> qlist = kx.toq(nplist)
6565
>>> qlist
6666
pykx.LongVector(pykx.q('0 2 4 6 8'))
6767

68+
>>> import pandas as pd
6869
>>> df = pd.DataFrame({'col1': [1, 2], 'col2': [3, 4]})
6970
>>> df
7071
col1 col2
@@ -78,6 +79,7 @@ col1 col2
7879
2 4
7980
'))
8081

82+
>>> import pyarrow as pa
8183
>>> patab = pa.Table.from_pandas(df)
8284
>>> patab
8385
pyarrow.Table
@@ -115,8 +117,7 @@ x x1 x2
115117

116118
## Interacting with PyKX Objects
117119

118-
PyKX objects can be interacted with in a variety of ways, through indexing using Pythonic syntax, passing PyKX objects to q/numpy functions, querying via SQL/qSQL syntax or through the use of q functionality via the context interface. Each of these is described in more depth throughout this documentation but examples of each are provided here
119-
120+
PyKX objects can be interacted with in a variety of ways, through indexing using Pythonic syntax, passing PyKX objects to q/NumPy functions, querying via SQL/qSQL syntax or through the use of q functionality via the context interface. Each of these is described in more depth throughout this documentation but examples of each are provided here.
120121

121122
* Create a PyKX list and interact with the list using indexing and slices.
122123

@@ -192,7 +193,7 @@ PyKX objects can be interacted with in a variety of ways, through indexing using
192193
0.2062569 3.852387 a
193194
0.481821 0.07970141 a
194195
'))
195-
```
196+
```
196197

197198
* Pass a PyKX object to q function
198199

@@ -211,8 +212,6 @@ PyKX objects can be interacted with in a variety of ways, through indexing using
211212
>>> qvec.apply(lambda x:x+1)
212213
pykx.LongVector(pykx.q('5 8 3 3 10 5 3 1 9 1'))
213214
```
214-
215-
216215

217216
* Pass a PyKX array objects to a Numpy functions
218217

docs/getting-started/what_is_pykx.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
## Introduction
44

5-
PyKX is a Python first interface to the worlds fastest time-series database kdb+ and it's underlying vector programming language q. PyKX takes a Python first approach to integrating q/kdb+ with Python following 10+ years of integrations between these two languages. Fundamentally it provides users with the ability to efficiently query and analyze huge amounts of in-memory and on-disk time-series data.
5+
PyKX is a Python first interface to the world's fastest time-series database kdb+ and its underlying vector programming language, q. PyKX takes a Python first approach to integrating q/kdb+ with Python following 10+ years of integrations between these two languages. Fundamentally it provides users with the ability to efficiently query and analyze huge amounts of in-memory and on-disk time-series data.
66

7-
This interface exposes q as a domain-specific language (DSL) embedded within Python, taking the approach that q should principally be used for data processing and management of databases. This approach does not diminish the ability for users familiar with q or those wishing to learn more about it from making the most of advanced analytics and database management functionality rather empowers those who want to make use of the power of kdb+/q who lack this expertise to get up and running fast.
7+
This interface exposes q as a domain-specific language (DSL) embedded within Python, taking the approach that q should principally be used for data processing and management of databases. This approach does not diminish the ability for users familiar with q, or those wishing to learn more about it, from making the most of its advanced analytics and database management functionality. Rather it empowers those who want to make use of the power of kdb+/q who lack this expertise to get up and running quickly.
88

99
PyKX supports three principal use cases:
1010

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## About
44

5-
PyKX is a Python-first interface for the q language and its time-series vector database kdb+.
5+
PyKX is a Python first interface to the world's fastest time-series database kdb+ and its underlying vector programming language, q.
66

77
For Python developers, PyKX unlocks the speed and power of kdb+ for data processing and storage from within your Python environment. It enables anyone with Python knowledge to apply analytics against vast amounts of data, both in-memory and on-disk, in a fraction of the time, allowing you to focus on getting the best from your data.
88

docs/release-notes/changelog.md

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,116 @@
88

99
Currently PyKX is not compatible with Pandas 2.2.0 or above as it introduced breaking changes which cause data to be cast to the incorrect type.
1010

11+
## PyKX 2.5.1
12+
13+
#### Release Date
14+
15+
2024-06-11
16+
17+
### Additions
18+
19+
- [Pandas API](../user-guide/advanced/Pandas_API.ipynb) additions: `isnull`, `isna`, `notnull`, `notna`, `idxmax`, `idxmin`, `kurt`, `sem`.
20+
- Addition of `filter_type`, `filter_columns`, and `custom` parameters to `QReader.csv()` to add options for CSV type guessing.
21+
22+
```python
23+
>>> import pykx as kx
24+
>>> reader = kx.QReader(kx.q)
25+
>>> reader.csv("myFile0.csv", filter_type = "like", filter_columns="*name", custom={"SYMMAXGR":15})
26+
pykx.Table(pykx.q('
27+
firstname lastname
28+
----------------------
29+
"Frieda" "Bollay"
30+
"Katuscha" "Paton"
31+
"Devina" "Reinke"
32+
"Maurene" "Bow"
33+
"Iseabal" "Bashemeth"
34+
..
35+
'))
36+
```
37+
38+
### Fixes and Improvements
39+
40+
- Fix to regression in PyKX 2.5.0 where PyKX initialisation on Windows would result in a segmentation fault when using an `k4.lic` license type.
41+
- Previously user could not make direct use of `kx.SymbolicFunction` type objects against a remote process, this has been rectified
42+
43+
=== "Behaviour prior to change"
44+
45+
```python
46+
>>> import pykx as kx
47+
>>> kx.q('.my.func:{x+1}')
48+
pykx.Identity(pykx.q('::'))
49+
>>> kx.q.my.func
50+
pykx.SymbolicFunction(pykx.q('`.my.func'))
51+
>>> conn = kx.q.SyncQConnection(port=5050)
52+
>>> conn(kx.q.my.func, 1)
53+
... Error Message ...
54+
pykx.exceptions.QError: .my.func
55+
```
56+
57+
=== "Behaviour post change"
58+
59+
```python
60+
>>> import pykx as kx
61+
>>> kx.q('.my.func:{x+1}')
62+
pykx.Identity(pykx.q('::'))
63+
>>> kx.q.my.func
64+
pykx.SymbolicFunction(pykx.q('`.my.func'))
65+
>>> conn = kx.q.SyncQConnection(port=5050)
66+
>>> conn(kx.q.my.func, 1)
67+
pykx.LongAtom(pykx.q('2'))
68+
```
69+
70+
- Previously use of the context interface for q primitive functions in licensed mode via IPC would partially run the function on the client rather than server, thus limiting usage for named entities on the server.
71+
72+
=== "Behaviour prior to change"
73+
74+
```python
75+
>>> import pykx as kx
76+
>>> conn = kx.SyncQConnection(port=5050)
77+
>>> conn.q('tab:([]10?1f;10?1f)')
78+
>>> conn.q.meta('tab')
79+
... Error Message ...
80+
pykx.exceptions.QError: tab
81+
```
82+
83+
=== "Behaviour post change"
84+
85+
```python
86+
>>> import pykx as kx
87+
>>> conn = kx.SyncQConnection(port=5050)
88+
>>> conn.q('tab:([]10?1f;10?1f)')
89+
>>> conn.q.meta('tab')
90+
pykx.KeyedTable(pykx.q('
91+
c | t f a
92+
--| -----
93+
x | f
94+
x1| f
95+
'))
96+
```
97+
98+
- With the release of PyKX 2.5.0 and support of PyKX usage in paths containing spaces the context interface functionality could fail to load a requested context over IPC if PyKX was not loaded on the server.
99+
100+
=== "Behaviour prior to change"
101+
102+
```python
103+
>>> import pykx as kx
104+
>>> conn = kx.SyncQConnection(port=5050)
105+
>>> conn.my_ctx
106+
... Error Message ...
107+
```
108+
109+
=== "Behaviour post change"
110+
111+
```python
112+
>>> import pykx as kx
113+
>>> conn = kx.SyncQConnection(port=5050)
114+
>>> conn.my_ctx
115+
<pykx.ctx.QContext of .csvutil with [my_function]>
116+
```
117+
118+
- Updated CSV analysis logic to be based on `csvutil.q` 2020.06.20.
119+
- Fix for config value `PYKX_4_1_ENABLED` to only use 4.1 if set to `True`, `true`, or `1`. Previously any non empty value enabled 4.1.
120+
11121
## PyKX 2.5.0
12122

13123
#### Release Date

docs/release-notes/underq-changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This changelog provides updates from PyKX 2.0.0 and above, for information relat
1010

1111
#### Release Date
1212

13-
TBD
13+
2024-05-15
1414

1515
### Fixes and Improvements
1616

docs/roadmap.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ If you need a feature that's not included in this list please let us know by rai
2121
>>> table.select(kx.col('x1').wavg('x2'))
2222
```
2323

24-
- Addition of support for q primatives as methods off PyKX Vector and Table objects. Syntax for this will be similar to the following
24+
- Addition of support for q primitives as methods off PyKX Vector and Table objects. Syntax for this will be similar to the following:
2525

2626
```python
2727
>>> import pykx as kx
@@ -31,13 +31,7 @@ If you need a feature that's not included in this list please let us know by rai
3131
>>> vec.abs()
3232
```
3333

34-
- Performance improvements for conversions from Numpy arrays to PyKX Vector objects and vice-versa through enhanced use of C++ over Cython.
35-
- Additions to the Pandas Like API for PyKX.
36-
- `isnull`
37-
- `idxmax`
38-
- `kurt`
39-
- `sem`
40-
34+
- Performance improvements for conversions from NumPy arrays to PyKX Vector objects and vice-versa through enhanced use of C++ over Cython.
4135
- Addition of functionality for the development of streaming workflows using PyKX.
4236
- Configurable initialisation logic in the absence of a license. Thus allowing users who have their own workflows for license access to modify the instructions for their users.
4337
- Promotion of Beta functionality currently available in PyKX to full production support

0 commit comments

Comments
 (0)