Re: [Numpy-discussion] f2py, numpy.distutils and multiple Fortran source files

2015-12-05 Thread David Verelst
Thanks a lot for providing the example Sturla, that is exactly what we are
looking for!

On 4 December 2015 at 11:34, Sturla Molden  wrote:

> On 03/12/15 22:07, David Verelst wrote:
>
> Can this workflow be incorporated into |setuptools|/|numpy.distutils|?
>> Something along the lines as:
>>
>
> Take a look at what SciPy does.
>
>
> https://github.com/scipy/scipy/blob/81c096001974f0b5efe29ec83b54f725cc681540/scipy/fftpack/setup.py
>
> Multiple Fortran files are compiled into a static library using
> "add_library", which is subsequently linked to the extension module.
>
>
> Sturla
>
>
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> https://mail.scipy.org/mailman/listinfo/numpy-discussion
>
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] f2py, numpy.distutils and multiple Fortran source files

2015-12-03 Thread David Verelst
Hi,

For the wafo [1] package we are trying to include the extension compilation
process in setup.py [2] by using setuptools and numpy.distutils [3]. Some
of the extensions have one Fortran interface source file, but it depends on
several other Fortran sources (modules). The manual compilation process
would go as follows:

gfortran -fPIC -c source_01.f
gfortran -fPIC -c source_02.f
f2py -m module_name -c source_01.o source_02.o source_interface.f

Can this workflow be incorporated into setuptools/numpy.distutils?
Something along the lines as:

from numpy.distutils.core import setup, Extension
ext = Extension('module.name',
   depends=['source_01.f', 'source_02.f'],
   sources=['source_interface.f'])

(note that the above does not work)

[1] https://github.com/wafo-project/pywafo
[2] https://github.com/wafo-project/pywafo/blob/pipinstall/setup.py
[3] http://docs.scipy.org/doc/numpy/reference/distutils.html

Regards,
David
​
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] future of f2py and Fortran90+

2015-12-03 Thread David Verelst
f90wrap [1] extends the functionality of f2py, and can automatically
generate sensible wrappers for certain cases.
[1] https://github.com/jameskermode/f90wrap

On 15 July 2015 at 03:45, Sturla Molden  wrote:

> Eric Firing  wrote:
>
> > I'm curious: has anyone been looking into what it would take to enable
> > f2py to handle modern Fortran in general?  And into prospects for
> > getting such an effort funded?
>
> No need. Use Cython and Fortran 2003 ISO C bindings. That is the only
> portable way to interop between Fortran and C (including CPython) anyway.
>
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] dynamically choosing atlas libraries

2013-04-06 Thread David Verelst
Hi,

Not a developer here, but I was under the impression that you can only use
the BLAS/LAPACK libraries that where chosen at build time?

As a side note: I've read [1] that OpenBLAS on some systems could perform
quite well compared to ATLAS, I used some simple benchmarks [2] and noticed
that on my system (Intel Core2 Duo P9700) there was also a big performance
gain. I build standard LAPACK against OpenBLAS. OpenBlas has been mentioned
a few times in the last months on this list too.

[1]
http://www.der-schnorz.de/2012/06/optimized-linear-algebra-and-numpyscipy/
[2]
https://dpinte.wordpress.com/2010/01/15/numpy-performance-improvement-with-the-mkl/


On 5 April 2013 19:08, Edward Walter  wrote:

> Hello List,
>
> We're standing up a new computational cluster and going through the
> steps of building Numpy etc.  We would like to be able to install
> multiple versions of ATLAS (with different build settings / tunings /
> etc) and have Numpy load the shared Atlas libraries dynamically based on
> the LD_LIBRARY_PATH.
>
> It's not clear to me how to do this given that the library path is hard
> coded in Numpy's site.cfg.  It seems like other people have gotten this
> working though (i.e. RHEL/Centos with their collection of Atlas versions
> {atlas, atlas-sse3, etc}).  Does anyone have any pointers on this?
>
> Thanks much.
>
> -Ed Walter
> Carnegie Mellon University
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Numpy 1.5.1/1.6.1 doesn't build doc with sphinx 1.1.2

2012-02-22 Thread David Verelst
Note sure if this already has been discussed, but it seems that latest 
Sphinx, 1.2predev-20120222 directly from their Hg repository, does not 
have this problem any more. While 1.2 failed to build the documentation 
on my end, 1.2predev delivered a result.

Regards,
David

On 24/11/11 15:31, Pauli Virtanen wrote:
> 24.11.2011 15:22, Sandro Tosi kirjoitti:
> [clip]
>> The full log of the debian package build is at:
>> http://people.debian.org/~jwilk/tmp/python-numpy_1.6.1-3_i386.build
>>
>> attached is the file left in /tmp by sphinx for the error.
>>
>> Could you please give it a look?
> Seems like some sort of a Sphinx bug (rather than having to do with the
> Sphinx extensions Numpy uses). It appears it doesn't like having a
> `glossary::` specified in a docstring used in `automodule::`. Or,
> alternatively, there's something wrong with the formatting in the file
> `numpy/doc/glossary.py`.
>
> Workarounds: copy-paste the glossary list from `glossary.py` to
> `doc/source/glossary.txt` in place of `automodule:: numpy.doc.glossary`
>
> If that doesn't help, then something in the formatting of the glossary
> list that makes Sphinx to choke (and it's certainly then a Sphinx bug).
>

___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] fast method to to count a particular value in a large matrix

2012-02-05 Thread David Verelst
Just out of curiosity, what speed-up factor did you achieve?

Regards,
David

On 04/02/12 22:20, Naresh wrote:
> Warren Weckesser  enthought.com>  writes:
>
>>
>> On Sat, Feb 4, 2012 at 2:35 PM, Benjamin Root  ou.edu>  wrote:
>>
>>
>> On Saturday, February 4, 2012, Naresh Pai  uark.edu>  wrote:>  I am
> somewhat new to Python (been coding with Matlab mostly). I am trying to
>>> simplify (and expedite) a piece of code that is currently a bottleneck in a
> larger
>>> code.>  I have a large array (7000 rows x 4500 columns) titled say, abc, and
> I am trying>  to find a fast method to count the number of instances of each
> unique value within>  it. All unique values are stored in a variable, say,
> unique_elem. My current code
>>
>>> is as follows:>  import numpy as np>  #allocate space for storing element
> count>  elem_count = zeros((len(unique_elem),1))>  #loop through and count 
> number
> of unique_elem>  for i in range(len(unique_elem)):
>>
>>> elem_count[i]= np.sum(reduce(np.logical_or,(abc== x for x
> in [unique_elem[i]])))>  This loop is bottleneck because I have about 850 
> unique
> elements and it takes>  about 9-10 minutes. Can you suggest a faster way to do
> this?
>>
>>> Thank you,>  Naresh>
>> no.unique() can return indices and reverse indices.  It would be trivial to
> histogram the reverse indices using np.histogram().
>>
>> Instead of histogram(), you can use bincount() on the inverse indices:u, inv 
>> =
> np.unique(abc, return_inverse=True)n = np.bincount(inv)u will be an array of 
> the
> unique elements, and n will be an array of the corresponding number of
> occurrences.Warren
>>
>>
>>
>> ___
>> NumPy-Discussion mailing list
>> NumPy-Discussion  scipy.org
>> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>>
> The histogram() solution works perfect since unique_elem is ordered. I
> appreciate everyone's help.
>
>
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion

___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Download page still points to SVN

2012-01-20 Thread David Verelst
I would like to assist on the website. Although I have not made any code 
contributions to Numpy/SciPy (yet), I do follow the mailing lists and 
try to keep up to date on the scientific python scene. However, I need 
to hold my breath until the end of my wind tunnel test campaign mid 
February.

And I do like the sound of the gihub workflow as currently done by the 
ipython team.

Regards,
David

