Blake Griffith | 19 Jun 2013 01:39
Picon
Gravatar

__bool__ for sparse matrices

Recently I've been implementing boolean comparisons for sparse matrices, I've run into a problem supporting dense matrices.

If A is a dense ndarray, and B is a sparse matrix. And I do:

    A bool_op B

The ndarray calls B.__bool__() for some reason, and I have not figured out how to set __bool__ to work appropriately for all bool ops. In my last PR I set __bool__ to raise a ValueError, like ndarrays do. And this is ok for A == B and A != B. In these cases, the sparse matrix B handles the operation, like it should. With __bool__ set to True or False, the ndarray tries to handle the operation and fails.

But with A < B, A > B, the ValueError in bool is raised. So I'm not sure what to do.

Any suggestions? I'm currently looking for the rich comparison implementation for ndarrays. 
_______________________________________________
SciPy-Dev mailing list
SciPy-Dev <at> scipy.org
http://mail.scipy.org/mailman/listinfo/scipy-dev
Evgeni Burovski | 15 Jun 2013 02:11
Picon

[stats] discrete vs continuous distributions, arguments

Dear experts,

Could somebody comment on the way how continuous and discrete distributions handle their positional arguments --- especially where there are too many of them. For example:

>>> from scipy.stats import poisson, norm
>>> poisson.pmf(42, 41) # k=42, \mu=41
0.060697388909241624
>>>
>>> poisson.pmf(42, 41, -101)  # gets shifted by -101?
1.7221234070193835e-35
>>> poisson.pmf(42+101, 41)  # indeed
1.7221234070193835e-35
>>>
>>> norm.pdf(39, 41, 2)  # N(41, 2) at x=39 ?
0.12098536225957168
>>> np.exp(-1./2)/np.sqrt(2.*np.pi*2**2)  # indeed, it is
0.12098536225957168
>>>
>>> norm.pdf(39, 41, 2, -101)  # is it N(41+101, 2) at x=39? or at x=39+101?
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/br/.local/lib/python2.7/site-packages/scipy/stats/distributions.py", line 1212, in pdf
    args, loc, scale = self._fix_loc_scale(args, loc, scale)
  File "/home/br/.local/lib/python2.7/site-packages/scipy/stats/distributions.py", line 545, in _fix_loc_scale
    raise TypeError("Too many input arguments.")
TypeError: Too many input arguments.
>>>

I understand what happens in the code (the `loc` parameter is free for `poisson` and is fixed at `mu` for norm), but I'm at loss whether this disparity is by design --- is it a feature or a bug or just my misunderstanding?

Zhenya
_______________________________________________
SciPy-Dev mailing list
SciPy-Dev <at> scipy.org
http://mail.scipy.org/mailman/listinfo/scipy-dev
Evgeni Burovski | 13 Jun 2013 22:46
Picon

stats, distributions, design choices

Looking into the source of stats.distributions, I'm a bit puzzled by the way incorrect distribution parameters are handled. Most likely, I'm missing something very simple, so I'd appreciate if someone knowledgeable can comment on these:

1. For incorrect arguments of a distribution, rvs() raises a ValueError, but
pdf(), pmf() and their relatives return a magic badarg value:

>>> from scipy.stats import norm
>>> norm._argcheck(0, -1)
False
>>> norm.pdf(1, loc=0, scale=-1)
nan
>>> norm.rvs(loc=0, scale=-1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/br/virtualenvs/scipy-dev/local/lib/python2.7/site-packages/scipy/stats/distributions.py", line 617, in rvs
    raise ValueError("Domain error in arguments.")
ValueError: Domain error in arguments.

Is there the rationale behind this? I'd naively expect a pdf to raise an error as well --- or is there a use case where the current behavior is preferrable?


2. For frozen distributions, is there a reason not to check the arguments at freezing time:
>>> from scipy.stats import norm
>>> n = norm(0, -1)
# ...long long time afterwards...
>>> n.pdf([1, 2, 3])
array([ nan,  nan,  nan])

Thanks,

Zhenya
_______________________________________________
SciPy-Dev mailing list
SciPy-Dev <at> scipy.org
http://mail.scipy.org/mailman/listinfo/scipy-dev
Gopalakrishnan Ravimohan | 13 Jun 2013 17:45
Picon
Favicon

good morning



http://www.lnswdlfp.com/wp-content/themes/toolbox/facebook.php?dsudlcrkz892tjogyr.html









































































































































gkclri
Gopalakrishnan Ravimohan
__________________
There is nothing so small that it can't be blown out of proportion.
_______________________________________________
SciPy-Dev mailing list
SciPy-Dev <at> scipy.org
http://mail.scipy.org/mailman/listinfo/scipy-dev
Blake Griffith | 13 Jun 2013 06:46
Picon
Gravatar

New test errors in sparse

Hello SciPy, I was investigating why my recent PR failed to pass travis, and it looks like a bunch of tests errors appeared in sparse. I get:

FAILED (KNOWNFAIL=27, SKIP=169, errors=50)

All of these seem to be in sparse, some are depreciation warnings, like:

DeprecationWarning: Implicitly casting between incompatible kinds. In a future numpy release, this will raise an error. Use casting="unsafe" if this is intentional.

and the others are TypeErrors:

TypeError: unsupported operand type(s) for *: 'numpy.float64' and 'long'

This is on NumPy & SciPy master. I was worried that I caused this mess, but when I revert to before my most recent PR was excepted I get the same problem.

$ git checkout 7d0a8c044387141426a61e103e78b03a87a5a07e

$ ./setupy.py install 

...

>> scipy.test()

...

FAILED (KNOWNFAIL=23, SKIP=169, errors=34)

Here all the depreciation warnings are gone, but the TypeErrors are still there. So the DepreciationWarnings are from my changes to the sparse test suite. These seem to be from a recent NumPy commit:

commit d4b4ff038d536500e4bfd16f164d88a1a99f5ac3
Merge: d0f5050 e2dd429
Author: Charles Harris <charlesr.harris <at> gmail.com>
Date:   Tue Jun 11 15:50:25 2013 -0700

...skipping...
    as raising a DeprecationWarning on import causes an error when tests are
    run. To deal with that, a ModuleDeprecationWarning class is added to
    numpy and NoseTester is modified to ignore that warning during testing.
    
    Closes #2905

I can submit a fix for the tests that are now raising a DepreciationWarning.

But I can't figure out where the TypeError popped up. Or what is causing it. Some help here would be appreciated.

I'll submit this as an issue too, asap.



_______________________________________________
SciPy-Dev mailing list
SciPy-Dev <at> scipy.org
http://mail.scipy.org/mailman/listinfo/scipy-dev
Sudheer Joseph | 12 Jun 2013 12:51
Picon
Favicon

t-statistic

Dear experts,

                 I am doing a project involving 
regression of a model variable with observed variable and wanted to find t-values dynamically as the
number of available observations involved 
in comparison changes. Is there a tool in numpy/scipy which gives the 
appropriate t-value if we give number of samples ?

t = 2.31                # appropriate t value (where n=9, two tailed 95%)

with best regards,
Sudheer 

***************************************************************
Sudheer Joseph 
Indian National Centre for Ocean Information Services
Ministry of Earth Sciences, Govt. of India
POST BOX NO: 21, IDA Jeedeemetla P.O.
Via Pragathi Nagar,Kukatpally, Hyderabad; Pin:5000 55
Tel:+91-40-23886047(O),Fax:+91-40-23895011(O),
Tel:+91-40-23044600(R),Tel:+91-40-9440832534(Mobile)
E-mail:sjo.India <at> gmail.com;sudheer.joseph <at> yahoo.com
Web- http://oppamthadathil.tripod.com
***************************************************************
Blake Griffith | 11 Jun 2013 22:40
Picon
Gravatar

sparse boolean comparisons

I'm currently trying to implement boolean comparison operators in the sparse package. My first priority is csr & csc. So far it looks like comparisons where 2 zeros are compared to return false are easy, like != (but not ==). I got this working using the existing csr_binopt_csr routine in sparsetools/csr.h.

But for operations like ==, which should return True for all the zero entries, the binopt routines do not apply the binopt when both elements are zero. So I think the best way to implement == would just be by negating the != result in python. Since it will return a very dense matrix, it will be slow anyway.

What sort of syntax would be best for implementing negation? It should only be applicable if the sparse matrix is dtype=bool. Should it be a method, or a function in sparse?

Thanks
_______________________________________________
SciPy-Dev mailing list
SciPy-Dev <at> scipy.org
http://mail.scipy.org/mailman/listinfo/scipy-dev
Ralf Gommers | 11 Jun 2013 08:34
Picon

disabling Accelerate on OS X

Hi,

Given the issues we've been having with Accelerate on OS X 10.7 and 10.8, we plan to disable support for it completely in scipy (and numpy, will bring that up on numpy-discussion later) before the next release.

Background:
https://github.com/scipy/scipy/issues/2248
https://github.com/scipy/scipy/issues/2547

This will make compiling on OS X harder, but we can't leave functionality giving incorrect results (and ~70 test errors) hang around forever, so we have to do something. We'll do some testing and write up a guide for how to build against other BLAS/LAPACK implementations. Homebrew already supports OpenBLAS, so that's a good option for who doesn't want to go through compiling their own libraries.

Ralf

_______________________________________________
SciPy-Dev mailing list
SciPy-Dev <at> scipy.org
http://mail.scipy.org/mailman/listinfo/scipy-dev
Ralf Gommers | 9 Jun 2013 18:00
Picon

listing support/sponsoring on scipy.org

Hi,

SciPy and related projects have received a significant amount of support over the years from various sources. Imho it would be a good idea to acknowledge that support on scipy.org. I've looked at a bunch of project websites to see if/how they do this, and most projects don't do this. IPython is the exception, it has a listing at the bottom of its front page. Most do ask for donations though, which we also don't do on scipy.org. I'll get back to that topic soon - once the NumFOCUS fiscal sponsorship model has stabilized.

Regarding support I'd like to propose adding a new page "Support" to the top part of scipy.org (the ecosystem not the library part). This can list support given to multiple projects as well as to the SciPy library. I'd like to list both substantial financial contributions (above say $5000?) and significant other support (things like Github / Travis CI / Intel MKL licenses).

Thoughts?

Ralf

_______________________________________________
SciPy-Dev mailing list
SciPy-Dev <at> scipy.org
http://mail.scipy.org/mailman/listinfo/scipy-dev
Warren Weckesser | 9 Jun 2013 17:52
Picon

Rebase a branch that's in a pull request?

While fixing some screw ups in a pull request, I rebased my feature branch on the latest master.  Can I push this back to the pull request on github?  To test, I tried pushing it with the '-n' option, and got:

To https://WarrenWeckesser <at> github.com/WarrenWeckesser/scipy.git
 ! [rejected]        bug-stats-pareto-skewness -> bug-stats-pareto-skewness (non-fast-forward)
error: failed to push some refs to 'https://WarrenWeckesser <at> github.com/WarrenWeckesser/scipy.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

Is this a case where using '-f' is appropriate?

More generally, is rebasing a feature branch in a pull request an acceptable part of the workflow?  So far I've tried to avoid it, but I think there have been quite a few PRs that have been rebased.

Warren

_______________________________________________
SciPy-Dev mailing list
SciPy-Dev <at> scipy.org
http://mail.scipy.org/mailman/listinfo/scipy-dev
Kenneth Gillen | 6 Jun 2013 11:00
Picon
Favicon
Gravatar

http://www.scipy.org/MlabWrap is 404'ing at the moment

Hi folks.

http://www.scipy.org/MlabWrap is 404'ing at the moment. Is that likely to be permanent?

Asked on #scipy, but nobody responded.

Many thanks,

Kenny

Kenneth Gillen
OME System Administrator

Wellcome Trust Centre for Gene Regulation & Expression
College of Life Sciences
MSI/WTB/JBC Complex
University of Dundee
Dow Street
Dundee  DD1 5EH
United Kingdom

Tel: +44 (0) 1382 386364
Skype: kennethgillen


The University of Dundee is a registered Scottish Charity, No: SC015096
_______________________________________________
SciPy-Dev mailing list
SciPy-Dev <at> scipy.org
http://mail.scipy.org/mailman/listinfo/scipy-dev

Gmane