Python scipy.inf() Examples

The following are 4 code examples of scipy.inf(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module scipy , or try the search function .
Example #1
Source File: cosmology.py    From easyGalaxy with MIT License 5 votes vote down vote up
def Tu(self, s=False, yr=False, myr=False, gyr=False):
        return self.Th() * integrate.quad(
            self.Tfunc, 0, inf)[0] * self.timeConversion(s=s,
                                                         yr=yr,
                                                         myr=myr,
                                                         gyr=gyr)

    # added 12/16/11 - Conor Mancone
    # returns conversion from arcseconds to physical angular size 
Example #2
Source File: pure_scipy.py    From ufora with Apache License 2.0 5 votes vote down vote up
def __call__(self, x):
        if not isinstance(x, float):
            x = float(x)

        if x <= 0 and math.ceil(x) == x:
            return numpy.inf

        return __inline_fora(
            """fun(@unnamed_args:(x), *args) {
                   return PyFloat(`lgamma(x.@m))
                   }"""
            )(x) 
Example #3
Source File: pure_scipy.py    From ufora with Apache License 2.0 5 votes vote down vote up
def __call__(self, p):
        if not isinstance(p, float):
            p = float(p)

        if p < 0 or p > 1:
            return scipy.nan

        if p == 0:
            return -scipy.inf

        if p == 1:
            return scipy.inf

        return scipy.log(p / (1.0 - p)) 
Example #4
Source File: optics.py    From REDPy with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, distance_pairs):

        self.data = distance_pairs
        self._n = len(self.data)
        self._processed = scipy.zeros((self._n, 1), dtype=bool)
        self._reachability = scipy.ones(self._n) * scipy.inf
        self._core_dist = scipy.ones(self._n) * scipy.nan
        self._index = scipy.array(range(self._n))
        self._nneighbors = scipy.ones(self._n, dtype=int)*self._n
        self._cluster_id = -scipy.ones(self._n, dtype=int)
        self._is_core = scipy.ones(self._n, dtype=bool)
        self._ordered_list = []