On 20/01/12 08:49, Scott Sinclair wrote:
> On 19 January 2012 21:48, Fernando Perez  wrote:
>> We've moved to the following setup with ipython, which works very well
>> for us so far:
>>
>> 1. ipython.org: Main website with only static content, manged as a
>> repo in github (https://github.com/ipython/ipython-website) and
>> updated with a gh-pages build
>> (https://github.com/ipython/ipython.github.com).
> I like this idea, and to get the ball rolling I've stripped out the
> www directory of the scipy.org-new repo into it's own repository using
> git filter-branch (posted here:
> https://github.com/scottza/scipy_website) and created
> https://github.com/scottza/scottza.github.com. This puts a copy of the
> new scipy website at http://scottza.github.com as a proof of concept.
>
> Since there seems to be some agreement on rehosting numpy's website on
> github, I'd be happy to do as much of the legwork as I can in getting
> the numpy.scipy.org content hosted at numpy.github.com. I don't have
> permission to create new repos for the Numpy organization, so someone
> would have to create an empty
> https://github.com/numpy/numpy.github.com and give me push permission
> on that repo.
>
> It would be great to see scipy go the same way and make updating the
> site easier. I know that David Warde-Farley, Pauli and others put in a
> lot of work scraping content off the wiki to produce the new website,
> it would be fantastic to see the fruits of that effort.
>
> Issues with scipy "Trac, the doc editor, and the conference.scipy.org
> and docs.scipy.org" as mentioned by Pauli. There is also the cookbook
> on the wiki to consider (perhaps http://scipy-central.org/ could play
> a role there).
>
> Cheers,
> Scott
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion

___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] numpy.mean problems

2011-12-13 Thread David Verelst
Note that the pytables pro you are referring to is no longer behind a 
pay wall. Recently the project went through some changes and the pro 
versions disappeared. All pro features where merged into the main 
project and, are as a consequence, also available for free.

Regards,
David

On 13/12/11 21:01, ferreirafm wrote:
> Hi Eraldo,
> Thanks for your suggestion. I was using pytables but give up after known
> that some very useful capabilities are sold as a professional package.
> However, it still useful to many printing and data manipulation and, also,
> it can handle extremely large datasets (which is not my case.).
> Regards,
> Fred
>
>
> Eraldo Pomponi wrote:
>> I would suggest you to have a look at pandas
>> (http://pandas.sourceforge.net/)
>> . It was
>> really helpful for me. It seems well suited for the type of data that you
>> are working
>> with. It has nice "brodcasting" capabilities to apply numpy functions to a
>> set column.
>> http://pandas.sourceforge.net/basics.html#descriptive-statistics
>> http://pandas.sourceforge.net/basics.html#function-application
>>
>> Cheers,
>> Eraldo
>>

___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Comparing NumPy/IDL Performance

2011-09-30 Thread David Verelst
Just want to point to some excellent material that was recently presented at
the course Advanced Scientific Programming in
Pythonat St Andrews. Day 3 was titled
"The Quest for Speed" (see
https://python.g-node.org/wiki/schedule) and might interest you as well.

Regards,
David

On 29 September 2011 20:46, Keith Hughitt  wrote:

> Ah. Thanks for catching that!
>
> Otherwise though I think everything looks pretty good.
>
> Thanks all,
> Keith
>
> On Thu, Sep 29, 2011 at 12:18 PM, Zachary Pincus 
> wrote:
>
>> I think the remaining delta between the integer and float "boxcar"
>> smoothing is that the integer version (test 21) still uses median_filter(),
>> while the float one (test 22) is using uniform_filter(), which is a boxcar.
>>
>> Other than that and the slow roll() implementation in numpy, things look
>> pretty solid, yes?
>>
>> Zach
>>
>>
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
>
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Array input

2010-05-16 Thread David Verelst
Hi Allen,

If you google on "python user input" you already have your answer...
for instance: http://en.wikibooks.org/wiki/Python_Programming/Input_and_output

Hope this helps,

David

> Hi all,
> Am creating a script to do least square adjustment of levelling data. How do 
> I get user input into a 1D array of intergers.  Thanks in advance.
> Allan maungu.
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion