<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/python-packages/numpy.git/numpy/f2py/src, branch v1.17.0rc2</title>
<subtitle>github.com: numpy/numpy.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/numpy.git/'/>
<entry>
<title>MAINT: f2py: Add a cast to avoid a compiler warning.</title>
<updated>2019-04-05T18:59:32+00:00</updated>
<author>
<name>Warren Weckesser</name>
<email>warren.weckesser@gmail.com</email>
</author>
<published>2019-04-05T18:59:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/numpy.git/commit/?id=8fdacfc041bce4f63a4172d56da4520a3040b79d'/>
<id>8fdacfc041bce4f63a4172d56da4520a3040b79d</id>
<content type='text'>
The warning

    [...]/fortranobject.c:138:18: warning: comparison of integers of different signs: 'Py_ssize_t' (aka 'long') and 'unsigned long' [-Wsign-compare]
            if (size &lt; sizeof(notalloc)) {
                ~~~~ ^ ~~~~~~~~~~~~~~~~

occurs 17 times when scipy is built.  The change in this pull request casts
`size` to `size_t` before comparing it to `sizeof(...)`.  A previous check
has already eliminated the possibility that `size` is negative, so this cast
is safe.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The warning

    [...]/fortranobject.c:138:18: warning: comparison of integers of different signs: 'Py_ssize_t' (aka 'long') and 'unsigned long' [-Wsign-compare]
            if (size &lt; sizeof(notalloc)) {
                ~~~~ ^ ~~~~~~~~~~~~~~~~

occurs 17 times when scipy is built.  The change in this pull request casts
`size` to `size_t` before comparing it to `sizeof(...)`.  A previous check
has already eliminated the possibility that `size` is negative, so this cast
is safe.
</pre>
</div>
</content>
</entry>
<entry>
<title>MAINT: removed unused vars in f2py test code</title>
<updated>2018-10-29T21:40:20+00:00</updated>
<author>
<name>Tyler Reddy</name>
<email>tyler.je.reddy@gmail.com</email>
</author>
<published>2018-10-29T21:40:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/numpy.git/commit/?id=4e98265768888417018b442d47b9fdfffe13850f'/>
<id>4e98265768888417018b442d47b9fdfffe13850f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>MAINT: Misc. typos (#11005)</title>
<updated>2018-05-01T04:28:18+00:00</updated>
<author>
<name>luzpaz</name>
<email>luzpaz@users.noreply.github.com</email>
</author>
<published>2018-05-01T04:28:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/numpy.git/commit/?id=820765d762513510a8e46f108e8bc8b366127f8f'/>
<id>820765d762513510a8e46f108e8bc8b366127f8f</id>
<content type='text'>
User- and non-user-facing typos.

Some source typos fixes as well.

Found via `codespell`.

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
User- and non-user-facing typos.

Some source typos fixes as well.

Found via `codespell`.

</pre>
</div>
</content>
</entry>
<entry>
<title>MAINT: Fixed C++ guard in f2py test.</title>
<updated>2018-03-09T18:58:02+00:00</updated>
<author>
<name>siavashserver</name>
<email>siavashserver@gmail.com</email>
</author>
<published>2018-03-09T18:58:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/numpy.git/commit/?id=b7461391c6917f0d9b016b62867ef4594a192c8b'/>
<id>b7461391c6917f0d9b016b62867ef4594a192c8b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>MAINT: Hard tab and whitespace cleanup.</title>
<updated>2018-03-08T22:28:40+00:00</updated>
<author>
<name>Charles Harris</name>
<email>charlesr.harris@gmail.com</email>
</author>
<published>2018-03-08T20:20:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/numpy.git/commit/?id=27b8e54598a325b53fc73b2017ef5e2272f3e5f4'/>
<id>27b8e54598a325b53fc73b2017ef5e2272f3e5f4</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>DOC: fix minor typos</title>
<updated>2017-12-13T00:09:07+00:00</updated>
<author>
<name>Unknown</name>
<email>kunda@scribus.net</email>
</author>
<published>2017-12-13T00:08:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/numpy.git/commit/?id=de100beb4b53833f817d4ba9c6d940e4cff96d43'/>
<id>de100beb4b53833f817d4ba9c6d940e4cff96d43</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>f2py: rename internal function</title>
<updated>2017-08-28T14:38:19+00:00</updated>
<author>
<name>Nico Schlömer</name>
<email>nico.schloemer@gmail.com</email>
</author>
<published>2017-08-28T14:38:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/numpy.git/commit/?id=ebe630aa8c8f397b156751facb9058009a912e74'/>
<id>ebe630aa8c8f397b156751facb9058009a912e74</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>f2py: allow Fortran arrays of dimension 0</title>
<updated>2017-08-28T08:40:51+00:00</updated>
<author>
<name>Nico Schlömer</name>
<email>nico.schloemer@gmail.com</email>
</author>
<published>2017-08-28T08:40:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/numpy.git/commit/?id=df7340694bac9452359e80e68dc43f0f4e1c1b8d'/>
<id>df7340694bac9452359e80e68dc43f0f4e1c1b8d</id>
<content type='text'>
Up until now, f2py throw an error when arrays were declared which had
dimension of length 0. This, however, is a perfectly legal case, and in
fact occurs frequently in the context of linear algrebra. This bug was
discovered, for example, in an interface that does matrix
tridiagonalization. If the matrix is 1x1, the super- and subdiagonal are
of length 0.

Note that negative dimensions continue to produce errors although
Fortran also allows this (it always allocates to size max(0, n)).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Up until now, f2py throw an error when arrays were declared which had
dimension of length 0. This, however, is a perfectly legal case, and in
fact occurs frequently in the context of linear algrebra. This bug was
discovered, for example, in an interface that does matrix
tridiagonalization. If the matrix is 1x1, the super- and subdiagonal are
of length 0.

Note that negative dimensions continue to produce errors although
Fortran also allows this (it always allocates to size max(0, n)).
</pre>
</div>
</content>
</entry>
<entry>
<title>BUG: f2py: Convert some error messages printed to stderr to exceptions.</title>
<updated>2017-08-26T07:52:52+00:00</updated>
<author>
<name>Warren Weckesser</name>
<email>warren.weckesser@gmail.com</email>
</author>
<published>2017-06-27T04:25:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/numpy.git/commit/?id=1f1e8265af27e7f602a0428acf06c8201ebef915'/>
<id>1f1e8265af27e7f602a0428acf06c8201ebef915</id>
<content type='text'>
In f2py/src/fortranobject.c, the function `check_and_fix_dimensions` does
pretty much what it says on the tin:
    /*
      This function fills in blanks (that are -1\'s) in dims list using
      the dimensions from arr. It also checks that non-blank dims will
      match with the corresponding values in arr dimensions.
    */
There are several error conditions detected by the function.  In the code
before this change, when the function detected such an error, it would
print a message to stderr and return 1.

In this change, when an error is detected in `check_and_fix_dimensions`,
an exception is set.

This new feature of `check_and_fix_dimensions` is used in three places
in the function `array_from_pyobj()`.
In each case, there was an old comment of the form:
    /* XXX: set exception */
In this change, the exception is now set in `check_and_fix_dimensions()`,
so those comments have been removed.

For some error conditions, the new code changes the exception that is
raised.  For example, here's a scipy test before this change:

```
In [5]: from scipy.linalg import _fblas as fblas

In [6]: a = np.array([[1., 0.], [0., -2.], [2., 3.]])

In [7]: b = np.array([[0., 1.], [1., 0.], [0, 1.]])

In [8]: fblas.dsyr2k(a=a, b=b, alpha=1.0, c=np.zeros((15, 8)))
0-th dimension must be fixed to 3 but got 15
---------------------------------------------------------------------------
error                                     Traceback (most recent call last)
&lt;ipython-input-8-bc4d51f8d016&gt; in &lt;module&gt;()
----&gt; 1 f(a=a, b=b, alpha=1.0, c=np.zeros((15, 8)))

error: failed in converting 2nd keyword `c' of _fblas.dsyr2k to C/Fortran array
```

After this change, we get:

```
In [2]: from scipy.linalg import _fblas as fblas

In [3]: a = np.array([[1., 0.], [0., -2.], [2., 3.]])

In [4]: b = np.array([[0., 1.], [1., 0.], [0, 1.]])

In [5]: fblas.dsyr2k(a=a, b=b, alpha=1.0, c=np.zeros((15, 8)))
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
&lt;ipython-input-6-bc4d51f8d016&gt; in &lt;module&gt;()
----&gt; 1 f(a=a, b=b, alpha=1.0, c=np.zeros((15, 8)))

ValueError: 0-th dimension must be fixed to 3 but got 15
```

The spurious print has been changed to the exception message, but some
potentially useful information in the old exception message has been
lost.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In f2py/src/fortranobject.c, the function `check_and_fix_dimensions` does
pretty much what it says on the tin:
    /*
      This function fills in blanks (that are -1\'s) in dims list using
      the dimensions from arr. It also checks that non-blank dims will
      match with the corresponding values in arr dimensions.
    */
There are several error conditions detected by the function.  In the code
before this change, when the function detected such an error, it would
print a message to stderr and return 1.

In this change, when an error is detected in `check_and_fix_dimensions`,
an exception is set.

This new feature of `check_and_fix_dimensions` is used in three places
in the function `array_from_pyobj()`.
In each case, there was an old comment of the form:
    /* XXX: set exception */
In this change, the exception is now set in `check_and_fix_dimensions()`,
so those comments have been removed.

For some error conditions, the new code changes the exception that is
raised.  For example, here's a scipy test before this change:

```
In [5]: from scipy.linalg import _fblas as fblas

In [6]: a = np.array([[1., 0.], [0., -2.], [2., 3.]])

In [7]: b = np.array([[0., 1.], [1., 0.], [0, 1.]])

In [8]: fblas.dsyr2k(a=a, b=b, alpha=1.0, c=np.zeros((15, 8)))
0-th dimension must be fixed to 3 but got 15
---------------------------------------------------------------------------
error                                     Traceback (most recent call last)
&lt;ipython-input-8-bc4d51f8d016&gt; in &lt;module&gt;()
----&gt; 1 f(a=a, b=b, alpha=1.0, c=np.zeros((15, 8)))

error: failed in converting 2nd keyword `c' of _fblas.dsyr2k to C/Fortran array
```

After this change, we get:

```
In [2]: from scipy.linalg import _fblas as fblas

In [3]: a = np.array([[1., 0.], [0., -2.], [2., 3.]])

In [4]: b = np.array([[0., 1.], [1., 0.], [0, 1.]])

In [5]: fblas.dsyr2k(a=a, b=b, alpha=1.0, c=np.zeros((15, 8)))
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
&lt;ipython-input-6-bc4d51f8d016&gt; in &lt;module&gt;()
----&gt; 1 f(a=a, b=b, alpha=1.0, c=np.zeros((15, 8)))

ValueError: 0-th dimension must be fixed to 3 but got 15
```

The spurious print has been changed to the exception message, but some
potentially useful information in the old exception message has been
lost.
</pre>
</div>
</content>
</entry>
<entry>
<title>BUG: ')' is printed at the end pointer of the buffer in numpy.f2py.</title>
<updated>2017-07-05T15:36:23+00:00</updated>
<author>
<name>Bob Eldering</name>
<email>eldering@jive.eu</email>
</author>
<published>2017-07-05T15:36:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/numpy.git/commit/?id=c8ec7378b32f788d04a346c12aabb319b3627be7'/>
<id>c8ec7378b32f788d04a346c12aabb319b3627be7</id>
<content type='text'>
When building the __doc__ string for Fortran objects, the ')'
character, closing the dimensions list, is written 1 position
beyond the allowed buffer size, instead of the current pointer in
the buffer.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When building the __doc__ string for Fortran objects, the ')'
character, closing the dimensions list, is written 1 position
beyond the allowed buffer size, instead of the current pointer in
the buffer.
</pre>
</div>
</content>
</entry>
</feed>
