From sebastian at sipsolutions.net Mon Jul 3 11:22:22 2017 From: sebastian at sipsolutions.net (Sebastian Berg) Date: Mon, 03 Jul 2017 17:22:22 +0200 Subject: [SciPy-User] Graph(?) simplification/optimization problem Message-ID: <1499095342.2486.3.camel@sipsolutions.net> Hi all, Just in case someone knows simple approaches to this type of problem: I am wondering about finding a nicer solution for something like a graph simplification problem. I have pairs of nodes which are developing/moving over time (pairs if there are two, but at each time step they form a circle with an even number, so calling them "n" and "p"): t=0 -n-------p- | | | | / \ | t=1 -n--p-n--p- \ / | | \/ | | t=2 ------n--p- Now the algorithm is supposed to "remove" the new p at t=1 which is there only for a short time and is assumed to be unimportant. Since you can only remove pairs, one of the "n" needs to be removed as well. In this case, deciding which "n" to also delete does not matter much (there are other heuristics to prefer one direction), but in general it can be non-trivial in my case. The overall goal would be to (also) maximize lifespans for individual "nodes", though. The exact optimization function would probably need some tuning, but I am wondering if there is a nice approach for this type of problem. I imagine that I can formulate it as a big integer programming problem, but it doesn't seem that straight forward on first glance. Currently I use some greedy strategies, but while it works fine, I am pretty sure that in some events it gets stuck and does not find the best solution. Anyway, just in case someone happens to know this type of problem and has a tip :). Regards, Sebastian -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 801 bytes Desc: This is a digitally signed message part URL: From charlesr.harris at gmail.com Thu Jul 6 22:20:18 2017 From: charlesr.harris at gmail.com (Charles R Harris) Date: Thu, 6 Jul 2017 20:20:18 -0600 Subject: [SciPy-User] NumPy 1.13.1 released Message-ID: Hi All, On behalf of the NumPy team, I am pleased to announce the release of NumPy 1.13.1. This is a bugfix release for problems found in 1.13.0. The major changes are: - fixes for the new memory overlap detection, - fixes for the new temporary elision capability, - reversion of the removal of the boolean binary ``-`` operator. It is recommended that users of 1.13.0 upgrade to 1.13.1. Wheels can be found on PyPI . Source tarballs, zipfiles, release notes, and the changelog are available on github . Note that the wheels for Python 3.6 are built against 3.6.1, hence will not work when used with 3.6.0 due to Python bug #29943 . The plan is to release NumPy 1.13.2 shortly after the release of Python 3.6.2 is out with a fix that problem. If you are using 3.6.0, the workaround is to upgrade to 3.6.1 or use an earlier Python version. *Pull requests merged*A total of 19 pull requests were merged for this release. * #9240 DOC: BLD: fix lots of Sphinx warnings/errors. * #9255 Revert "DEP: Raise TypeError for subtract(bool_, bool_)." * #9261 BUG: don't elide into readonly and updateifcopy temporaries for... * #9262 BUG: fix missing keyword rename for common block in numpy.f2py * #9263 BUG: handle resize of 0d array * #9267 DOC: update f2py front page and some doc build metadata. * #9299 BUG: Fix Intel compilation on Unix. * #9317 BUG: fix wrong ndim used in empty where check * #9319 BUG: Make extensions compilable with MinGW on Py2.7 * #9339 BUG: Prevent crash if ufunc doc string is null * #9340 BUG: umath: un-break ufunc where= when no out= is given * #9371 DOC: Add isnat/positive ufunc to documentation * #9372 BUG: Fix error in fromstring function from numpy.core.records... * #9373 BUG: ')' is printed at the end pointer of the buffer in numpy.f2py. * #9374 DOC: Create NumPy 1.13.1 release notes. * #9376 BUG: Prevent hang traversing ufunc userloop linked list * #9377 DOC: Use x1 and x2 in the heaviside docstring. * #9378 DOC: Add $PARAMS to the isnat docstring * #9379 DOC: Update the 1.13.1 release notes *Contributors* A total of 12 people contributed to this release. People with a "+" by their names contributed a patch for the first time. * Andras Deak + * Bob Eldering + * Charles Harris * Daniel Hrisca + * Eric Wieser * Joshua Leahy + * Julian Taylor * Michael Seifert * Pauli Virtanen * Ralf Gommers * Roland Kaufmann * Warren Weckesser -------------- next part -------------- An HTML attachment was scrubbed... URL: From erik.tollerud at gmail.com Sat Jul 8 00:28:46 2017 From: erik.tollerud at gmail.com (Erik Tollerud) Date: Sat, 8 Jul 2017 00:28:46 -0400 Subject: [SciPy-User] ANN: Astropy v2.0 released Message-ID: Dear colleagues, We are very happy to announce the v2.0 release of the Astropy package, a core Python package for Astronomy: http://www.astropy.org Astropy is a community-driven Python package intended to contain much of the core functionality and common tools needed for astronomy and astrophysics. New and improved major functionality in this release includes: * Most models now support parameters having units (i.e., being Quantity objects). * A new CCDData class that is directly useful for typical astronomical images and implements the NDData interface. * Coordinate frame objects can now carry proper motions and radial velocities, and will carry them through and transform them between frames. (This functionality is experimental and feedback is greatly desired.) * Many of the typical mixin columns for astropy tables can now be saved into ECSV files and fully round-tripped. * The fft and direct versions of the convolution algorithm in astropy.convolution are now more consistent and work better with typical use cases. * A variety of additions to the astropy.stats subpackage In addition, hundreds of smaller improvements and fixes have been made. An overview of the changes is provided at: http://docs.astropy.org/en/stable/whatsnew/2.0.html Note that the Astropy 2.x series will be the last versions of Astropy that will support Python 2.x. Future versions of Astropy will only support Python 3.x. Instructions for installing Astropy are provided on our website, and extensive documentation can be found at: http://docs.astropy.org If you make use of the Anaconda Python Distribution, you can update to Astropy v2.0 with: conda update astropy If you normally use pip, you can upgrade with: pip install astropy --upgrade Please report any issues, or request new features via our GitHub repository: https://github.com/astropy/astropy/issues Over 232 developers have contributed code to Astropy so far, and you can find out more about the team behind Astropy here: http://www.astropy.org/team.html Astropy v2.0 now repaces v1.0 as the long term support release, and will be supported until the end of 2019. The next major release of Astropy (scheduled for January 2018) will only support Python 3.x. So if you need to use Astropy in a very stable environment in Python 2.7, you should continue to use the 2.0.x series after 3.0.x is released. If you use Astropy directly for your work, or as a dependency to another package, please remember to include the following acknowledgment at the end of papers: ?This research made use of Astropy, a community-developed core Python package for Astronomy (Astropy Collaboration, 2013).? where (Astropy Collaboration, 2013) is a reference to the Astropy paper: http://dx.doi.org/10.1051/0004-6361/201322068 Please feel free to forward this announcement to anyone you think might be interested in this release! The announcement can also be found online at http://www.astropy.org/announcements/release-2.0.html. Special thanks to the coordinator for this release: Brigitta Sipocz. Erik Tollerud, Tom Robitaille, Kelle Cruz, and Tom Aldcroft on behalf of The Astropy Collaboration From ndbecker2 at gmail.com Fri Jul 21 14:54:50 2017 From: ndbecker2 at gmail.com (Neal Becker) Date: Fri, 21 Jul 2017 18:54:50 +0000 Subject: [SciPy-User] Any least-squares solver handles complex data/coefficients? Message-ID: Subject says it all -------------- next part -------------- An HTML attachment was scrubbed... URL: From newville at cars.uchicago.edu Fri Jul 21 14:59:27 2017 From: newville at cars.uchicago.edu (Matt Newville) Date: Fri, 21 Jul 2017 13:59:27 -0500 Subject: [SciPy-User] Any least-squares solver handles complex data/coefficients? In-Reply-To: References: Message-ID: On Fri, Jul 21, 2017 at 1:54 PM, Neal Becker wrote: > Subject says it all > > I believe the answer is No, all work with (double precision) real numbers. Of course, you can map 2 variables to real and imaginary parts of a complex number yourself. --Matt -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.kern at gmail.com Fri Jul 21 15:01:10 2017 From: robert.kern at gmail.com (Robert Kern) Date: Fri, 21 Jul 2017 12:01:10 -0700 Subject: [SciPy-User] Any least-squares solver handles complex data/coefficients? In-Reply-To: References: Message-ID: On Fri, Jul 21, 2017 at 11:54 AM, Neal Becker wrote: > > Subject says it all Not quite. Linear or nonlinear? If linear, then np.linalg.lstsq() works with complex matrices and vectors just fine. If nonlinear, then no, you will have to convert the vector of real parameters to the complex parameters to pass through your model code. -- Robert Kern -------------- next part -------------- An HTML attachment was scrubbed... URL: From austin.tobin at gmail.com Wed Jul 26 05:52:34 2017 From: austin.tobin at gmail.com (Austin Tobin) Date: Wed, 26 Jul 2017 10:52:34 +0100 Subject: [SciPy-User] Understanding parameters of scipy.special Mathieu_cem function etc. Message-ID: I am trying to relate the Mathieu equation found in Wikipedia Mathieu Equation to the one implemented in scipy.special. In Wikipedia there are 3 inputs, a,q and the parameter along which the integration proceeds. mathieu_cem takes three inputs, an order (integer), a characteristic parameter and the the parameter along which the integration proceeds in degrees. I am trying to relate a and q to the order and characteristic parameter. If it helps I am trying to simulate a quadrupole mass spectrometer with a and q being trapping parameters. Regards, Austin -------------- next part -------------- An HTML attachment was scrubbed... URL: From markbak at gmail.com Wed Jul 26 12:28:27 2017 From: markbak at gmail.com (Mark Bakker) Date: Wed, 26 Jul 2017 18:28:27 +0200 Subject: [SciPy-User] Understanding parameters of scipy.special Mathieu_cem function etc. Message-ID: > From: Austin Tobin > To: scipy-user at python.org > Subject: [SciPy-User] Understanding parameters of scipy.special > Mathieu_cem function etc. > Message-ID: > gmail.com> > Content-Type: text/plain; charset="utf-8" > > I am trying to relate the Mathieu equation found in Wikipedia Mathieu > Equation to the one > implemented in scipy.special. In Wikipedia there are 3 inputs, a,q and the > parameter along which the integration proceeds. > > mathieu_cem takes three inputs, an order (integer), a characteristic > parameter and the the parameter along which the integration proceeds in > degrees. I am trying to relate a and q to the order and characteristic > parameter. > > If it helps I am trying to simulate a quadrupole mass spectrometer with a > and q being trapping parameters. > Regards, > Austin > > The wikipedia link is broken. Could you fix that and maybe post some numbers that you are expecting? I am pretty sure the q is the characteristic number, the degrees are the local elliptic coordinates and the order is, well, the order of the function. -------------- next part -------------- An HTML attachment was scrubbed... URL: From warren.weckesser at gmail.com Wed Jul 26 15:36:12 2017 From: warren.weckesser at gmail.com (Warren Weckesser) Date: Wed, 26 Jul 2017 15:36:12 -0400 Subject: [SciPy-User] Understanding parameters of scipy.special Mathieu_cem function etc. In-Reply-To: References: Message-ID: On Wed, Jul 26, 2017 at 5:52 AM, Austin Tobin wrote: > I am trying to relate the Mathieu equation found in Wikipedia Mathieu > Equation to the one > implemented in scipy.special. In Wikipedia there are 3 inputs, a,q and the > parameter along which the integration proceeds. > > mathieu_cem takes three inputs, an order (integer), a characteristic > parameter and the the parameter along which the integration proceeds in > degrees. I am trying to relate a and q to the order and characteristic > parameter. > In the Mathieu equation, 'a' is an arbitrary parameter. However, for a given 'q', there is only a discrete set of values of 'a' for which the equation has even periodic solutions. Call these a_0(q), a_1(q), a_2(q), etc. 'mathieu_a(m, q)' computes a_m(q), and 'mathieu_cem(m, q, x)' is the even periodic solution associated with a_m(q). Warren If it helps I am trying to simulate a quadrupole mass spectrometer with a > and q being trapping parameters. > Regards, > Austin > > _______________________________________________ > 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 austin.tobin at gmail.com Thu Jul 27 12:51:44 2017 From: austin.tobin at gmail.com (Austin Tobin) Date: Thu, 27 Jul 2017 17:51:44 +0100 Subject: [SciPy-User] Understanding parameters of scipy.special Mathieu_cem function etc. In-Reply-To: References: Message-ID: Mark, Corrected link wikipedia Mathieu_function Unfortunately I do not know exactly what I am looking for. I am trying to achieve something like what was done in this paper . At least starting with getting the trajectories. Warren, I have found that "a" is the characteristic number and "q" is the characteristic parameter. While it makes perfect sense that the function is periodic over a certain range of values. I will have to go further to apply this function to my problem, maybe I just don't have the mathematics to make the connections. Regards, Austin Tobin On Wed, Jul 26, 2017 at 8:36 PM, Warren Weckesser < warren.weckesser at gmail.com> wrote: > > > On Wed, Jul 26, 2017 at 5:52 AM, Austin Tobin > wrote: > >> I am trying to relate the Mathieu equation found in Wikipedia Mathieu >> Equation to the one >> implemented in scipy.special. In Wikipedia there are 3 inputs, a,q and the >> parameter along which the integration proceeds. >> >> mathieu_cem takes three inputs, an order (integer), a characteristic >> parameter and the the parameter along which the integration proceeds in >> degrees. I am trying to relate a and q to the order and characteristic >> parameter. >> > > In the Mathieu equation, 'a' is an arbitrary parameter. However, for a > given 'q', there is only a discrete set of values of 'a' for which the > equation has even periodic solutions. Call these a_0(q), a_1(q), a_2(q), > etc. 'mathieu_a(m, q)' computes a_m(q), and 'mathieu_cem(m, q, x)' is the > even periodic solution associated with a_m(q). > > Warren > > > If it helps I am trying to simulate a quadrupole mass spectrometer with a >> and q being trapping parameters. >> Regards, >> Austin >> >> _______________________________________________ >> SciPy-User mailing list >> SciPy-User at python.org >> https://mail.python.org/mailman/listinfo/scipy-user >> >> > > _______________________________________________ > 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: