Hi, I'm new to this mailing list. I just wraped NNLS (non negative least sqaures) from NETLIB using ctypes and want to ask if anybody is interested in my code ? As far as I know scipy does not contain this algorithm. Greetings, Uwe -- Dr. rer. nat. Uwe Schmitt F&E Mathematik mineway GmbH Science Park 2 D-66123 Saarbrücken Telefon: +49 (0)681 8390 5334 Telefax: +49 (0)681 830 4376 uschmitt@mineway.de www.mineway.de Geschäftsführung: Dr.-Ing. Mathias Bauer Amtsgericht Saarbrücken HRB 12339
On Wed, Jul 23, 2008 at 10:40, Uwe Schmitt <uschmitt@mineway.de> wrote:
Hi,
I'm new to this mailing list. I just wraped NNLS (non negative least sqaures) from NETLIB using ctypes and want to ask if anybody is interested in my code ? As far as I know scipy does not contain this algorithm.
I am reluctant to include Lawson and Hanson's code into scipy without a clear copyright statement and license which allows us to do so. Perhaps their book includes such a statement, but none of the actual files containing their code do. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco
On Wed, Jul 23, 2008 at 10:40, Uwe Schmitt <uschmitt@mineway.de> wrote:
I'm new to this mailing list. I just wraped NNLS (non negative least sqaures) from NETLIB using ctypes and want to ask if anybody is interested in my code ? As far as I know scipy does not contain this algorithm.
On Wed, 23 Jul 2008, Robert Kern apparently wrote:
I am reluctant to include Lawson and Hanson's code into scipy without a clear copyright statement and license which allows us to do so. Perhaps their book includes such a statement, but none of the actual files containing their code do.
Are the letters I forwarded last Sept not adequate in some way? Cheers, Alan Isaac
On Wed, Jul 23, 2008 at 15:59, Alan G Isaac <aisaac@american.edu> wrote:
On Wed, Jul 23, 2008 at 10:40, Uwe Schmitt <uschmitt@mineway.de> wrote:
I'm new to this mailing list. I just wraped NNLS (non negative least sqaures) from NETLIB using ctypes and want to ask if anybody is interested in my code ? As far as I know scipy does not contain this algorithm.
On Wed, 23 Jul 2008, Robert Kern apparently wrote:
I am reluctant to include Lawson and Hanson's code into scipy without a clear copyright statement and license which allows us to do so. Perhaps their book includes such a statement, but none of the actual files containing their code do.
Are the letters I forwarded last Sept not adequate in some way?
I wasn't aware that NNLS was included as part of TOMS 733's code. Now, I'm not so sure that the ACM or the author of TOMS 733 actually had the rights to give us a BSD license on the whole set of code. People make mistakes. Find me a statement from Lawson or Hanson. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco
On Wed, 23 Jul 2008, Uwe Schmitt apparently wrote:
I just wraped NNLS (non negative least sqaures) from NETLIB using ctypes and want to ask if anybody is interested in my code ?
Since Robert is satisfied that the licensing issues are fully addressed, the answer is: definitely! Please contribute this to SciPy! Cheers, Alan Isaac
On Wed, Jul 23, 2008 at 17:47, Alan G Isaac <aisaac@american.edu> wrote:
On Wed, 23 Jul 2008, Uwe Schmitt apparently wrote:
I just wraped NNLS (non negative least sqaures) from NETLIB using ctypes and want to ask if anybody is interested in my code ?
Since Robert is satisfied that the licensing issues are fully addressed, the answer is: definitely! Please contribute this to SciPy!
Well, I'd prefer an f2py version rather than a ctypes version, but yes, please. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco
Robert Kern schrieb:
On Wed, Jul 23, 2008 at 17:47, Alan G Isaac <aisaac@american.edu> wrote:
Well, I'd prefer an f2py version rather than a ctypes version, but yes, please.
I had some problems because my local python.exe is from Enthought, which was compiled with MS Visual Studio. But I wanted g77 for compiling the Fortran code, which gives some problems when using f2py. Do you have some conventions about code layout, directory layort, etc ? How can I contribute the code ? Shall I post a link ? I found no developers faq or something like this. Greetings, Uwe -- Dr. rer. nat. Uwe Schmitt F&E Mathematik mineway GmbH Science Park 2 D-66123 Saarbrücken Telefon: +49 (0)681 8390 5334 Telefax: +49 (0)681 830 4376 uschmitt@mineway.de www.mineway.de Geschäftsführung: Dr.-Ing. Mathias Bauer Amtsgericht Saarbrücken HRB 12339
On Thu, Jul 24, 2008 at 03:35, Uwe Schmitt <uschmitt@mineway.de> wrote:
Robert Kern schrieb:
On Wed, Jul 23, 2008 at 17:47, Alan G Isaac <aisaac@american.edu> wrote:
Well, I'd prefer an f2py version rather than a ctypes version, but yes, please.
I had some problems because my local python.exe is from Enthought, which was compiled with MS Visual Studio. But I wanted g77 for compiling the Fortran code, which gives some problems when using f2py.
Can you describe these problems? The g77 we distribute with EPD is compatible with the compiler used to build the Python executable, at least when used from distutils. But basically, we can't use ctypes for Fortran code in scipy. The calling conventions are different between Fortran compilers; f2py has worked out most of these, but I have seen no equivalent work done for ctypes. Additionally, the story for building non-extension shared libraries inside scipy is not really worked out, yet.
Do you have some conventions about code layout, directory layort, etc ?
I suspect this should go into scipy.optimize, so look into integrating it there.
How can I contribute the code ? Shall I post a link ?
If you would like someone else to take a look at it first, then please do post a link. However, I will arrange for you to get SVN access. I recommend working on a branch first. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco
Robert Kern schrieb:
On Thu, Jul 24, 2008 at 03:35, Uwe Schmitt <uschmitt@mineway.de> wrote:
Robert Kern schrieb:
On Wed, Jul 23, 2008 at 17:47, Alan G Isaac <aisaac@american.edu> wrote:
Well, I'd prefer an f2py version rather than a ctypes version, but yes, please.
I had some problems because my local python.exe is from Enthought, which was compiled with MS Visual Studio. But I wanted g77 for compiling the Fortran code, which gives some problems when using f2py.
Can you describe these problems? The g77 we distribute with EPD is compatible with the compiler used to build the Python executable, at least when used from distutils.
Hi, if I use "python f2py.py --compiler=mingw32 -c NNLS.f" I get on stdout: running build running config_cc unifing config_cc, config, build_clib, build_ext, build commands --compiler options running config_fc unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options running build_src building extension "untitled" sources f2py options: [] f2py:> c:\dokume~1\uschmi~2.000\lokale~1\temp\tmpzs6mqy\src.win32-2.5\untitledmodule.c creating c:\dokume~1\uschmi~2.000\lokale~1\temp\tmpzs6mqy creating c:\dokume~1\uschmi~2.000\lokale~1\temp\tmpzs6mqy\src.win32-2.5 Reading fortran codes... Reading file 'NNLS.F' (format:fix,strict) Post-processing... Block: untitled Block: nnls Block: diff Block: h12 Block: g1 Post-processing (stage 2)... Building modules... Building module "untitled"... Constructing wrapper function "nnls"... getarrdims:warning: assumed shape array, using 0 instead of '*' getarrdims:warning: assumed shape array, using 0 instead of '*' getarrdims:warning: assumed shape array, using 0 instead of '*' getarrdims:warning: assumed shape array, using 0 instead of '*' getarrdims:warning: assumed shape array, using 0 instead of '*' getarrdims:warning: assumed shape array, using 0 instead of '*' nnls(a,m,n,b,x,rnorm,w,zz,index_bn,mode,[mda]) Creating wrapper for Fortran function "diff"("diff")... Constructing wrapper function "diff"... diff = diff(x,y) Constructing wrapper function "h12"... getarrdims:warning: assumed shape array, using 0 instead of '*' getarrdims:warning: assumed shape array, using 0 instead of '*' h12(mode,lpivot,l1,m,u,up,c,ice,icv,ncv,[iue]) Constructing wrapper function "g1"... g1(a,b,cterm,sterm,sig) Wrote C/API module "untitled" to file "c:\dokume~1\uschmi~2.000\lokale~1\temp\tmpzs6mqy\src.win32-2.5/untitledmodule.c" Fortran 77 wrappers are saved to "c:\dokume~1\uschmi~2.000\lokale~1\temp\tmpzs6mqy\src.win32-2.5\untitled-f2pywrappers.f" adding 'c:\dokume~1\uschmi~2.000\lokale~1\temp\tmpzs6mqy\src.win32-2.5\fortranobject.c' to sources. adding 'c:\dokume~1\uschmi~2.000\lokale~1\temp\tmpzs6mqy\src.win32-2.5' to include_dirs. copying c:\Python25\lib\site-packages\numpy-1.0.4.0003-py2.5-win32.egg\numpy\f2py\src\fortranobject.c -> c:\dokume~1\uschmi~2.000\lokale~1\temp\tmpzs6mqy\src.win32-2.5 copying c:\Python25\lib\site-packages\numpy-1.0.4.0003-py2.5-win32.egg\numpy\f2py\src\fortranobject.h -> c:\dokume~1\uschmi~2.000\lokale~1\temp\tmpzs6mqy\src.win32-2.5 adding 'c:\dokume~1\uschmi~2.000\lokale~1\temp\tmpzs6mqy\src.win32-2.5\untitled-f2pywrappers.f' to sources. running build_ext And on stderr: rmbadname1: Replacing "index" with "index_bn". rmbadname1: Replacing "index" with "index_bn". Traceback (most recent call last): File "f2py.py", line 26, in <module> main() File "c:\Python25\lib\site-packages\numpy-1.0.4.0003-py2.5-win32.egg\numpy\f2py\f2py2e.py", line 558, in main run_compile() File "c:\Python25\lib\site-packages\numpy-1.0.4.0003-py2.5-win32.egg\numpy\f2py\f2py2e.py", line 545, in run_compile setup(ext_modules = [ext]) File "c:\Python25\lib\site-packages\numpy-1.0.4.0003-py2.5-win32.egg\numpy\distutils\core.py", line 176, in setup return old_setup(**new_attr) File "C:\Python25\lib\distutils\core.py", line 151, in setup dist.run_commands() File "C:\Python25\lib\distutils\dist.py", line 974, in run_commands self.run_command(cmd) File "C:\Python25\lib\distutils\dist.py", line 994, in run_command cmd_obj.run() File "C:\Python25\lib\distutils\command\build.py", line 112, in run self.run_command(cmd_name) File "C:\Python25\lib\distutils\cmd.py", line 333, in run_command self.distribution.run_command(command) File "C:\Python25\lib\distutils\dist.py", line 994, in run_command cmd_obj.run() File "c:\Python25\lib\site-packages\numpy-1.0.4.0003-py2.5-win32.egg\numpy\distutils\command\build_ext.py", line 78, in run force=self.force) File "c:\Python25\lib\site-packages\numpy-1.0.4.0003-py2.5-win32.egg\numpy\distutils\ccompiler.py", line 366, in new_compiler compiler = klass(None, dry_run, force) File "c:\Python25\lib\site-packages\numpy-1.0.4.0003-py2.5-win32.egg\numpy\distutils\mingw32ccompiler.py", line 46, in __init__ verbose,dry_run, force) File "c:\Python25\lib\distutils\cygwinccompiler.py", line 84, in __init__ get_versions() File "c:\Python25\lib\distutils\cygwinccompiler.py", line 424, in get_versions ld_version = StrictVersion(result.group(1)) File "C:\Python25\lib\distutils\version.py", line 40, in __init__ self.parse(vstring) File "C:\Python25\lib\distutils\version.py", line 107, in parse raise ValueError, "invalid version number '%s'" % vstring ValueError: invalid version number '2.18.50.20080625' Greetings, Uwe -- Dr. rer. nat. Uwe Schmitt F&E Mathematik mineway GmbH Science Park 2 D-66123 Saarbrücken Telefon: +49 (0)681 8390 5334 Telefax: +49 (0)681 830 4376 uschmitt@mineway.de www.mineway.de Geschäftsführung: Dr.-Ing. Mathias Bauer Amtsgericht Saarbrücken HRB 12339
Uwe Schmitt wrote:
And on stderr:
rmbadname1: Replacing "index" with "index_bn". rmbadname1: Replacing "index" with "index_bn". Traceback (most recent call last): File "f2py.py", line 26, in <module> main() File "c:\Python25\lib\site-packages\numpy-1.0.4.0003-py2.5-win32.egg\numpy\f2py\f2py2e.py", line 558, in main run_compile() File "c:\Python25\lib\site-packages\numpy-1.0.4.0003-py2.5-win32.egg\numpy\f2py\f2py2e.py", line 545, in run_compile setup(ext_modules = [ext]) File "c:\Python25\lib\site-packages\numpy-1.0.4.0003-py2.5-win32.egg\numpy\distutils\core.py", line 176, in setup return old_setup(**new_attr) File "C:\Python25\lib\distutils\core.py", line 151, in setup dist.run_commands() File "C:\Python25\lib\distutils\dist.py", line 974, in run_commands self.run_command(cmd) File "C:\Python25\lib\distutils\dist.py", line 994, in run_command cmd_obj.run() File "C:\Python25\lib\distutils\command\build.py", line 112, in run self.run_command(cmd_name) File "C:\Python25\lib\distutils\cmd.py", line 333, in run_command self.distribution.run_command(command) File "C:\Python25\lib\distutils\dist.py", line 994, in run_command cmd_obj.run() File "c:\Python25\lib\site-packages\numpy-1.0.4.0003-py2.5-win32.egg\numpy\distutils\command\build_ext.py", line 78, in run force=self.force) File "c:\Python25\lib\site-packages\numpy-1.0.4.0003-py2.5-win32.egg\numpy\distutils\ccompiler.py", line 366, in new_compiler compiler = klass(None, dry_run, force) File "c:\Python25\lib\site-packages\numpy-1.0.4.0003-py2.5-win32.egg\numpy\distutils\mingw32ccompiler.py", line 46, in __init__ verbose,dry_run, force) File "c:\Python25\lib\distutils\cygwinccompiler.py", line 84, in __init__ get_versions() File "c:\Python25\lib\distutils\cygwinccompiler.py", line 424, in get_versions ld_version = StrictVersion(result.group(1)) File "C:\Python25\lib\distutils\version.py", line 40, in __init__ self.parse(vstring) File "C:\Python25\lib\distutils\version.py", line 107, in parse raise ValueError, "invalid version number '%s'" % vstring ValueError: invalid version number '2.18.50.20080625'
That's a problem of distutils not dealing with some special releases (e.g. 2.18.50 for binutils is OK). I don't know if there is a fix outside patching directly the sources (to remove this version checking which does not make any sense to me ?). It may worth being handled by use because with recent mingw (specially with 4.* releases of gcc), those release numbers are the ones present in the recent "releases". cheers, David
Am 24.07.2008 um 20:37 schrieb Robert Kern:
On Thu, Jul 24, 2008 at 03:35, Uwe Schmitt <uschmitt@mineway.de> wrote:
Robert Kern schrieb:
On Wed, Jul 23, 2008 at 17:47, Alan G Isaac <aisaac@american.edu> wrote:
Well, I'd prefer an f2py version rather than a ctypes version, but yes, please.
I had some problems because my local python.exe is from Enthought, which was compiled with MS Visual Studio. But I wanted g77 for compiling the Fortran code, which gives some problems when using f2py.
Can you describe these problems? The g77 we distribute with EPD is compatible with the compiler used to build the Python executable, at least when used from distutils. But basically, we can't use ctypes for Fortran code in scipy. The calling conventions are different between Fortran compilers; f2py has worked out most of these, but I have seen no equivalent work done for ctypes. Additionally, the story for building non-extension shared libraries inside scipy is not really worked out, yet.
It works now. Using a naked VM with WinXP and Enthoughtedietion 2.5.1 did it.
Do you have some conventions about code layout, directory layort, etc ?
I suspect this should go into scipy.optimize, so look into integrating it there. .
Ok
How can I contribute the code ? Shall I post a link ?
If you would like someone else to take a look at it first, then please do post a link. However, I will arrange for you to get SVN access. I recommend working on a branch first.
Ok, I will look at scipy.optimize and will develop the module. I will send you the result per email. Greetings, Uwe
-- Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco _______________________________________________ Scipy-dev mailing list Scipy-dev@scipy.org http://projects.scipy.org/mailman/listinfo/scipy-dev
Robert Kern schrieb:
On Thu, Jul 24, 2008 at 03:35, Uwe Schmitt <uschmitt@mineway.de> wrote:
Robert Kern schrieb:
On Wed, Jul 23, 2008 at 17:47, Alan G Isaac <aisaac@american.edu> wrote:
Well, I'd prefer an f2py version rather than a ctypes version, but yes, please.
I had some problems because my local python.exe is from Enthought, which was compiled with MS Visual Studio. But I wanted g77 for compiling the Fortran code, which gives some problems when using f2py.
I was able to fix these problems and I start liking f2py. The NNLS code is now via SVN at http://public.procoders.net/nnls/nnls_with_f2py/ How can I contribute this code now ? Is there further any interest in code for * ICA (Independent componenent ananlysis) ? I wrapped existing C-Code with f2py. * NMF/NNMA (nonnegative matrix factorization / - approximation) ? which is pure Python/numpy code. Greetings, Uwe -- Dr. rer. nat. Uwe Schmitt F&E Mathematik mineway GmbH Science Park 2 D-66123 Saarbrücken Telefon: +49 (0)681 8390 5334 Telefax: +49 (0)681 830 4376 uschmitt@mineway.de www.mineway.de Geschäftsführung: Dr.-Ing. Mathias Bauer Amtsgericht Saarbrücken HRB 12339
Uwe Schmitt wrote:
The NNLS code is now via SVN at http://public.procoders.net/nnls/nnls_with_f2py/ How can I contribute this code now ?
Did you get the needed information for this?
Is there further any interest in code for * ICA (Independent componenent ananlysis) ? I wrapped existing C-Code with f2py. * NMF/NNMA (nonnegative matrix factorization / - approximation) ? which is pure Python/numpy code.
I'd like to see the latter find its way into SciPy. (I'm not familiar with ICA; what's the application area?) Cheers, Alan Isaac
Hi, I mailed the questions below some weeks ago, but got no answer. Is there a reason for this ? Greetings, Uwe Uwe Schmitt schrieb:
I was able to fix these problems and I start liking f2py.
The NNLS code is now via SVN at
http://public.procoders.net/nnls/nnls_with_f2py/
How can I contribute this code now ?
Is there further any interest in code for
* ICA (Independent componenent ananlysis) ? I wrapped existing C-Code with f2py.
* NMF/NNMA (nonnegative matrix factorization / - approximation) ? which is pure Python/numpy code.
Greetings, Uwe
-- Dr. rer. nat. Uwe Schmitt F&E Mathematik
mineway GmbH Science Park 2 D-66123 Saarbrücken
Telefon: +49 (0)681 8390 5334 Telefax: +49 (0)681 830 4376
uschmitt@mineway.de www.mineway.de
Geschäftsführung: Dr.-Ing. Mathias Bauer Amtsgericht Saarbrücken HRB 12339
-- Dr. rer. nat. Uwe Schmitt F&E Mathematik mineway GmbH Science Park 2 D-66123 Saarbrücken Telefon: +49 (0)681 8390 5334 Telefax: +49 (0)681 830 4376 uschmitt@mineway.de www.mineway.de Geschäftsführung: Dr.-Ing. Mathias Bauer Amtsgericht Saarbrücken HRB 12339
On Wed, 23 Jul 2008, Uwe Schmitt apparently wrote:
I just wraped NNLS (non negative least sqaures) from NETLIB using ctypes and want to ask if anybody is interested in my code ?
Since Robert is satisfied that the licensing issues are fully addressed, the answer is: definitely! Please contribute this to SciPy! Cheers, Alan Isaac
participants (4)
-
Alan G Isaac -
David Cournapeau -
Robert Kern -
Uwe Schmitt