<div dir="ltr">I'm still learning proper mailing list etiquette so I'm not sure if this is where I should respond. <div>But users just getting into debugging might also benefit from knowing this:</div><div><br>You can turn off optimizations when compiling numpy by passing CFLAGS to setup.py like so:</div><div><i><br>CFLAGS="-O0 -g3" python setup.py build_ext -i </i></div><div><i>*Assuming you have the source code and setup.py available <br><br></i></div><div>This will remove optimizations while compiling and will make it easier to see more variables.</div><div>That took me a long time to figure out so I wanted to share the knowledge <br><br>Thanks!</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Dec 28, 2020 at 10:38 PM <<a href="mailto:numpy-discussion-request@python.org">numpy-discussion-request@python.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Send NumPy-Discussion mailing list submissions to<br>
<a href="mailto:numpy-discussion@python.org" target="_blank">numpy-discussion@python.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
<a href="https://mail.python.org/mailman/listinfo/numpy-discussion" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/numpy-discussion</a><br>
or, via email, send a message with subject or body 'help' to<br>
<a href="mailto:numpy-discussion-request@python.org" target="_blank">numpy-discussion-request@python.org</a><br>
<br>
You can reach the person managing the list at<br>
<a href="mailto:numpy-discussion-owner@python.org" target="_blank">numpy-discussion-owner@python.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of NumPy-Discussion digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
1. Re: Addition of new distributions: Polya-gamma (Robert Kern)<br>
2. Help needed GDB (Amardeep Singh)<br>
3. ANN: NumExpr 2.7.2 (Robert McLeod)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Mon, 28 Dec 2020 13:06:33 -0500<br>
From: Robert Kern <<a href="mailto:robert.kern@gmail.com" target="_blank">robert.kern@gmail.com</a>><br>
To: Discussion of Numerical Python <<a href="mailto:numpy-discussion@python.org" target="_blank">numpy-discussion@python.org</a>><br>
Subject: Re: [Numpy-discussion] Addition of new distributions:<br>
Polya-gamma<br>
Message-ID:<br>
<<a href="mailto:CAF6FJivqpLsXqvyUQcAUL67VHQw0viQWTry1%2BL1pq4GipfDdhw@mail.gmail.com" target="_blank">CAF6FJivqpLsXqvyUQcAUL67VHQw0viQWTry1+L1pq4GipfDdhw@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
My view is that we will not add more non-uniform distribution (i.e. "named"<br>
statistical probability distributions like Polya-Gamma) methods to<br>
`Generator`. I think that we might add a couple more methods to handle some<br>
more fundamental issues (like sampling from the unit interval with control<br>
over whether each boundary is open or closed, maybe one more variation on<br>
shuffling) that helps write randomized algorithms. Now that we have the C<br>
and Cython APIs which allow one to implement non-uniform distributions in<br>
other packages, we strongly encourage that.<br>
<br>
As I commented on the linked PR, `scipy.stats` would be a reasonable place<br>
for a Polya-Gamma sampling function, even if it's not feasible to implement<br>
an `rv_continuous` class for it. You have convinced me that the nature of<br>
the Polya-Gamma distribution warrants this. The only issue is that scipy<br>
still depends on a pre-`Generator` version of numpy. So I recommend<br>
implementing this function in your own package with an eye towards<br>
contributing it to scipy later.<br>
<br>
On Sun, Dec 27, 2020 at 6:05 AM Zolisa Bleki <<a href="mailto:BLKZOL001@myuct.ac.za" target="_blank">BLKZOL001@myuct.ac.za</a>> wrote:<br>
<br>
> Hi All,<br>
><br>
> I would like to know if Numpy accepts addition of new distributions since<br>
> the implementation of the Generator interface. If so, what is the criteria<br>
> for a particular distribution to be accepted? The reason why i'm asking is<br>
> because I would like to propose adding the Polya-gamma distribution to<br>
> numpy, for the following reasons:<br>
><br>
> 1) Polya-gamma random variables are commonly used as auxiliary variables<br>
> during data augmentation in Bayesian sampling algorithms, which have<br>
> wide-spread usage in Statistics and recently, Machine learning.<br>
> 2) Since this distribution is mostly useful for random sampling, it since<br>
> appropriate to have it in numpy and not projects like scipy [1].<br>
> 3) The only python/C++ implementation of the sampler available is licensed<br>
> under GPLv3 which I believe limits copying into packages that choose to use<br>
> a different license [2].<br>
> 4) Numpy's random API makes adding the distribution painless.<br>
><br>
> I have done preliminary work on this by implementing the distribution<br>
> sampler as decribed in [3]; see:<br>
> <a href="https://github.com/numpy/numpy/compare/master...zoj613:polyagamma" rel="noreferrer" target="_blank">https://github.com/numpy/numpy/compare/master...zoj613:polyagamma</a> .<br>
> There is a more efficient sampling algorithm described in a later paper<br>
> [4], but I chose not to start with that one unless I know it is worth<br>
> investing time in.<br>
><br>
> I would appreciate your thoughts on this proposal.<br>
><br>
> Regards,<br>
> Zolisa<br>
><br>
><br>
> Refs:<br>
> [1] <a href="https://github.com/scipy/scipy/issues/11009" rel="noreferrer" target="_blank">https://github.com/scipy/scipy/issues/11009</a><br>
> [2] <a href="https://github.com/slinderman/pypolyagamma" rel="noreferrer" target="_blank">https://github.com/slinderman/pypolyagamma</a><br>
> [3] <a href="https://arxiv.org/pdf/1205.0310v1.pdf" rel="noreferrer" target="_blank">https://arxiv.org/pdf/1205.0310v1.pdf</a><br>
> [4] <a href="https://arxiv.org/pdf/1405.0506.pdf" rel="noreferrer" target="_blank">https://arxiv.org/pdf/1405.0506.pdf</a><br>
><br>
><br>
><br>
> Disclaimer - University of Cape Town This email is subject to UCT policies<br>
> and email disclaimer published on our website at<br>
> <a href="http://www.uct.ac.za/main/email-disclaimer" rel="noreferrer" target="_blank">http://www.uct.ac.za/main/email-disclaimer</a> or obtainable from +27 21 650<br>
> 9111. If this email is not related to the business of UCT, it is sent by<br>
> the sender in an individual capacity. Please report security incidents or<br>
> abuse via <a href="https://csirt.uct.ac.za/page/report-an-incident.php" rel="noreferrer" target="_blank">https://csirt.uct.ac.za/page/report-an-incident.php</a>.<br>
> _______________________________________________<br>
> NumPy-Discussion mailing list<br>
> <a href="mailto:NumPy-Discussion@python.org" target="_blank">NumPy-Discussion@python.org</a><br>
> <a href="https://mail.python.org/mailman/listinfo/numpy-discussion" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/numpy-discussion</a><br>
><br>
<br>
<br>
-- <br>
Robert Kern<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="https://mail.python.org/pipermail/numpy-discussion/attachments/20201228/f4bbd564/attachment-0001.html" rel="noreferrer" target="_blank">https://mail.python.org/pipermail/numpy-discussion/attachments/20201228/f4bbd564/attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Tue, 29 Dec 2020 13:55:03 +0800<br>
From: Amardeep Singh <<a href="mailto:amardeepjk@gmail.com" target="_blank">amardeepjk@gmail.com</a>><br>
To: <a href="mailto:numpy-discussion@python.org" target="_blank">numpy-discussion@python.org</a><br>
Subject: [Numpy-discussion] Help needed GDB<br>
Message-ID:<br>
<<a href="mailto:CAJmcdX6dgoh_FKdHKxQB1_GPLdYw3%2B0PMG_ne_T5BBhEzMmGmg@mail.gmail.com" target="_blank">CAJmcdX6dgoh_FKdHKxQB1_GPLdYw3+0PMG_ne_T5BBhEzMmGmg@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Hi All,<br>
<br>
I am trying to debug c code of numpy via gdb.Can someone help me with this?<br>
i am getting " Python scripting is not supported in this copy of GDB". How<br>
to install python supported gdb on win10?<br>
<br>
<br>
<a href="https://numpy.org/doc/stable/dev/development_environment.html" rel="noreferrer" target="_blank">https://numpy.org/doc/stable/dev/development_environment.html</a><br>
<br>
I am following the steps in the docs. machine is windows 10.<br>
<br>
Debugging<br>
<<a href="https://numpy.org/doc/stable/dev/development_environment.html#debugging" rel="noreferrer" target="_blank">https://numpy.org/doc/stable/dev/development_environment.html#debugging</a>><br>
<br>
Another frequently asked question is ?How do I debug C code inside NumPy??.<br>
First, ensure that you have gdb installed on your system with the Python<br>
extensions (often the default on Linux). You can see which version of<br>
Python is running inside gdb to verify your setup:<br>
<br>
(gdb) python>import<br>
sys>print(sys.version_info)>endsys.version_info(major=3, minor=7,<br>
micro=0, releaselevel='final', serial=0)<br>
<br>
<br>
<br>
<br>
$ gdb -v<br>
GNU gdb (GDB) 7.6.1<br>
This GDB was configured as "mingw32".<br>
<br>
$ gdb<br>
(gdb) python<br>
>import sys<br>
>print(sys.version_info)<br>
>end<br>
(gdb) Python scripting is not supported in this copy of GDB.<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="https://mail.python.org/pipermail/numpy-discussion/attachments/20201229/268f82ab/attachment-0001.html" rel="noreferrer" target="_blank">https://mail.python.org/pipermail/numpy-discussion/attachments/20201229/268f82ab/attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Mon, 28 Dec 2020 22:38:07 -0800<br>
From: Robert McLeod <<a href="mailto:robbmcleod@gmail.com" target="_blank">robbmcleod@gmail.com</a>><br>
To: <a href="mailto:python-announce-list@python.org" target="_blank">python-announce-list@python.org</a>, Discussion of Numerical Python<br>
<<a href="mailto:numpy-discussion@python.org" target="_blank">numpy-discussion@python.org</a>>, <a href="mailto:pydata@googlegroups.com" target="_blank">pydata@googlegroups.com</a><br>
Subject: [Numpy-discussion] ANN: NumExpr 2.7.2<br>
Message-ID:<br>
<<a href="mailto:CAEFUWWV0T8ACcZbS7N56zXtPZEBgMFVQQ7whjhgxVFttgO6DTQ@mail.gmail.com" target="_blank">CAEFUWWV0T8ACcZbS7N56zXtPZEBgMFVQQ7whjhgxVFttgO6DTQ@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
========================<br>
Announcing NumExpr 2.7.2<br>
========================<br>
<br>
Hi everyone,<br>
<br>
It's been awhile since the last update to NumExpr, mostly as the existing<br>
scientific<br>
Python tool chain for building wheels on PyPi became defunct and we have<br>
had to<br>
redevelop a new one based on `cibuildwheel` and GitHub Actions. This<br>
release also<br>
brings us support (and wheels for) Python 3.9.<br>
<br>
There have been a number of changes to enhance how NumExpr works when NumPy<br>
uses MKL as a backend.<br>
<br>
Project documentation is available at:<br>
<br>
<a href="http://numexpr.readthedocs.io/" rel="noreferrer" target="_blank">http://numexpr.readthedocs.io/</a><br>
<br>
Changes from 2.7.1 to 2.7.2<br>
---------------------------<br>
<br>
- Support for Python 2.7 and 3.5 is deprecated and will be discontinued<br>
when<br>
`cibuildwheels` and/or GitHub Actions no longer support these versions.<br>
- Wheels are now provided for Python 3.7, 3.5, 3.6, 3.7, 3.8, and 3.9 via<br>
GitHub Actions.<br>
- The block size is now exported into the namespace as<br>
`numexpr.__BLOCK_SIZE1__`<br>
as a read-only value.<br>
- If using MKL, the number of threads for VML is no longer forced to 1 on<br>
loading<br>
the module. Testing has shown that VML never runs in multi-threaded mode<br>
for<br>
the default BLOCKSIZE1 of 1024 elements, and forcing to 1 can have<br>
deleterious<br>
effects on NumPy functions when built with MKL. See issue #355 for<br>
details.<br>
- Use of `ndarray.tostring()` in tests has been switch to<br>
`ndarray.tobytes()`<br>
for future-proofing deprecation of `.tostring()`, if the version of NumPy<br>
is<br>
greater than 1.9.<br>
- Added a utility method `get_num_threads` that returns the (maximum)<br>
number of<br>
threads currently in use by the virtual machine. The functionality of<br>
`set_num_threads` whereby it returns the previous value has been<br>
deprecated<br>
and will be removed in 2.8.X.<br>
<br>
What's Numexpr?<br>
---------------<br>
<br>
Numexpr is a fast numerical expression evaluator for NumPy. With it,<br>
expressions that operate on arrays (like "3*a+4*b") are accelerated<br>
and use less memory than doing the same calculation in Python.<br>
<br>
It has multi-threaded capabilities, as well as support for Intel's<br>
MKL (Math Kernel Library), which allows an extremely fast evaluation<br>
of transcendental functions (sin, cos, tan, exp, log...) while<br>
squeezing the last drop of performance out of your multi-core<br>
processors. Look here for a some benchmarks of numexpr using MKL:<br>
<br>
<a href="https://github.com/pydata/numexpr/wiki/NumexprMKL" rel="noreferrer" target="_blank">https://github.com/pydata/numexpr/wiki/NumexprMKL</a><br>
<br>
Its only dependency is NumPy (MKL is optional), so it works well as an<br>
easy-to-deploy, easy-to-use, computational engine for projects that<br>
don't want to adopt other solutions requiring more heavy dependencies.<br>
<br>
Where I can find Numexpr?<br>
-------------------------<br>
<br>
The project is hosted at GitHub in:<br>
<br>
<a href="https://github.com/pydata/numexpr" rel="noreferrer" target="_blank">https://github.com/pydata/numexpr</a><br>
<br>
You can get the packages from PyPI as well (but not for RC releases):<br>
<br>
<a href="http://pypi.python.org/pypi/numexpr" rel="noreferrer" target="_blank">http://pypi.python.org/pypi/numexpr</a><br>
<br>
Documentation is hosted at:<br>
<br>
<a href="http://numexpr.readthedocs.io/en/latest/" rel="noreferrer" target="_blank">http://numexpr.readthedocs.io/en/latest/</a><br>
<br>
Share your experience<br>
---------------------<br>
<br>
Let us know of any bugs, suggestions, gripes, kudos, etc. you may<br>
have.<br>
<br>
Enjoy data!<br>
<br>
<br>
-- <br>
Robert McLeod<br>
<a href="mailto:robbmcleod@gmail.com" target="_blank">robbmcleod@gmail.com</a><br>
<a href="mailto:robert.mcleod@hitachi-hhtc.ca" target="_blank">robert.mcleod@hitachi-hhtc.ca</a><br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="https://mail.python.org/pipermail/numpy-discussion/attachments/20201228/f4240dab/attachment.html" rel="noreferrer" target="_blank">https://mail.python.org/pipermail/numpy-discussion/attachments/20201228/f4240dab/attachment.html</a>><br>
<br>
------------------------------<br>
<br>
Subject: Digest Footer<br>
<br>
_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@python.org" target="_blank">NumPy-Discussion@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/numpy-discussion" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/numpy-discussion</a><br>
<br>
<br>
------------------------------<br>
<br>
End of NumPy-Discussion Digest, Vol 171, Issue 39<br>
*************************************************<br>
</blockquote></div>