KxSystems / pyq

PyQ — Python for kdb+
http://code.kx.com/q/interfaces
Apache License 2.0
191 stars 49 forks source link

Document support for jupyterlab #105

Closed davidkell closed 5 years ago

davidkell commented 5 years ago

The current release of PyQ allows you to launch pyq within a jupyter notebook:

pyq -m notebook

Took us time to work it out, but it turns out that the equivalent command for the Jupyter Lab is not:

pyq -m lab

but instead

pyq -m jupyterlab

Probably worth putting that in the docs ? (Unless we missed it somewhere.)

abalkin commented 5 years ago

We don't recommend running jupyterlab in pyq. You should install pyq-kernel and use it with a regular jupyter notebook server instance,

See https://pypi.org/project/pyq-kernel

davidkell commented 5 years ago

Thanks for the heads up. We'll do that then.

Any thoughts on passing through CLI arguments to the q process? (For our specific use case we want to set the slaves -s for multi-threading.)

Modifying the pyq_3 kernel.json (jupyter kernelspec list) appears to work, e.g.:

{
    "argv": [
        "<path>/<to>/q",
        "/<path>/<to>/pyq-kernel.p",
        "1024",
        "65535",
        "{connection_file}",
        "-s",
        "2"
    ],
    "display_name": "PyQ 3",
    "env": {
        "QHOME": "<path>/<to>/q"
    },
    "language": "python"
}

But maybe there is something less hacky.

Also, is there some general guidance on when to prefer pyq vs pyq-kernel?

abalkin commented 5 years ago

Modifying the pyq_3 kernel.json is fine.

Since version 4.2, you can pass q arguments when invoking pyq after --, but beware of #104 - we will make some changes to that feature.

I am going to close this issue because suggestions for documentation improvements should be made at https://github.com/KxSystems/docs and usage questions should be directed to more appropriate fora.