Skip to content

Commit

Permalink
PyQ Release 4.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
pyq-enlnt committed Jul 17, 2017
1 parent 73f3f75 commit 506362b
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 12 deletions.
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
try:
from pyq import __version__
except ImportError:
__version__ = '4.0.2'
__version__ = '4.0.3'


# If extensions (or modules to document with autodoc) are in another directory,
Expand Down
4 changes: 2 additions & 2 deletions doc/install/centos32on64.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ We are going to install Python 3.6 into ``/opt/python3.6.i686``:
$ sudo make install
$ unset CFLAGS LDFLAGS
Let's confirm we've got 32-bit Python on our 64-bit system:
Let's confirm we have a 32-bit Python on our 64-bit system:

.. code-block:: bash
Expand Down Expand Up @@ -73,7 +73,7 @@ Create a virtual environment:
$ /opt/python3.6.i686/bin/python3.6 ${HOME}/Build/virtualenv-15.1.0/virtualenv.py \
${HOME}/Work/pyq3
Enter the virtual environment we've just created, confirm we've got 32-bit Python in it:
Enter the virtual environment that we created, confirm that we have a 32-bit Python there:

.. code-block:: bash
Expand Down
2 changes: 1 addition & 1 deletion doc/manual/py-from-q.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ and called in q scripts.
Exporting Python functions to q
-------------------------------

As we've seen in the previous section, calling python by evaluating "p)"
As we have seen in the previous section, calling python by evaluating "p)"
expressions has several limitations. For tighter integration between q and
Python, pyq supports exporting Python functions to q. Once exported, python
functions appear in q as monadic functions that take a single argument that
Expand Down
6 changes: 3 additions & 3 deletions doc/manual/pyq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ Typed constructors are discussed in the next section.
Constructors and casts
----------------------

As we've seen in the previous chapter, it is often not necessary to construct :class:`~pyq.K`
As we have seen in the previous chapter, it is often not necessary to construct :class:`~pyq.K`
objects explicitly because they are automatically created whenever a Python object is passed
to a q function. This is done by passing the Python object to the default :class:`~pyq.K`
constructor.
Expand Down Expand Up @@ -1248,7 +1248,7 @@ the Fibonacci sequence
k('0 1 1 2 3 5 8 13 21 34 55')

and the ratios of consecutive Fibonacci numbers form the sequence of Golden Ratio
convergents that we've seen before:
convergents that we have seen before:

>>> q.ratios(_)
k('0 0w 1 2 1.5 1.666667 1.6 1.625 1.615385 1.619048 1.617647')
Expand All @@ -1257,7 +1257,7 @@ k('0 0w 1 2 1.5 1.666667 1.6 1.625 1.615385 1.619048 1.617647')
Each previous
^^^^^^^^^^^^^

In the previous section we've seen a function :func:`~pyq.K.ratios` that takes
In the previous section we have seen a function :func:`~pyq.K.ratios` that takes
a vector and produces the ratios of the adjacent elements. A similar function
called :func:`~pyq.K.deltas` produces the differences between the adjacent
elements:
Expand Down
25 changes: 25 additions & 0 deletions doc/whatsnew/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@
Version History
===============

`PyQ 4.0.3 <http://pyq.readthedocs.io/en/pyq-4.0.3/>`_
------------------------------------------------------

Released on 2017-07-17

Bug fixes:

- !551 - BUG #922: Allow large (> 2**31) integers in K._ktn().
- !546 - BUG #923 Fixed conversion of mixed lists.

Documentation:

- !547 - DOC: Minor documentation corrections



`PyQ 4.0.2 <http://pyq.readthedocs.io/en/pyq-4.0.2/>`_
------------------------------------------------------

Expand Down Expand Up @@ -181,6 +197,15 @@ Setup:



`PyQ 3.8.5 <http://pyq.readthedocs.io/en/pyq-3.8.5/>`_
------------------------------------------------------

Released on 2017-03-16

- !517 - #901: Provide a fallback for systems that lack CPU_COUNT.



`PyQ 3.8.4 <http://pyq.readthedocs.io/en/pyq-3.8.4/>`_
------------------------------------------------------

Expand Down
1 change: 1 addition & 0 deletions doc/words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,4 @@ Ubuntu
ptpython
Ctrl
pre
ktn
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
from platform import uname


VERSION = '4.0.2'
VERSION = '4.0.3'
IS_RELEASE = True
PYQ_SRC_DIR = os.path.join('src', 'pyq')
VERSION_FILE = os.path.join(PYQ_SRC_DIR, 'version.py')
Expand Down
2 changes: 1 addition & 1 deletion src/pyq/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ def _listtok(x):
if c is not None:
try:
return c(x)
except TypeError:
except (TypeError, ValueError):
pass
return K._from_sequence(x)
return K._ktn(0, 0)
Expand Down
9 changes: 7 additions & 2 deletions src/pyq/_k.c
Original file line number Diff line number Diff line change
Expand Up @@ -2389,10 +2389,15 @@ PyDoc_STRVAR(K_ktn_doc, "returns a K list");
static PyObject *
K_ktn(PyTypeObject * type, PyObject *args)
{
I t, n;
K x;

I t;
#if KXVER < 3
I n;
if (!PyArg_ParseTuple(args, "ii:K._ktn", &t, &n)) {
#else
J n;
if (!PyArg_ParseTuple(args, "iL:K._ktn", &t, &n)) {
#endif
return NULL;
}
x = ktn(t, n);
Expand Down
2 changes: 1 addition & 1 deletion src/pyq/tests/test_k.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def q(*args):


q("\\e 0") # disable q's debug on error
KXVER = int(q('.Q.k').inspect(b'f'))
KXVER = q('.Q.k').inspect(b'f')
if KXVER >= 3:
kguid = _k.K._kguid
UU = _k.K._UU
Expand Down
5 changes: 5 additions & 0 deletions src/pyq/tests/test_q.py
Original file line number Diff line number Diff line change
Expand Up @@ -1145,3 +1145,8 @@ def test_typed_from_mapping(q):
x = OrderedDict([('a', "x"), ('b', "y")])
assert K.string(x) == q('`a`b!(enlist"x";enlist"y")')
assert K.char(x) == q('`a`b!"xy"')


def test_issue_923(q):
assert K([0.0, '', 0]) == q('(0f;`;0)')
assert K([0, '', 0.0]) == q('(0;`;0f)')

0 comments on commit 506362b

Please sign in to comment.