diff --git a/doc/_kx/code.kx.dump b/doc/_kx/code.kx.dump new file mode 100644 index 0000000..2a132d3 Binary files /dev/null and b/doc/_kx/code.kx.dump differ diff --git a/doc/_kx/mkref.py b/doc/_kx/mkref.py index 357b3da..1cb1619 100644 --- a/doc/_kx/mkref.py +++ b/doc/_kx/mkref.py @@ -10,7 +10,7 @@ {short}{doc} - See also `{qname} on code.kx.com `_. + See also `{qname} on code.kx.com <{url}>`_. """ @@ -22,7 +22,7 @@ {short} For details, see :func:`q.{name} ` and `{qname} on code.kx.com - `_. + <{url}>`_. """ @@ -42,7 +42,7 @@ ref_dir = script_dir / '..' / 'reference' q_func_rst = ref_dir / 'q-funcs.rst' k_meth_rst = ref_dir / 'K-meths.rst' -code_dump = script_dir / 'code.dump' +code_dump = script_dir / 'code.kx.dump' kx_docs = code_dump.load() # Fix links @@ -54,8 +54,8 @@ qname = fixes.get(name, qname) desc = kx_docs.get(qname) if isinstance(desc, tuple): - short = desc[1] + _, short, url = desc else: short = 'The %s function.' % qname - f.write(Q_FUNC_DOC.format(name=name, short=short, qname=qname, doc=DOC[name])) - g.write(K_METH_DOC.format(name=name, short=short, qname=qname)) + f.write(Q_FUNC_DOC.format(name=name, short=short, qname=qname, url=url, doc=DOC[name])) + g.write(K_METH_DOC.format(name=name, short=short, qname=qname, url=url)) diff --git a/doc/_kx/code.py b/doc/_kx/parse.py similarity index 61% rename from doc/_kx/code.py rename to doc/_kx/parse.py index fb438f4..b0ffbcb 100644 --- a/doc/_kx/code.py +++ b/doc/_kx/parse.py @@ -1,12 +1,12 @@ # Grab function and description from code.kx.com which still uses mediawiki # Requires Python 3.6+ -from time import sleep from pickle import dump +from urllib.parse import urljoin import py import requests - +from bs4 import BeautifulSoup as bs KWDS = ['abs', 'acos', 'aj', 'aj0', 'all', 'and', 'any', 'asc', 'asin', 'asof', 'atan', 'attr', 'avg', 'avgs', 'bin', 'binr', 'ceiling', 'cols', 'cor', 'cos', @@ -27,35 +27,34 @@ 'update', 'upper', 'upsert', 'value', 'var', 'view', 'views', 'vs', 'wavg', 'where', 'while', 'within', 'wj', 'wj1', 'wsum', 'ww', 'xasc', 'xbar', 'xcol', 'xcols', 'xdesc', 'xexp', 'xgroup', 'xkey', 'xlog', 'xprev', 'xrank'] -URL_PATTERN = "http://code.kx.com/wiki/Reference/{}?action=raw" + HEADERS = { # Let's brake their statistics :) - 'User-Agent': 'Mozilla/4.0 (compatible; MSIE 4.0; Windows NT)' + 'User-Agent': 'Mozilla/2.0 (compatible; MSIE 3.0; Windows 3.1)' } -OUT = {} - -for kwd in KWDS: - url = URL_PATTERN.format(kwd) - r = requests.get(url, headers=HEADERS) - if r.status_code == requests.codes.ok: - line = r.text.splitlines()[0] - try: - _, func, desc = line.replace('}', '').split('|') - except ValueError as e: - print(f"{kwd}: Error {e} - {line}") - OUT[kwd] = line - else: - OUT[kwd] = (func, desc) - print(f"{kwd}: {func}|{desc}") - else: - print(f"{kwd}: Error {r.status_code} downloading from {url}.") - OUT[kwd] = r.status_code - - sleep(0.5) # Let's not DDoS them - -filename = py.path.local(__file__).new(ext='dump') -with filename.open('wb') as f: - dump(OUT, f) - -print(f"Saved into {filename}.") +CARD = 'http://code.kx.com/q/ref/card/' + +out = {} +r = requests.get(CARD, headers=HEADERS) +if r.status_code == requests.codes.ok: + soup = bs(r.text, 'html.parser') + for div in soup.find_all('div', {'class': 'md-content'}): + for link in div.find_all('a'): + key = link.text.strip().split()[0] + if 'class' not in link.attrs: + if key in KWDS: + href = urljoin(CARD, link.attrs['href']) + title = link.attrs['title'].strip() if 'title' in link.attrs else key + # strip unicode characters + title = title.encode('ascii', 'ignore').decode().strip() + out[key] = (key, title, href) + print("Missing:", ', '.join(k for k in KWDS if k not in out)) + filename = py.path.local('code.kx.dump') + with filename.open('wb') as f: + dump(out, f) + + print(f"Saved into {filename}.") + +else: + print(f"ERROR {r.status_code} downloading page from {CARD}.") diff --git a/doc/conf.py b/doc/conf.py index 4d63bbb..ac496c2 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -18,7 +18,7 @@ try: from pyq import __version__ except ImportError: - __version__ = '4.0.1' + __version__ = '4.0.2' # If extensions (or modules to document with autodoc) are in another directory, diff --git a/doc/install/install.rst b/doc/install/install.rst index 8bc07fc..35edfcb 100644 --- a/doc/install/install.rst +++ b/doc/install/install.rst @@ -120,3 +120,5 @@ Install PyQ: .. include:: update.rst .. include:: centos32on64.rst + +.. include:: ubuntu.rst diff --git a/doc/install/ubuntu.rst b/doc/install/ubuntu.rst new file mode 100644 index 0000000..6c76c20 --- /dev/null +++ b/doc/install/ubuntu.rst @@ -0,0 +1,54 @@ +Installing PyQ on Ubuntu 16.04 +------------------------------ + +Since Python provided by Ubuntu is statically linked, shared libraries need to be installed before PyQ can be installed. + +Python 2 +........ + +Install shared libraries: + +.. code-block:: bash + + $ sudo apt-get install libpython-dev libpython-stdlib python-pip python-virtualenv + + +Create and activate virtual environment: + +.. code-block:: bash + + $ python -m virtualenv -p $(which python2) py2 + $ source py2/bin/activate + + +Install PyQ: + +.. code-block:: bash + + (py2) $ pip install -i https://pyq.enlnt.com --no-binary pyq pyq + + +Python 3 +........ + +Install shared libraries: + +.. code-block:: bash + + $ sudo apt-get install libpython3-dev libpython3-stdlib python3-pip python3-virtualenv + + +Create and activate virtual environment: + +.. code-block:: bash + + $ python3 -m virtualenv -p $(which python3) py3 + $ source py3/bin/activate + + +Install PyQ: + +.. code-block:: bash + + (py3) $ pip3 install -i https://pyq.enlnt.com --no-binary pyq pyq + diff --git a/doc/reference/K-meths.rst b/doc/reference/K-meths.rst index db10e6e..c0a8064 100644 --- a/doc/reference/K-meths.rst +++ b/doc/reference/K-meths.rst @@ -1,321 +1,313 @@ .. py:method:: K.abs - absolute value function + absolute value For details, see :func:`q.abs ` and `abs on code.kx.com - `_. + `_. .. py:method:: K.acos - arc cosine function + arc cosine For details, see :func:`q.acos ` and `acos on code.kx.com - `_. + `_. .. py:method:: K.aj - asof join function + as-of join For details, see :func:`q.aj ` and `aj on code.kx.com - `_. + `_. .. py:method:: K.aj0 - asof join function + as-of join For details, see :func:`q.aj0 ` and `aj on code.kx.com - `_. + `_. .. py:method:: K.all - all function + all nonzero For details, see :func:`q.all ` and `all on code.kx.com - `_. + `_. .. py:method:: K.and_ - and verb + and For details, see :func:`q.and_ ` and `and on code.kx.com - `_. + `_. .. py:method:: K.any - any function + any item is non-zero For details, see :func:`q.any ` and `any on code.kx.com - `_. + `_. .. py:method:: K.asc - ascending function + ascending sort For details, see :func:`q.asc ` and `asc on code.kx.com - `_. + `_. .. py:method:: K.asin - arc sine function + arc sine For details, see :func:`q.asin ` and `asin on code.kx.com - `_. + `_. .. py:method:: K.asof - asof verb + as-of operator For details, see :func:`q.asof ` and `asof on code.kx.com - `_. + `_. .. py:method:: K.atan - arc tangent function + arc tangent For details, see :func:`q.atan ` and `atan on code.kx.com - `_. + `_. .. py:method:: K.attr - attributes function + attributes For details, see :func:`q.attr ` and `attr on code.kx.com - `_. + `_. .. py:method:: K.avg - average function + arithmetic mean For details, see :func:`q.avg ` and `avg on code.kx.com - `_. + `_. .. py:method:: K.avgs - running averages function + running averages For details, see :func:`q.avgs ` and `avgs on code.kx.com - `_. + `_. .. py:method:: K.bin - binary search verb + binary search For details, see :func:`q.bin ` and `bin on code.kx.com - `_. + `_. .. py:method:: K.binr - binary search verb + binary search For details, see :func:`q.binr ` and `bin on code.kx.com - `_. + `_. .. py:method:: K.ceiling - ceiling function + lowest integer above For details, see :func:`q.ceiling ` and `ceiling on code.kx.com - `_. + `_. .. py:method:: K.cols - columns function + column names of a table For details, see :func:`q.cols ` and `cols on code.kx.com - `_. + `_. .. py:method:: K.cor - correlation verb + correlation For details, see :func:`q.cor ` and `cor on code.kx.com - `_. + `_. .. py:method:: K.cos - cosine function + cosine For details, see :func:`q.cos ` and `cos on code.kx.com - `_. + `_. .. py:method:: K.count - count function + number of items For details, see :func:`q.count ` and `count on code.kx.com - `_. + `_. .. py:method:: K.cov - covariance verb + statistical covariance For details, see :func:`q.cov ` and `cov on code.kx.com - `_. + `_. .. py:method:: K.cross - cross product verb + cross product For details, see :func:`q.cross ` and `cross on code.kx.com - `_. + `_. .. py:method:: K.csv - csv global + comma delimiter For details, see :func:`q.csv ` and `csv on code.kx.com - `_. + `_. .. py:method:: K.cut - cut verb + cut For details, see :func:`q.cut ` and `cut on code.kx.com - `_. + `_. .. py:method:: K.deltas - deltas function + differences between consecutive pairs For details, see :func:`q.deltas ` and `deltas on code.kx.com - `_. + `_. .. py:method:: K.desc - descending sort function + descending sort For details, see :func:`q.desc ` and `desc on code.kx.com - `_. + `_. .. py:method:: K.dev - standard deviation function + standard deviation For details, see :func:`q.dev ` and `dev on code.kx.com - `_. + `_. .. py:method:: K.differ - differ function + flag differences in consecutive pairs For details, see :func:`q.differ ` and `differ on code.kx.com - `_. + `_. .. py:method:: K.distinct - distinct function + unique items For details, see :func:`q.distinct ` and `distinct on code.kx.com - `_. + `_. .. py:method:: K.div - integer division verb + integer division For details, see :func:`q.div ` and `div on code.kx.com - `_. + `_. .. py:method:: K.dsave - dsave function + save global tables to disk For details, see :func:`q.dsave ` and `dsave on code.kx.com - `_. - - -.. py:method:: K.each - - each adverb - - For details, see :func:`q.each ` and `each on code.kx.com - `_. + `_. .. py:method:: K.ej - equijoin verb + equi-join For details, see :func:`q.ej ` and `ej on code.kx.com - `_. + `_. .. py:method:: K.ema - exponentially weighted moving average verb + exponentially-weighted moving average For details, see :func:`q.ema ` and `ema on code.kx.com - `_. + `_. .. py:method:: K.ema - exponentially weighted moving average verb + exponentially-weighted moving average For details, see :func:`q.ema ` and `ema on code.kx.com - `_. + `_. .. py:method:: K.enlist - enlist function + arguments as a list For details, see :func:`q.enlist ` and `enlist on code.kx.com - `_. + `_. .. py:method:: K.eval - eval function + evaluate a parse tree For details, see :func:`q.eval ` and `eval on code.kx.com - `_. + `_. .. py:method:: K.except_ - except verb + left argument without items in right argument For details, see :func:`q.except_ ` and `except on code.kx.com - `_. + `_. .. py:method:: K.exp - exp function + power of e For details, see :func:`q.exp ` and `exp on code.kx.com - `_. + `_. .. py:method:: K.fby @@ -323,143 +315,143 @@ filter-by For details, see :func:`q.fby ` and `fby on code.kx.com - `_. + `_. .. py:method:: K.fills - fills function + forward-fill nulls For details, see :func:`q.fills ` and `fills on code.kx.com - `_. + `_. .. py:method:: K.first - first function + first item For details, see :func:`q.first ` and `first on code.kx.com - `_. + `_. .. py:method:: K.fkeys - fkeys function + foreign-key columns mapped to their tables For details, see :func:`q.fkeys ` and `fkeys on code.kx.com - `_. + `_. .. py:method:: K.flip - flip function + transpose For details, see :func:`q.flip ` and `flip on code.kx.com - `_. + `_. .. py:method:: K.floor - floor function + greatest integer less than argument For details, see :func:`q.floor ` and `floor on code.kx.com - `_. + `_. .. py:method:: K.get - get function + get For details, see :func:`q.get ` and `get on code.kx.com - `_. + `_. .. py:method:: K.getenv - getenv function + value of an environment variable For details, see :func:`q.getenv ` and `getenv on code.kx.com - `_. + `_. .. py:method:: K.group - group function + dictionary of distinct items For details, see :func:`q.group ` and `group on code.kx.com - `_. + `_. .. py:method:: K.gtime - gtime function + UTC timestamp For details, see :func:`q.gtime ` and `gtime on code.kx.com - `_. + `_. .. py:method:: K.hclose - hclose function + close a file or process For details, see :func:`q.hclose ` and `hclose on code.kx.com - `_. + `_. .. py:method:: K.hcount - hcount function + size of a file For details, see :func:`q.hcount ` and `hcount on code.kx.com - `_. + `_. .. py:method:: K.hdel - hdel function + delete a file For details, see :func:`q.hdel ` and `hdel on code.kx.com - `_. + `_. .. py:method:: K.hopen - hopen function + open a file For details, see :func:`q.hopen ` and `hopen on code.kx.com - `_. + `_. .. py:method:: K.hsym - hsym function + convert symbol to filename or IP address For details, see :func:`q.hsym ` and `hsym on code.kx.com - `_. + `_. .. py:method:: K.iasc - ascending function + indices of ascending sort For details, see :func:`q.iasc ` and `iasc on code.kx.com - `_. + `_. .. py:method:: K.idesc - descending function + indices of descending sort For details, see :func:`q.idesc ` and `idesc on code.kx.com - `_. + `_. .. py:method:: K.ij - inner join verb + inner join For details, see :func:`q.ij ` and `ij on code.kx.com - `_. + `_. .. py:method:: K.ijf @@ -467,815 +459,799 @@ The ijf function. For details, see :func:`q.ijf ` and `ijf on code.kx.com - `_. + `_. .. py:method:: K.in_ - membership verb + membership For details, see :func:`q.in_ ` and `in on code.kx.com - `_. + `_. .. py:method:: K.insert - insert verb + append records to a table For details, see :func:`q.insert ` and `insert on code.kx.com - `_. + `_. .. py:method:: K.inter - intersect verb + items common to both arguments For details, see :func:`q.inter ` and `inter on code.kx.com - `_. + `_. .. py:method:: K.inv - inverse function + matrix inverse For details, see :func:`q.inv ` and `inv on code.kx.com - `_. + `_. .. py:method:: K.key - key function + key For details, see :func:`q.key ` and `key on code.kx.com - `_. + `_. .. py:method:: K.keys - keys function + names of a table's columns For details, see :func:`q.keys ` and `keys on code.kx.com - `_. + `_. .. py:method:: K.last - last function + last item For details, see :func:`q.last ` and `last on code.kx.com - `_. + `_. .. py:method:: K.like - pattern matching verb + pattern matching For details, see :func:`q.like ` and `like on code.kx.com - `_. + `_. .. py:method:: K.lj - left join verb + left join For details, see :func:`q.lj ` and `lj on code.kx.com - `_. + `_. .. py:method:: K.ljf - The ljf function. + left join For details, see :func:`q.ljf ` and `ljf on code.kx.com - `_. + `_. .. py:method:: K.load - load function + load binary data For details, see :func:`q.load ` and `load on code.kx.com - `_. + `_. .. py:method:: K.log - log function + natural logarithm For details, see :func:`q.log ` and `log on code.kx.com - `_. + `_. .. py:method:: K.lower - lowercase function + lower case For details, see :func:`q.lower ` and `lower on code.kx.com - `_. + `_. .. py:method:: K.lsq - least squares verb + least squares matrix divide For details, see :func:`q.lsq ` and `lsq on code.kx.com - `_. + `_. .. py:method:: K.ltime - ltime function + local timestamp For details, see :func:`q.ltime ` and `ltime on code.kx.com - `_. + `_. .. py:method:: K.ltrim - left trim function + function remove leading spaces For details, see :func:`q.ltrim ` and `ltrim on code.kx.com - `_. + `_. .. py:method:: K.mavg - moving average verb + moving average For details, see :func:`q.mavg ` and `mavg on code.kx.com - `_. + `_. .. py:method:: K.max - maximum function + maximum For details, see :func:`q.max ` and `max on code.kx.com - `_. + `_. .. py:method:: K.maxs - maximums function + maxima of preceding items For details, see :func:`q.maxs ` and `maxs on code.kx.com - `_. + `_. .. py:method:: K.mcount - moving count verb + moving count For details, see :func:`q.mcount ` and `mcount on code.kx.com - `_. + `_. .. py:method:: K.md5 - md5 function + MD5 hash For details, see :func:`q.md5 ` and `md5 on code.kx.com - `_. + `_. .. py:method:: K.mdev - moving deviation verb + moving deviation For details, see :func:`q.mdev ` and `mdev on code.kx.com - `_. + `_. .. py:method:: K.med - median function + median For details, see :func:`q.med ` and `med on code.kx.com - `_. + `_. .. py:method:: K.meta - meta data function + metadata of a table For details, see :func:`q.meta ` and `meta on code.kx.com - `_. + `_. .. py:method:: K.min - minimum function + minimum For details, see :func:`q.min ` and `min on code.kx.com - `_. + `_. .. py:method:: K.mins - minimums function + minimum of preceding items For details, see :func:`q.mins ` and `mins on code.kx.com - `_. + `_. .. py:method:: K.mmax - moving maximum verb + moving maxima For details, see :func:`q.mmax ` and `mmax on code.kx.com - `_. + `_. .. py:method:: K.mmin - moving minimum verb + moving minima For details, see :func:`q.mmin ` and `mmin on code.kx.com - `_. + `_. .. py:method:: K.mmu - matrix multiplication verb + mmu For details, see :func:`q.mmu ` and `mmu on code.kx.com - `_. + `_. .. py:method:: K.mod - modulus verb + remainder For details, see :func:`q.mod ` and `mod on code.kx.com - `_. + `_. .. py:method:: K.msum - moving sum verb + moving sum For details, see :func:`q.msum ` and `msum on code.kx.com - `_. + `_. .. py:method:: K.neg - negative function + negate For details, see :func:`q.neg ` and `neg on code.kx.com - `_. + `_. .. py:method:: K.next - next function + next items For details, see :func:`q.next ` and `next on code.kx.com - `_. + `_. .. py:method:: K.not_ - logical not function + not For details, see :func:`q.not_ ` and `not on code.kx.com - `_. + `_. .. py:method:: K.null - null function + null For details, see :func:`q.null ` and `null on code.kx.com - `_. + `_. .. py:method:: K.or_ - or verb + or For details, see :func:`q.or_ ` and `or on code.kx.com - `_. - - -.. py:method:: K.over - - over adverb - - For details, see :func:`q.over ` and `over on code.kx.com - `_. + `_. .. py:method:: K.parse - parse function + parse a string For details, see :func:`q.parse ` and `parse on code.kx.com - `_. + `_. .. py:method:: K.peach - parallel each adverb + peach For details, see :func:`q.peach ` and `peach on code.kx.com - `_. + `_. .. py:method:: K.pj - plus join verb + plus join For details, see :func:`q.pj ` and `pj on code.kx.com - `_. + `_. .. py:method:: K.prd - product function + product For details, see :func:`q.prd ` and `prd on code.kx.com - `_. + `_. .. py:method:: K.prds - cumulative product function + cumulative products For details, see :func:`q.prds ` and `prds on code.kx.com - `_. + `_. .. py:method:: K.prev - prev function + previous items For details, see :func:`q.prev ` and `prev on code.kx.com - `_. + `_. .. py:method:: K.prior - prior function + prior For details, see :func:`q.prior ` and `prior on code.kx.com - `_. + `_. .. py:method:: K.rand - random function + random number For details, see :func:`q.rand ` and `rand on code.kx.com - `_. + `_. .. py:method:: K.rank - rank function + grade up For details, see :func:`q.rank ` and `rank on code.kx.com - `_. + `_. .. py:method:: K.ratios - ratios function + ratios of consecutive pairs For details, see :func:`q.ratios ` and `ratios on code.kx.com - `_. + `_. .. py:method:: K.raze - raze function + join items For details, see :func:`q.raze ` and `raze on code.kx.com - `_. + `_. .. py:method:: K.read0 - file read function + read file as lines For details, see :func:`q.read0 ` and `read0 on code.kx.com - `_. + `_. .. py:method:: K.read1 - file read function + read file as bytes For details, see :func:`q.read1 ` and `read1 on code.kx.com - `_. + `_. .. py:method:: K.reciprocal - reciprocal function + reciprocal of a number For details, see :func:`q.reciprocal ` and `reciprocal on code.kx.com - `_. - - -.. py:method:: K.reval - - reval function - - For details, see :func:`q.reval ` and `reval on code.kx.com - `_. + `_. .. py:method:: K.reval - reval function + variation of eval For details, see :func:`q.reval ` and `reval on code.kx.com - `_. + `_. .. py:method:: K.reverse - reverse function + reverse the order of items For details, see :func:`q.reverse ` and `reverse on code.kx.com - `_. + `_. .. py:method:: K.rload - rload function + load a splayed table For details, see :func:`q.rload ` and `rload on code.kx.com - `_. + `_. .. py:method:: K.rotate - rotate verb + rotate items For details, see :func:`q.rotate ` and `rotate on code.kx.com - `_. + `_. .. py:method:: K.rsave - rsave function + rsave For details, see :func:`q.rsave ` and `rsave on code.kx.com - `_. + `_. .. py:method:: K.rtrim - right trim function + remove trailing spaces For details, see :func:`q.rtrim ` and `rtrim on code.kx.com - `_. + `_. .. py:method:: K.save - save function + save global data to file For details, see :func:`q.save ` and `save on code.kx.com - `_. - - -.. py:method:: K.scan - - scan adverb - - For details, see :func:`q.scan ` and `scan on code.kx.com - `_. + `_. .. py:method:: K.scov - statistical covariance verb + statistical covariance For details, see :func:`q.scov ` and `scov on code.kx.com - `_. + `_. .. py:method:: K.scov - statistical covariance verb + statistical covariance For details, see :func:`q.scov ` and `scov on code.kx.com - `_. + `_. .. py:method:: K.sdev - statistical standard deviation function + statistical standard deviation For details, see :func:`q.sdev ` and `sdev on code.kx.com - `_. + `_. .. py:method:: K.sdev - statistical standard deviation function + statistical standard deviation For details, see :func:`q.sdev ` and `sdev on code.kx.com - `_. + `_. .. py:method:: K.set - set verb + set For details, see :func:`q.set ` and `set on code.kx.com - `_. + `_. .. py:method:: K.setenv - setenv verb + set an environment variable For details, see :func:`q.setenv ` and `setenv on code.kx.com - `_. + `_. .. py:method:: K.show - show function + format to the console For details, see :func:`q.show ` and `show on code.kx.com - `_. + `_. .. py:method:: K.signum - signum function + sign of its argument/s For details, see :func:`q.signum ` and `signum on code.kx.com - `_. + `_. .. py:method:: K.sin - sine function + sine For details, see :func:`q.sin ` and `sin on code.kx.com - `_. + `_. .. py:method:: K.sqrt - square root function + square root For details, see :func:`q.sqrt ` and `sqrt on code.kx.com - `_. + `_. .. py:method:: K.ss - string search function + string search For details, see :func:`q.ss ` and `ss on code.kx.com - `_. + `_. .. py:method:: K.ssr - string search replace function + string search and replace For details, see :func:`q.ssr ` and `ssr on code.kx.com - `_. + `_. .. py:method:: K.string - string function + cast to string For details, see :func:`q.string ` and `string on code.kx.com - `_. + `_. .. py:method:: K.sublist - sublist verb + sublist of a list For details, see :func:`q.sublist ` and `sublist on code.kx.com - `_. + `_. .. py:method:: K.sum - sum function + sum of a list For details, see :func:`q.sum ` and `sum on code.kx.com - `_. + `_. .. py:method:: K.sums - cumulative sum function + cumulative sums of a list For details, see :func:`q.sums ` and `sums on code.kx.com - `_. + `_. .. py:method:: K.sv - scalar from vector verb + consolidate For details, see :func:`q.sv ` and `sv on code.kx.com - `_. + `_. .. py:method:: K.svar - statistical variance function + statistical variance For details, see :func:`q.svar ` and `svar on code.kx.com - `_. + `_. .. py:method:: K.svar - statistical variance function + statistical variance For details, see :func:`q.svar ` and `svar on code.kx.com - `_. + `_. .. py:method:: K.system - system command function + system For details, see :func:`q.system ` and `system on code.kx.com - `_. + `_. .. py:method:: K.tables - tables function + sorted list of tables For details, see :func:`q.tables ` and `tables on code.kx.com - `_. + `_. .. py:method:: K.tan - tangent function + tangent For details, see :func:`q.tan ` and `tan on code.kx.com - `_. + `_. .. py:method:: K.til - til function + integers up to x For details, see :func:`q.til ` and `til on code.kx.com - `_. + `_. .. py:method:: K.trim - trim function + remove leading and trailing spaces For details, see :func:`q.trim ` and `trim on code.kx.com - `_. + `_. .. py:method:: K.type - type function + data type For details, see :func:`q.type ` and `type on code.kx.com - `_. + `_. .. py:method:: K.uj - union join verb + union join For details, see :func:`q.uj ` and `uj on code.kx.com - `_. + `_. + + +.. py:method:: K.ujf + + The ujf function. + + For details, see :func:`q.ujf ` and `ujf on code.kx.com + `_. .. py:method:: K.ungroup - ungroup function + flattened table For details, see :func:`q.ungroup ` and `ungroup on code.kx.com - `_. + `_. .. py:method:: K.union - union verb + distinct items of combination of two lists For details, see :func:`q.union ` and `union on code.kx.com - `_. + `_. .. py:method:: K.upper - uppercase function + upper-case For details, see :func:`q.upper ` and `upper on code.kx.com - `_. + `_. .. py:method:: K.upsert - upsert verb + add table records For details, see :func:`q.upsert ` and `upsert on code.kx.com - `_. + `_. .. py:method:: K.value - value function + value For details, see :func:`q.value ` and `value on code.kx.com - `_. + `_. .. py:method:: K.var - variance function + variance For details, see :func:`q.var ` and `var on code.kx.com - `_. + `_. .. py:method:: K.view - view function + definition of a dependency For details, see :func:`q.view ` and `view on code.kx.com - `_. + `_. .. py:method:: K.views - views function + list of defined views For details, see :func:`q.views ` and `views on code.kx.com - `_. + `_. .. py:method:: K.vs - vector from scalar verb + split For details, see :func:`q.vs ` and `vs on code.kx.com - `_. + `_. .. py:method:: K.wavg - weighted average verb + weighted average For details, see :func:`q.wavg ` and `wavg on code.kx.com - `_. + `_. .. py:method:: K.where - where function + replicated items For details, see :func:`q.where ` and `where on code.kx.com - `_. + `_. .. py:method:: K.within - within verb + flag items within range For details, see :func:`q.within ` and `within on code.kx.com - `_. + `_. .. py:method:: K.wj - window join function + window join For details, see :func:`q.wj ` and `wj on code.kx.com - `_. + `_. .. py:method:: K.wj1 - The wj1 function. + window join For details, see :func:`q.wj1 ` and `wj1 on code.kx.com - `_. + `_. .. py:method:: K.wsum - weighted sum verb + weighted sum For details, see :func:`q.wsum ` and `wsum on code.kx.com - `_. + `_. .. py:method:: K.ww @@ -1283,94 +1259,94 @@ The ww function. For details, see :func:`q.ww ` and `ww on code.kx.com - `_. + `_. .. py:method:: K.xasc - ascending sort verb + table sorted ascending by columns For details, see :func:`q.xasc ` and `xasc on code.kx.com - `_. + `_. .. py:method:: K.xbar - interval bar verb + interval bar For details, see :func:`q.xbar ` and `xbar on code.kx.com - `_. + `_. .. py:method:: K.xcol - rename columns verb + rename table columns For details, see :func:`q.xcol ` and `xcol on code.kx.com - `_. + `_. .. py:method:: K.xcols - reorder columns verb + re-order table columns For details, see :func:`q.xcols ` and `xcols on code.kx.com - `_. + `_. .. py:method:: K.xdesc - descending sort verb + table sorted descending by columns For details, see :func:`q.xdesc ` and `xdesc on code.kx.com - `_. + `_. .. py:method:: K.xexp - power verb + raised to a power For details, see :func:`q.xexp ` and `xexp on code.kx.com - `_. + `_. .. py:method:: K.xgroup - grouping verb + table grouped by keys For details, see :func:`q.xgroup ` and `xgroup on code.kx.com - `_. + `_. .. py:method:: K.xkey - set primary key verb + set primary keys of a table For details, see :func:`q.xkey ` and `xkey on code.kx.com - `_. + `_. .. py:method:: K.xlog - base-x log verb + base-x logarithm For details, see :func:`q.xlog ` and `xlog on code.kx.com - `_. + `_. .. py:method:: K.xprev - previous verb + previous items For details, see :func:`q.xprev ` and `xprev on code.kx.com - `_. + `_. .. py:method:: K.xrank - buckets verb + items assigned to buckets For details, see :func:`q.xrank ` and `xrank on code.kx.com - `_. + `_. diff --git a/doc/reference/q-funcs.rst b/doc/reference/q-funcs.rst index 3321deb..7381248 100644 --- a/doc/reference/q-funcs.rst +++ b/doc/reference/q-funcs.rst @@ -1,6 +1,6 @@ .. py:function:: q.abs - absolute value function + absolute value The abs function computes the absolute value of its argument. Null is returned if the argument is null. >>> q.abs([-1, 0, 1, None]) @@ -8,1201 +8,1182 @@ - See also `abs on code.kx.com `_. + See also `abs on code.kx.com `_. .. py:function:: q.acos - arc cosine function + arc cosine - See also `acos on code.kx.com `_. + See also `acos on code.kx.com `_. .. py:function:: q.aj - asof join function + as-of join - See also `aj on code.kx.com `_. + See also `aj on code.kx.com `_. .. py:function:: q.aj0 - asof join function + as-of join - See also `aj on code.kx.com `_. + See also `aj on code.kx.com `_. .. py:function:: q.all - all function + all nonzero - See also `all on code.kx.com `_. + See also `all on code.kx.com `_. .. py:function:: q.and_ - and verb + and - See also `and on code.kx.com `_. + See also `and on code.kx.com `_. .. py:function:: q.any - any function + any item is non-zero - See also `any on code.kx.com `_. + See also `any on code.kx.com `_. .. py:function:: q.asc - ascending function + ascending sort - See also `asc on code.kx.com `_. + See also `asc on code.kx.com `_. .. py:function:: q.asin - arc sine function + arc sine - See also `asin on code.kx.com `_. + See also `asin on code.kx.com `_. .. py:function:: q.asof - asof verb + as-of operator - See also `asof on code.kx.com `_. + See also `asof on code.kx.com `_. .. py:function:: q.atan - arc tangent function + arc tangent - See also `atan on code.kx.com `_. + See also `atan on code.kx.com `_. .. py:function:: q.attr - attributes function + attributes - See also `attr on code.kx.com `_. + See also `attr on code.kx.com `_. .. py:function:: q.avg - average function + arithmetic mean - See also `avg on code.kx.com `_. + See also `avg on code.kx.com `_. .. py:function:: q.avgs - running averages function + running averages - See also `avgs on code.kx.com `_. + See also `avgs on code.kx.com `_. .. py:function:: q.bin - binary search verb + binary search - See also `bin on code.kx.com `_. + See also `bin on code.kx.com `_. .. py:function:: q.binr - binary search verb + binary search - See also `bin on code.kx.com `_. + See also `bin on code.kx.com `_. .. py:function:: q.ceiling - ceiling function + lowest integer above - See also `ceiling on code.kx.com `_. + See also `ceiling on code.kx.com `_. .. py:function:: q.cols - columns function + column names of a table - See also `cols on code.kx.com `_. + See also `cols on code.kx.com `_. .. py:function:: q.cor - correlation verb + correlation - See also `cor on code.kx.com `_. + See also `cor on code.kx.com `_. .. py:function:: q.cos - cosine function + cosine - See also `cos on code.kx.com `_. + See also `cos on code.kx.com `_. .. py:function:: q.count - count function + number of items - See also `count on code.kx.com `_. + See also `count on code.kx.com `_. .. py:function:: q.cov - covariance verb + statistical covariance - See also `cov on code.kx.com `_. + See also `cov on code.kx.com `_. .. py:function:: q.cross - cross product verb + cross product - See also `cross on code.kx.com `_. + See also `cross on code.kx.com `_. .. py:function:: q.csv - csv global + comma delimiter - See also `csv on code.kx.com `_. + See also `csv on code.kx.com `_. .. py:function:: q.cut - cut verb + cut - See also `cut on code.kx.com `_. + See also `cut on code.kx.com `_. .. py:function:: q.deltas - deltas function + differences between consecutive pairs - See also `deltas on code.kx.com `_. + See also `deltas on code.kx.com `_. .. py:function:: q.desc - descending sort function + descending sort - See also `desc on code.kx.com `_. + See also `desc on code.kx.com `_. .. py:function:: q.dev - standard deviation function + standard deviation - See also `dev on code.kx.com `_. + See also `dev on code.kx.com `_. .. py:function:: q.differ - differ function + flag differences in consecutive pairs - See also `differ on code.kx.com `_. + See also `differ on code.kx.com `_. .. py:function:: q.distinct - distinct function + unique items - See also `distinct on code.kx.com `_. + See also `distinct on code.kx.com `_. .. py:function:: q.div - integer division verb + integer division - See also `div on code.kx.com `_. + See also `div on code.kx.com `_. .. py:function:: q.dsave - dsave function + save global tables to disk - See also `dsave on code.kx.com `_. - - -.. py:function:: q.each - - each adverb - - See also `each on code.kx.com `_. + See also `dsave on code.kx.com `_. .. py:function:: q.ej - equijoin verb + equi-join - See also `ej on code.kx.com `_. + See also `ej on code.kx.com `_. .. py:function:: q.ema - exponentially weighted moving average verb + exponentially-weighted moving average - See also `ema on code.kx.com `_. + See also `ema on code.kx.com `_. .. py:function:: q.ema - exponentially weighted moving average verb + exponentially-weighted moving average - See also `ema on code.kx.com `_. + See also `ema on code.kx.com `_. .. py:function:: q.enlist - enlist function + arguments as a list - See also `enlist on code.kx.com `_. + See also `enlist on code.kx.com `_. .. py:function:: q.eval - eval function + evaluate a parse tree - See also `eval on code.kx.com `_. + See also `eval on code.kx.com `_. .. py:function:: q.except_ - except verb + left argument without items in right argument - See also `except on code.kx.com `_. + See also `except on code.kx.com `_. .. py:function:: q.exp - exp function + power of e - See also `exp on code.kx.com `_. + See also `exp on code.kx.com `_. .. py:function:: q.fby filter-by - See also `fby on code.kx.com `_. + See also `fby on code.kx.com `_. .. py:function:: q.fills - fills function + forward-fill nulls - See also `fills on code.kx.com `_. + See also `fills on code.kx.com `_. .. py:function:: q.first - first function + first item - See also `first on code.kx.com `_. + See also `first on code.kx.com `_. .. py:function:: q.fkeys - fkeys function + foreign-key columns mapped to their tables - See also `fkeys on code.kx.com `_. + See also `fkeys on code.kx.com `_. .. py:function:: q.flip - flip function + transpose - See also `flip on code.kx.com `_. + See also `flip on code.kx.com `_. .. py:function:: q.floor - floor function + greatest integer less than argument - See also `floor on code.kx.com `_. + See also `floor on code.kx.com `_. .. py:function:: q.get - get function + get - See also `get on code.kx.com `_. + See also `get on code.kx.com `_. .. py:function:: q.getenv - getenv function + value of an environment variable - See also `getenv on code.kx.com `_. + See also `getenv on code.kx.com `_. .. py:function:: q.group - group function + dictionary of distinct items - See also `group on code.kx.com `_. + See also `group on code.kx.com `_. .. py:function:: q.gtime - gtime function + UTC timestamp - See also `gtime on code.kx.com `_. + See also `gtime on code.kx.com `_. .. py:function:: q.hclose - hclose function + close a file or process - See also `hclose on code.kx.com `_. + See also `hclose on code.kx.com `_. .. py:function:: q.hcount - hcount function + size of a file - See also `hcount on code.kx.com `_. + See also `hcount on code.kx.com `_. .. py:function:: q.hdel - hdel function + delete a file - See also `hdel on code.kx.com `_. + See also `hdel on code.kx.com `_. .. py:function:: q.hopen - hopen function + open a file - See also `hopen on code.kx.com `_. + See also `hopen on code.kx.com `_. .. py:function:: q.hsym - hsym function + convert symbol to filename or IP address - See also `hsym on code.kx.com `_. + See also `hsym on code.kx.com `_. .. py:function:: q.iasc - ascending function + indices of ascending sort - See also `iasc on code.kx.com `_. + See also `iasc on code.kx.com `_. .. py:function:: q.idesc - descending function + indices of descending sort - See also `idesc on code.kx.com `_. + See also `idesc on code.kx.com `_. .. py:function:: q.ij - inner join verb + inner join - See also `ij on code.kx.com `_. + See also `ij on code.kx.com `_. .. py:function:: q.ijf The ijf function. - See also `ijf on code.kx.com `_. + See also `ijf on code.kx.com `_. .. py:function:: q.in_ - membership verb + membership - See also `in on code.kx.com `_. + See also `in on code.kx.com `_. .. py:function:: q.insert - insert verb + append records to a table - See also `insert on code.kx.com `_. + See also `insert on code.kx.com `_. .. py:function:: q.inter - intersect verb + items common to both arguments - See also `inter on code.kx.com `_. + See also `inter on code.kx.com `_. .. py:function:: q.inv - inverse function + matrix inverse - See also `inv on code.kx.com `_. + See also `inv on code.kx.com `_. .. py:function:: q.key - key function + key - See also `key on code.kx.com `_. + See also `key on code.kx.com `_. .. py:function:: q.keys - keys function + names of a table's columns - See also `keys on code.kx.com `_. + See also `keys on code.kx.com `_. .. py:function:: q.last - last function + last item - See also `last on code.kx.com `_. + See also `last on code.kx.com `_. .. py:function:: q.like - pattern matching verb + pattern matching - See also `like on code.kx.com `_. + See also `like on code.kx.com `_. .. py:function:: q.lj - left join verb + left join - See also `lj on code.kx.com `_. + See also `lj on code.kx.com `_. .. py:function:: q.ljf - The ljf function. + left join - See also `ljf on code.kx.com `_. + See also `ljf on code.kx.com `_. .. py:function:: q.load - load function + load binary data - See also `load on code.kx.com `_. + See also `load on code.kx.com `_. .. py:function:: q.log - log function + natural logarithm - See also `log on code.kx.com `_. + See also `log on code.kx.com `_. .. py:function:: q.lower - lowercase function + lower case - See also `lower on code.kx.com `_. + See also `lower on code.kx.com `_. .. py:function:: q.lsq - least squares verb + least squares matrix divide - See also `lsq on code.kx.com `_. + See also `lsq on code.kx.com `_. .. py:function:: q.ltime - ltime function + local timestamp - See also `ltime on code.kx.com `_. + See also `ltime on code.kx.com `_. .. py:function:: q.ltrim - left trim function + function remove leading spaces - See also `ltrim on code.kx.com `_. + See also `ltrim on code.kx.com `_. .. py:function:: q.mavg - moving average verb + moving average - See also `mavg on code.kx.com `_. + See also `mavg on code.kx.com `_. .. py:function:: q.max - maximum function + maximum - See also `max on code.kx.com `_. + See also `max on code.kx.com `_. .. py:function:: q.maxs - maximums function + maxima of preceding items - See also `maxs on code.kx.com `_. + See also `maxs on code.kx.com `_. .. py:function:: q.mcount - moving count verb + moving count - See also `mcount on code.kx.com `_. + See also `mcount on code.kx.com `_. .. py:function:: q.md5 - md5 function + MD5 hash - See also `md5 on code.kx.com `_. + See also `md5 on code.kx.com `_. .. py:function:: q.mdev - moving deviation verb + moving deviation - See also `mdev on code.kx.com `_. + See also `mdev on code.kx.com `_. .. py:function:: q.med - median function + median - See also `med on code.kx.com `_. + See also `med on code.kx.com `_. .. py:function:: q.meta - meta data function + metadata of a table - See also `meta on code.kx.com `_. + See also `meta on code.kx.com `_. .. py:function:: q.min - minimum function + minimum - See also `min on code.kx.com `_. + See also `min on code.kx.com `_. .. py:function:: q.mins - minimums function + minimum of preceding items - See also `mins on code.kx.com `_. + See also `mins on code.kx.com `_. .. py:function:: q.mmax - moving maximum verb + moving maxima - See also `mmax on code.kx.com `_. + See also `mmax on code.kx.com `_. .. py:function:: q.mmin - moving minimum verb + moving minima - See also `mmin on code.kx.com `_. + See also `mmin on code.kx.com `_. .. py:function:: q.mmu - matrix multiplication verb + mmu - See also `mmu on code.kx.com `_. + See also `mmu on code.kx.com `_. .. py:function:: q.mod - modulus verb + remainder - See also `mod on code.kx.com `_. + See also `mod on code.kx.com `_. .. py:function:: q.msum - moving sum verb + moving sum - See also `msum on code.kx.com `_. + See also `msum on code.kx.com `_. .. py:function:: q.neg - negative function + negate - See also `neg on code.kx.com `_. + See also `neg on code.kx.com `_. .. py:function:: q.next - next function + next items - See also `next on code.kx.com `_. + See also `next on code.kx.com `_. .. py:function:: q.not_ - logical not function + not - See also `not on code.kx.com `_. + See also `not on code.kx.com `_. .. py:function:: q.null - null function + null - See also `null on code.kx.com `_. + See also `null on code.kx.com `_. .. py:function:: q.or_ - or verb - - See also `or on code.kx.com `_. - + or -.. py:function:: q.over - - over adverb - - See also `over on code.kx.com `_. + See also `or on code.kx.com `_. .. py:function:: q.parse - parse function + parse a string - See also `parse on code.kx.com `_. + See also `parse on code.kx.com `_. .. py:function:: q.peach - parallel each adverb + peach - See also `peach on code.kx.com `_. + See also `peach on code.kx.com `_. .. py:function:: q.pj - plus join verb + plus join - See also `pj on code.kx.com `_. + See also `pj on code.kx.com `_. .. py:function:: q.prd - product function + product - See also `prd on code.kx.com `_. + See also `prd on code.kx.com `_. .. py:function:: q.prds - cumulative product function + cumulative products - See also `prds on code.kx.com `_. + See also `prds on code.kx.com `_. .. py:function:: q.prev - prev function + previous items - See also `prev on code.kx.com `_. + See also `prev on code.kx.com `_. .. py:function:: q.prior - prior function + prior - See also `prior on code.kx.com `_. + See also `prior on code.kx.com `_. .. py:function:: q.rand - random function + random number - See also `rand on code.kx.com `_. + See also `rand on code.kx.com `_. .. py:function:: q.rank - rank function + grade up - See also `rank on code.kx.com `_. + See also `rank on code.kx.com `_. .. py:function:: q.ratios - ratios function + ratios of consecutive pairs - See also `ratios on code.kx.com `_. + See also `ratios on code.kx.com `_. .. py:function:: q.raze - raze function + join items - See also `raze on code.kx.com `_. + See also `raze on code.kx.com `_. .. py:function:: q.read0 - file read function + read file as lines - See also `read0 on code.kx.com `_. + See also `read0 on code.kx.com `_. .. py:function:: q.read1 - file read function + read file as bytes - See also `read1 on code.kx.com `_. + See also `read1 on code.kx.com `_. .. py:function:: q.reciprocal - reciprocal function + reciprocal of a number - See also `reciprocal on code.kx.com `_. + See also `reciprocal on code.kx.com `_. .. py:function:: q.reval - reval function - - See also `reval on code.kx.com `_. - - -.. py:function:: q.reval + variation of eval - reval function - - See also `reval on code.kx.com `_. + See also `reval on code.kx.com `_. .. py:function:: q.reverse - reverse function + reverse the order of items - See also `reverse on code.kx.com `_. + See also `reverse on code.kx.com `_. .. py:function:: q.rload - rload function + load a splayed table - See also `rload on code.kx.com `_. + See also `rload on code.kx.com `_. .. py:function:: q.rotate - rotate verb + rotate items - See also `rotate on code.kx.com `_. + See also `rotate on code.kx.com `_. .. py:function:: q.rsave - rsave function + rsave - See also `rsave on code.kx.com `_. + See also `rsave on code.kx.com `_. .. py:function:: q.rtrim - right trim function + remove trailing spaces - See also `rtrim on code.kx.com `_. + See also `rtrim on code.kx.com `_. .. py:function:: q.save - save function - - See also `save on code.kx.com `_. - + save global data to file -.. py:function:: q.scan - - scan adverb - - See also `scan on code.kx.com `_. + See also `save on code.kx.com `_. .. py:function:: q.scov - statistical covariance verb + statistical covariance - See also `scov on code.kx.com `_. + See also `scov on code.kx.com `_. .. py:function:: q.scov - statistical covariance verb + statistical covariance - See also `scov on code.kx.com `_. + See also `scov on code.kx.com `_. .. py:function:: q.sdev - statistical standard deviation function + statistical standard deviation - See also `sdev on code.kx.com `_. + See also `sdev on code.kx.com `_. .. py:function:: q.sdev - statistical standard deviation function + statistical standard deviation - See also `sdev on code.kx.com `_. + See also `sdev on code.kx.com `_. .. py:function:: q.set - set verb + set - See also `set on code.kx.com `_. + See also `set on code.kx.com `_. .. py:function:: q.setenv - setenv verb + set an environment variable - See also `setenv on code.kx.com `_. + See also `setenv on code.kx.com `_. .. py:function:: q.show - show function + format to the console - See also `show on code.kx.com `_. + See also `show on code.kx.com `_. .. py:function:: q.signum - signum function + sign of its argument/s - See also `signum on code.kx.com `_. + See also `signum on code.kx.com `_. .. py:function:: q.sin - sine function + sine - See also `sin on code.kx.com `_. + See also `sin on code.kx.com `_. .. py:function:: q.sqrt - square root function + square root - See also `sqrt on code.kx.com `_. + See also `sqrt on code.kx.com `_. .. py:function:: q.ss - string search function + string search - See also `ss on code.kx.com `_. + See also `ss on code.kx.com `_. .. py:function:: q.ssr - string search replace function + string search and replace - See also `ssr on code.kx.com `_. + See also `ssr on code.kx.com `_. .. py:function:: q.string - string function + cast to string - See also `string on code.kx.com `_. + See also `string on code.kx.com `_. .. py:function:: q.sublist - sublist verb + sublist of a list - See also `sublist on code.kx.com `_. + See also `sublist on code.kx.com `_. .. py:function:: q.sum - sum function + sum of a list - See also `sum on code.kx.com `_. + See also `sum on code.kx.com `_. .. py:function:: q.sums - cumulative sum function + cumulative sums of a list - See also `sums on code.kx.com `_. + See also `sums on code.kx.com `_. .. py:function:: q.sv - scalar from vector verb + consolidate - See also `sv on code.kx.com `_. + See also `sv on code.kx.com `_. .. py:function:: q.svar - statistical variance function + statistical variance - See also `svar on code.kx.com `_. + See also `svar on code.kx.com `_. .. py:function:: q.svar - statistical variance function + statistical variance - See also `svar on code.kx.com `_. + See also `svar on code.kx.com `_. .. py:function:: q.system - system command function + system - See also `system on code.kx.com `_. + See also `system on code.kx.com `_. .. py:function:: q.tables - tables function + sorted list of tables - See also `tables on code.kx.com `_. + See also `tables on code.kx.com `_. .. py:function:: q.tan - tangent function + tangent - See also `tan on code.kx.com `_. + See also `tan on code.kx.com `_. .. py:function:: q.til - til function + integers up to x - See also `til on code.kx.com `_. + See also `til on code.kx.com `_. .. py:function:: q.trim - trim function + remove leading and trailing spaces - See also `trim on code.kx.com `_. + See also `trim on code.kx.com `_. .. py:function:: q.type - type function + data type - See also `type on code.kx.com `_. + See also `type on code.kx.com `_. .. py:function:: q.uj - union join verb + union join + + See also `uj on code.kx.com `_. - See also `uj on code.kx.com `_. + +.. py:function:: q.ujf + + The ujf function. + + See also `ujf on code.kx.com `_. .. py:function:: q.ungroup - ungroup function + flattened table - See also `ungroup on code.kx.com `_. + See also `ungroup on code.kx.com `_. .. py:function:: q.union - union verb + distinct items of combination of two lists - See also `union on code.kx.com `_. + See also `union on code.kx.com `_. .. py:function:: q.upper - uppercase function + upper-case - See also `upper on code.kx.com `_. + See also `upper on code.kx.com `_. .. py:function:: q.upsert - upsert verb + add table records - See also `upsert on code.kx.com `_. + See also `upsert on code.kx.com `_. .. py:function:: q.value - value function + value - See also `value on code.kx.com `_. + See also `value on code.kx.com `_. .. py:function:: q.var - variance function + variance - See also `var on code.kx.com `_. + See also `var on code.kx.com `_. .. py:function:: q.view - view function + definition of a dependency - See also `view on code.kx.com `_. + See also `view on code.kx.com `_. .. py:function:: q.views - views function + list of defined views - See also `views on code.kx.com `_. + See also `views on code.kx.com `_. .. py:function:: q.vs - vector from scalar verb + split - See also `vs on code.kx.com `_. + See also `vs on code.kx.com `_. .. py:function:: q.wavg - weighted average verb + weighted average - See also `wavg on code.kx.com `_. + See also `wavg on code.kx.com `_. .. py:function:: q.where - where function + replicated items - See also `where on code.kx.com `_. + See also `where on code.kx.com `_. .. py:function:: q.within - within verb + flag items within range - See also `within on code.kx.com `_. + See also `within on code.kx.com `_. .. py:function:: q.wj - window join function + window join - See also `wj on code.kx.com `_. + See also `wj on code.kx.com `_. .. py:function:: q.wj1 - The wj1 function. + window join - See also `wj1 on code.kx.com `_. + See also `wj1 on code.kx.com `_. .. py:function:: q.wsum - weighted sum verb + weighted sum - See also `wsum on code.kx.com `_. + See also `wsum on code.kx.com `_. .. py:function:: q.ww The ww function. - See also `ww on code.kx.com `_. + See also `ww on code.kx.com `_. .. py:function:: q.xasc - ascending sort verb + table sorted ascending by columns - See also `xasc on code.kx.com `_. + See also `xasc on code.kx.com `_. .. py:function:: q.xbar - interval bar verb + interval bar - See also `xbar on code.kx.com `_. + See also `xbar on code.kx.com `_. .. py:function:: q.xcol - rename columns verb + rename table columns - See also `xcol on code.kx.com `_. + See also `xcol on code.kx.com `_. .. py:function:: q.xcols - reorder columns verb + re-order table columns - See also `xcols on code.kx.com `_. + See also `xcols on code.kx.com `_. .. py:function:: q.xdesc - descending sort verb + table sorted descending by columns - See also `xdesc on code.kx.com `_. + See also `xdesc on code.kx.com `_. .. py:function:: q.xexp - power verb + raised to a power - See also `xexp on code.kx.com `_. + See also `xexp on code.kx.com `_. .. py:function:: q.xgroup - grouping verb + table grouped by keys - See also `xgroup on code.kx.com `_. + See also `xgroup on code.kx.com `_. .. py:function:: q.xkey - set primary key verb + set primary keys of a table - See also `xkey on code.kx.com `_. + See also `xkey on code.kx.com `_. .. py:function:: q.xlog - base-x log verb + base-x logarithm - See also `xlog on code.kx.com `_. + See also `xlog on code.kx.com `_. .. py:function:: q.xprev - previous verb + previous items - See also `xprev on code.kx.com `_. + See also `xprev on code.kx.com `_. .. py:function:: q.xrank - buckets verb + items assigned to buckets + + See also `xrank on code.kx.com `_. + - See also `xrank on code.kx.com `_. diff --git a/doc/whatsnew/changelog.rst b/doc/whatsnew/changelog.rst index a5cdf05..e4a9da4 100644 --- a/doc/whatsnew/changelog.rst +++ b/doc/whatsnew/changelog.rst @@ -4,6 +4,26 @@ Version History =============== +`PyQ 4.0.2 `_ +------------------------------------------------------ + +Released on 2017-05-12 + +Enhancements: + + - !523 - #909: Support installing PyQ on Ubuntu 16.04. + - !528 - #911: qp and pq: set console size in q when running ptpython scripts. + - !535 - #910: qp: exit from q) prompt on Ctrl-D. + - !536 - #912: qp: report error and exit if pre-loading fails. + + +Documentation: + + - !537 - #909: Added a guide on installing PyQ on Ubuntu. + - !533 - #914: Use new kx.code.com. + + + `PyQ 4.0.1 `_ ------------------------------------------------------ diff --git a/doc/words.txt b/doc/words.txt index 27d1cc2..00e8bf9 100644 --- a/doc/words.txt +++ b/doc/words.txt @@ -116,3 +116,14 @@ ini sys fallback intersphinx +equi +filename +maxima +metadata +minima +mmu +ujf +Ubuntu +ptpython +Ctrl +pre diff --git a/setup.py b/setup.py index a96de6a..4d5ade0 100755 --- a/setup.py +++ b/setup.py @@ -40,7 +40,7 @@ from platform import uname -VERSION = '4.0.1' +VERSION = '4.0.2' IS_RELEASE = True PYQ_SRC_DIR = os.path.join('src', 'pyq') VERSION_FILE = os.path.join(PYQ_SRC_DIR, 'version.py') @@ -350,7 +350,7 @@ def finalize_options(self): self.q_module_rules.append((None, 'PYTHON:', 'PYTHON: "%s"\n' % python_path)) - if platform == 'Darwin' or sys.version_info[0] >= 3: # Issue #559 + if platform == 'Darwin': # Issue #559 if virtual_env: if sys.version_info[0] < 3: lib_string = 'lib:"%s\\000"\n' % os.path.join(virtual_env, '.Python') diff --git a/src/pyq/_pt_run.py b/src/pyq/_pt_run.py index ff64640..69a5f94 100644 --- a/src/pyq/_pt_run.py +++ b/src/pyq/_pt_run.py @@ -1,5 +1,7 @@ from __future__ import print_function import sys +import os + try: import ptpython.entry_points.run_ptpython as ptp except ImportError: @@ -12,12 +14,28 @@ from pyq import q, kerr +def console_size(fd=1): + try: + import fcntl + import termios + import struct + except ImportError: + size = os.getenv('LINES', 25), os.getenv('COLUMNS', 80) + else: + size = struct.unpack('hh', fcntl.ioctl(fd, termios.TIOCGWINSZ, + b'1234')) + return size + + def run(q_prompt=False): + lines, columns = console_size() + q(r'\c %d %d' % (lines, columns)) if len(sys.argv) > 1: try: q(r'\l %s' % sys.argv[1]) - except kerr: - pass + except kerr as e: + print(e) + exit(1) else: del sys.argv[1] if q_prompt: diff --git a/src/pyq/ptk.py b/src/pyq/ptk.py index 89b9773..abadce6 100644 --- a/src/pyq/ptk.py +++ b/src/pyq/ptk.py @@ -93,9 +93,7 @@ def cmdloop(self, intro=None): history=history, style=style, true_color=True, on_exit='return-none', on_abort='return-none', completer=QCompleter()) - if line is None: - stop = True - elif line.strip() == r'\\': + if line is None or line.strip() == r'\\': raise SystemExit else: line = self.precmd(line)