From mikofski at berkeley.edu Wed Nov 6 14:18:31 2019 From: mikofski at berkeley.edu (Dr. Mark Alexander Mikofski PhD) Date: Wed, 6 Nov 2019 11:18:31 -0800 Subject: [SciPy-User] [ANN] pvfactors: a view-factor network model for bifacial PV by SunPower Message-ID: SunPower has just released the latest version of pvfactors (v1.3.0), a Python package for modeling the incident irradiance on bifacial photovoltaic (PV) using the network radiosity model. Bifacial PV are solar panels that can generate energy from both the front and back surfaces. PyPI: https://pypi.org/project/pvfactors/ GitHub: https://github.com/SunPower/pvfactors/releases Thanks SunPower! -- Mark Mikofski, PhD (2005) *Fiat Lux* -------------- next part -------------- An HTML attachment was scrubbed... URL: From me at iyanmv.com Thu Nov 7 07:11:55 2019 From: me at iyanmv.com (=?ISO-8859-1?Q?Iy=E1n_M=E9ndez?= Veiga) Date: Thu, 07 Nov 2019 13:11:55 +0100 Subject: [SciPy-User] Scipy and information theory Message-ID: <20976252.W2eyRVhfPJ@theotp40> Hi, I discovered recently some interesting functions in scipy that are useful in the context of information theory. In particular, xlogy, entr and rel_entr. However, for the calculations I want to do I am interested in using log2 instead of natural logarithm. I was expecting to be able to choose the base with this functions but it is not possible. Do you think it would be a nice feature to add to scipy? Maybe not for a general base, but at least the bases that are available in numpy (log2, log10). The workaround I am using with xlogy(x,y) (and similar functions) is multiplying x array by log2(e). Best wishes, Iy?n From ralf.gommers at gmail.com Fri Nov 8 10:54:32 2019 From: ralf.gommers at gmail.com (Ralf Gommers) Date: Fri, 8 Nov 2019 10:54:32 -0500 Subject: [SciPy-User] Scipy and information theory In-Reply-To: <20976252.W2eyRVhfPJ@theotp40> References: <20976252.W2eyRVhfPJ@theotp40> Message-ID: Hi Iy?n, On Thu, Nov 7, 2019 at 12:21 PM Iy?n M?ndez Veiga wrote: > Hi, > > I discovered recently some interesting functions in scipy that are useful > in > the context of information theory. In particular, xlogy, entr and > rel_entr. > However, for the calculations I want to do I am interested in using log2 > instead of natural logarithm. I was expecting to be able to choose the > base > with this functions but it is not possible. > > Do you think it would be a nice feature to add to scipy? Maybe not for a > general base, but at least the bases that are available in numpy (log2, > log10). > This does sound like a useful feature to add to these functions. I'm not sure how easy it is to add a keyword to those functions though, since the ufunc machinery may be limited in flexibility. Maybe someone else can say straight away. If you want to start looking into implementing this, here are some notes of where to start: http://scipy.github.io/devdocs/dev/core-dev/index.html#scipy-special Cheers, Ralf > The workaround I am using with xlogy(x,y) (and similar functions) is > multiplying x array by log2(e). > > Best wishes, > Iy?n > > > _______________________________________________ > SciPy-User mailing list > SciPy-User at python.org > https://mail.python.org/mailman/listinfo/scipy-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rlucente at pipeline.com Fri Nov 8 12:10:48 2019 From: rlucente at pipeline.com (Robert Lucente - Pipeline.Com) Date: Fri, 8 Nov 2019 12:10:48 -0500 Subject: [SciPy-User] Scipy and information theory Message-ID: <061801d59657$77e141f0$67a3c5d0$@pipeline.com> > interested in using log2 instead of natural logarithm. I was expecting to be able to choose the base with this functions but it is not possible Why not use Python's built in fcn? https://docs.python.org/3/library/math.html#math.log math.log(x[, base]) With one argument, return the natural logarithm of x (to base e). With two arguments, return the logarithm of x to the given base, calculated as log(x)/log(base). -----Original Message----- From: SciPy-User On Behalf Of scipy-user-request at python.org Sent: Friday, November 8, 2019 12:00 PM To: scipy-user at python.org Subject: SciPy-User Digest, Vol 195, Issue 2 Send SciPy-User mailing list submissions to scipy-user at python.org To subscribe or unsubscribe via the World Wide Web, visit https://mail.python.org/mailman/listinfo/scipy-user or, via email, send a message with subject or body 'help' to scipy-user-request at python.org You can reach the person managing the list at scipy-user-owner at python.org When replying, please edit your Subject line so it is more specific than "Re: Contents of SciPy-User digest..." Today's Topics: 1. Scipy and information theory (Iy?n M?ndez Veiga) 2. Re: Scipy and information theory (Ralf Gommers) ---------------------------------------------------------------------- Message: 1 Date: Thu, 07 Nov 2019 13:11:55 +0100 From: Iy?n M?ndez Veiga To: scipy-user at python.org Subject: [SciPy-User] Scipy and information theory Message-ID: <20976252.W2eyRVhfPJ at theotp40> Content-Type: text/plain; charset="iso-8859-1" Hi, I discovered recently some interesting functions in scipy that are useful in the context of information theory. In particular, xlogy, entr and rel_entr. However, for the calculations I want to do I am interested in using log2 instead of natural logarithm. I was expecting to be able to choose the base with this functions but it is not possible. Do you think it would be a nice feature to add to scipy? Maybe not for a general base, but at least the bases that are available in numpy (log2, log10). The workaround I am using with xlogy(x,y) (and similar functions) is multiplying x array by log2(e). Best wishes, Iy?n ------------------------------ Message: 2 Date: Fri, 8 Nov 2019 10:54:32 -0500 From: Ralf Gommers To: SciPy Users List Subject: Re: [SciPy-User] Scipy and information theory Message-ID: Content-Type: text/plain; charset="utf-8" Hi Iy?n, On Thu, Nov 7, 2019 at 12:21 PM Iy?n M?ndez Veiga wrote: > Hi, > > I discovered recently some interesting functions in scipy that are > useful in the context of information theory. In particular, xlogy, > entr and rel_entr. > However, for the calculations I want to do I am interested in using > log2 instead of natural logarithm. I was expecting to be able to > choose the base with this functions but it is not possible. > > Do you think it would be a nice feature to add to scipy? Maybe not for > a general base, but at least the bases that are available in numpy > (log2, log10). > This does sound like a useful feature to add to these functions. I'm not sure how easy it is to add a keyword to those functions though, since the ufunc machinery may be limited in flexibility. Maybe someone else can say straight away. If you want to start looking into implementing this, here are some notes of where to start: http://scipy.github.io/devdocs/dev/core-dev/index.html#scipy-special Cheers, Ralf > The workaround I am using with xlogy(x,y) (and similar functions) is > multiplying x array by log2(e). > > Best wishes, > Iy?n > > > _______________________________________________ > SciPy-User mailing list > SciPy-User at python.org > https://mail.python.org/mailman/listinfo/scipy-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Subject: Digest Footer _______________________________________________ SciPy-User mailing list SciPy-User at python.org https://mail.python.org/mailman/listinfo/scipy-user ------------------------------ End of SciPy-User Digest, Vol 195, Issue 2 ****************************************** From avrahami.ben at gmail.com Sun Nov 10 04:45:54 2019 From: avrahami.ben at gmail.com (Ben Avrahami) Date: Sun, 10 Nov 2019 11:45:54 +0200 Subject: [SciPy-User] best way to get minimum and maximum support for generic random variable Message-ID: Hello, I'm trying to come up with a simple universal method to get the minimum and maximum values for any random variable (both rv_continuous and rv_discrete). The best I came up with was rv.interval(1) but that is both more obtuse than I'd like and error prone (as seen in the issue I opened: https://github.com/scipy/scipy/issues/11026), also, it's not exactly was the method is made for which makes me uneasy. Is there any better way to get the smallest and largest possible values for any rv? regards, Ben. -------------- next part -------------- An HTML attachment was scrubbed... URL: From rlucente at pipeline.com Fri Nov 8 12:13:32 2019 From: rlucente at pipeline.com (Robert Lucente - Pipeline.Com) Date: Fri, 8 Nov 2019 12:13:32 -0500 Subject: [SciPy-User] Scipy and information theory Message-ID: <061901d59657$d980dd80$8c829880$@pipeline.com> > interested in using log2 instead of natural logarithm. I was expecting > to be able to choose the base with this functions but it is not > possible Why not use Python's built in fcn? https://docs.python.org/3/library/math.html#math.log2 math.log2(x) Return the base-2 logarithm of x. This is usually more accurate than log(x, 2). New in version 3.3. -----Original Message----- From: Robert Lucente - Pipeline.Com Sent: Friday, November 8, 2019 12:11 PM To: 'scipy-user at python.org' Cc: Robert Gmail Backup 2 Lucente (robert.backup.2.lucente at gmail.com) Subject: Re: Scipy and information theory > interested in using log2 instead of natural logarithm. I was expecting > to be able to choose the base with this functions but it is not > possible Why not use Python's built in fcn? https://docs.python.org/3/library/math.html#math.log math.log(x[, base]) With one argument, return the natural logarithm of x (to base e). With two arguments, return the logarithm of x to the given base, calculated as log(x)/log(base). -----Original Message----- From: SciPy-User On Behalf Of scipy-user-request at python.org Sent: Friday, November 8, 2019 12:00 PM To: scipy-user at python.org Subject: SciPy-User Digest, Vol 195, Issue 2 Send SciPy-User mailing list submissions to scipy-user at python.org To subscribe or unsubscribe via the World Wide Web, visit https://mail.python.org/mailman/listinfo/scipy-user or, via email, send a message with subject or body 'help' to scipy-user-request at python.org You can reach the person managing the list at scipy-user-owner at python.org When replying, please edit your Subject line so it is more specific than "Re: Contents of SciPy-User digest..." Today's Topics: 1. Scipy and information theory (Iy?n M?ndez Veiga) 2. Re: Scipy and information theory (Ralf Gommers) ---------------------------------------------------------------------- Message: 1 Date: Thu, 07 Nov 2019 13:11:55 +0100 From: Iy?n M?ndez Veiga To: scipy-user at python.org Subject: [SciPy-User] Scipy and information theory Message-ID: <20976252.W2eyRVhfPJ at theotp40> Content-Type: text/plain; charset="iso-8859-1" Hi, I discovered recently some interesting functions in scipy that are useful in the context of information theory. In particular, xlogy, entr and rel_entr. However, for the calculations I want to do I am interested in using log2 instead of natural logarithm. I was expecting to be able to choose the base with this functions but it is not possible. Do you think it would be a nice feature to add to scipy? Maybe not for a general base, but at least the bases that are available in numpy (log2, log10). The workaround I am using with xlogy(x,y) (and similar functions) is multiplying x array by log2(e). Best wishes, Iy?n ------------------------------ Message: 2 Date: Fri, 8 Nov 2019 10:54:32 -0500 From: Ralf Gommers To: SciPy Users List Subject: Re: [SciPy-User] Scipy and information theory Message-ID: Content-Type: text/plain; charset="utf-8" Hi Iy?n, On Thu, Nov 7, 2019 at 12:21 PM Iy?n M?ndez Veiga wrote: > Hi, > > I discovered recently some interesting functions in scipy that are > useful in the context of information theory. In particular, xlogy, > entr and rel_entr. > However, for the calculations I want to do I am interested in using > log2 instead of natural logarithm. I was expecting to be able to > choose the base with this functions but it is not possible. > > Do you think it would be a nice feature to add to scipy? Maybe not for > a general base, but at least the bases that are available in numpy > (log2, log10). > This does sound like a useful feature to add to these functions. I'm not sure how easy it is to add a keyword to those functions though, since the ufunc machinery may be limited in flexibility. Maybe someone else can say straight away. If you want to start looking into implementing this, here are some notes of where to start: http://scipy.github.io/devdocs/dev/core-dev/index.html#scipy-special Cheers, Ralf > The workaround I am using with xlogy(x,y) (and similar functions) is > multiplying x array by log2(e). > > Best wishes, > Iy?n > > > _______________________________________________ > SciPy-User mailing list > SciPy-User at python.org > https://mail.python.org/mailman/listinfo/scipy-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Subject: Digest Footer _______________________________________________ SciPy-User mailing list SciPy-User at python.org https://mail.python.org/mailman/listinfo/scipy-user ------------------------------ End of SciPy-User Digest, Vol 195, Issue 2 ****************************************** From me at iyanmv.com Sun Nov 10 07:30:20 2019 From: me at iyanmv.com (=?ISO-8859-1?Q?Iy=E1n_M=E9ndez?= Veiga) Date: Sun, 10 Nov 2019 13:30:20 +0100 Subject: [SciPy-User] Scipy and information theory In-Reply-To: <061901d59657$d980dd80$8c829880$@pipeline.com> References: <061901d59657$d980dd80$8c829880$@pipeline.com> Message-ID: <9721637.vL8ZEpCK8U@master> El viernes, 8 de noviembre de 2019 18:13:32 (CET) Robert Lucente - Pipeline.Com escribi?: > Why not use Python's built in fcn? > > https://docs.python.org/3/library/math.html#math.log2 > > math.log2(x) Because I want to avoid long (and slow) for loops and take advantage of numpy/ scipy element wise operations. That is why I prefer numpy.log2(x) over math.log2(x). My x is a high dimension array, not a scalar. > This does sound like a useful feature to add to these functions. I'm not > sure how easy it is to add a keyword to those functions though, since the > ufunc machinery may be limited in flexibility. Maybe someone else can say > straight away. If you want to start looking into implementing this, here are > some notes of where to start: > http://scipy.github.io/devdocs/dev/core-dev/index.html#scipy-special Thanks Ralf, I'll have a look. Also waiting if someone else can say if it would be easy or hard to implement. Best wishes, Iy?n From rlucente at pipeline.com Sun Nov 10 10:00:42 2019 From: rlucente at pipeline.com (Robert Lucente - Pipeline.Com) Date: Sun, 10 Nov 2019 10:00:42 -0500 Subject: [SciPy-User] Scipy and information theory In-Reply-To: <9721637.vL8ZEpCK8U@master> References: <061901d59657$d980dd80$8c829880$@pipeline.com> <9721637.vL8ZEpCK8U@master> Message-ID: <08e201d597d7$9f6c5ee0$de451ca0$@pipeline.com> > Because I want to avoid long (and slow) for loops and take advantage of numpy/ scipy element wise operations I am embarrassed That was an amateur mistake on my part :-( -----Original Message----- From: SciPy-User On Behalf Of Iy?n M?ndez Veiga Sent: Sunday, November 10, 2019 7:30 AM To: SciPy Users List Subject: Re: [SciPy-User] Scipy and information theory El viernes, 8 de noviembre de 2019 18:13:32 (CET) Robert Lucente - Pipeline.Com escribi?: > Why not use Python's built in fcn? > > https://docs.python.org/3/library/math.html#math.log2 > > math.log2(x) Because I want to avoid long (and slow) for loops and take advantage of numpy/ scipy element wise operations. That is why I prefer numpy.log2(x) over math.log2(x). My x is a high dimension array, not a scalar. > This does sound like a useful feature to add to these functions. I'm > not sure how easy it is to add a keyword to those functions though, > since the ufunc machinery may be limited in flexibility. Maybe someone > else can say straight away. If you want to start looking into > implementing this, here are some notes of where to start: > http://scipy.github.io/devdocs/dev/core-dev/index.html#scipy-special Thanks Ralf, I'll have a look. Also waiting if someone else can say if it would be easy or hard to implement. Best wishes, Iy?n _______________________________________________ SciPy-User mailing list SciPy-User at python.org https://mail.python.org/mailman/listinfo/scipy-user From ralf.gommers at gmail.com Sun Nov 10 21:26:58 2019 From: ralf.gommers at gmail.com (Ralf Gommers) Date: Sun, 10 Nov 2019 18:26:58 -0800 Subject: [SciPy-User] Scipy and information theory In-Reply-To: <08e201d597d7$9f6c5ee0$de451ca0$@pipeline.com> References: <061901d59657$d980dd80$8c829880$@pipeline.com> <9721637.vL8ZEpCK8U@master> <08e201d597d7$9f6c5ee0$de451ca0$@pipeline.com> Message-ID: On Sun, Nov 10, 2019 at 5:25 PM Robert Lucente - Pipeline.Com < rlucente at pipeline.com> wrote: > > Because I want to avoid long (and slow) for loops and take advantage of > numpy/ scipy element wise operations > I am embarrassed > > That was an amateur mistake on my part :-( > > -----Original Message----- > From: SciPy-User On > Behalf Of Iy?n M?ndez Veiga > Sent: Sunday, November 10, 2019 7:30 AM > To: SciPy Users List > Subject: Re: [SciPy-User] Scipy and information theory > > El viernes, 8 de noviembre de 2019 18:13:32 (CET) Robert Lucente - > Pipeline.Com escribi?: > > Why not use Python's built in fcn? > > > > https://docs.python.org/3/library/math.html#math.log2 > > > > math.log2(x) > > Because I want to avoid long (and slow) for loops and take advantage of > numpy/ scipy element wise operations. That is why I prefer numpy.log2(x) > over math.log2(x). My x is a high dimension array, not a scalar. > > > This does sound like a useful feature to add to these functions. I'm > > not sure how easy it is to add a keyword to those functions though, > > since the ufunc machinery may be limited in flexibility. Maybe someone > > else can say straight away. If you want to start looking into > > implementing this, here are some notes of where to start: > > http://scipy.github.io/devdocs/dev/core-dev/index.html#scipy-special > > Thanks Ralf, I'll have a look. Also waiting if someone else can say if it > would be easy or hard to implement. > Right after I wrote that Josh just posted https://github.com/scipy/scipy/issues/11029#issuecomment-551968035, which states "to add a keyword argument ... and the current Cython special codegen can?t handle that automatically". So I think that confirms what I suspected: it's not really doable right now. Adding a new function is not justified; a Python wrapper could be but it's not great for performance - you could try that and keep the overhead for the current default behavior is low as possible, then report some benchmark result. That should help us decide. Probably best to open an issue or PR for that for further discussion. Cheers, Ralf -------------- next part -------------- An HTML attachment was scrubbed... URL: From charlesr.harris at gmail.com Sun Nov 10 21:32:41 2019 From: charlesr.harris at gmail.com (Charles R Harris) Date: Sun, 10 Nov 2019 19:32:41 -0700 Subject: [SciPy-User] NumPy 1.17.4 release. Message-ID: Hi All, On behalf of the NumPy team I am pleased to announce that NumPy 1.17.4 has been released. This is a bugfix release. The Python versions supported in this release are 3.5-3.8. Downstream developers should use Cython >= 0.29.13 for Python 3.8 support and OpenBLAS >= 3.7 to avoid wrong results on the Skylake architecture. The NumPy Wheels for this release can be downloaded from PyPI , source archives and release notes are available from Github . *Highlights* - Fixed `random.random_integers` biased generation of 8 and 16 bit integers. - Fixed `np.einsum` regression on Power9 and z/Linux. - Fixed histogram problem with signed integer arrays *Contributors* A total of 5 people contributed to this release. People with a "+" by their names contributed a patch for the first time. - Charles Harris - Chris Burr + - Matti Picus - Qiming Sun + - Warren Weckesser *Pull requests merged* A total of 8 pull requests were merged for this release. - gh-14758: BLD: Declare support for python 3.8 - gh-14781: BUG: Random: biased samples from integers() with 8 or 16 bit... - gh-14851: BUG: Fix `_ctypes` class circular reference. (gh-13808) - gh-14852: BLD: Add 'apt update' to shippable - gh-14855: BUG: Fix `np.einsum` errors on Power9 Linux and z/Linux - gh-14857: BUG: Fix histogram problem with signed integer arrays. - gh-14858: BLD: Prevent -flto from optimising long double representation... - gh-14866: MAINT: move buffer.h -> npy_buffer.h to avoid conflicts Cheers, Charles Harris -------------- next part -------------- An HTML attachment was scrubbed... URL: From me at iyanmv.com Wed Nov 13 08:00:23 2019 From: me at iyanmv.com (=?ISO-8859-1?Q?Iy=E1n_M=E9ndez?= Veiga) Date: Wed, 13 Nov 2019 14:00:23 +0100 Subject: [SciPy-User] numpy.longdouble and scipy status? Message-ID: <2242250.9r6hlQATtY@theotp40> Hi, How is the current status of SciPy when using np.longdouble (np.float128)? I am doing some calculations where I would like to get a resolution of 1e-18. np.float128 in my computer would be ok for that, at least based on the output of numpy.finfo(numpy.float128). However, some scipy functions always output numpy.float64 even though the input is numpy.float128. For example, try the following code: import numpy as np from scipy.linalg import expm I = np.eye(3, dtype=np.float128) A = expm(I) print(A.dtype) >> float128 >> float64 Is this behavious expected? I couldn't find anything on scipy docs, sorry if I overlooked. Thanks, Iy?n