Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | ENH: Add dtype argument to random.randint. | Charles Harris | 2016-01-02 | 1 | -0/+16 |
| | | | | | | | | | | | | | | | | | | | | | Random ndarrays of the following types can now be generated: * np.bool, * np.int8, np.uint8, * np.int16, np.uint16, * np.int32, np.uint32, * np.int64, np.uint64, * np.int_ (long), np.intp The specification is by precision rather than by C type. Hence, on some platforms np.int64 may be a `long` instead of `long long` even if the specified dtype is `long long` because the two may have the same precision. The resulting type depends on which c type numpy uses for the given precision. The byteorder specification is also ignored, the generated arrays are always in native byte order. The dtype of the result could be made more explicit if desired without changing the user visible results. | ||||
* | BUG: reject too large seeds to RandomState | Julian Taylor | 2014-05-15 | 1 | -0/+2 |
| | | | | | | mtrand accepts seeds larger than 32 bit but silently truncates them back to 32 bit. This can lead to accidentally getting the same random stream for two different seeds, e.g. 1 and 1 + 2**40. | ||||
* | ENH: replace GIL of random module with a per state lock | Julian Taylor | 2014-05-02 | 1 | -4/+4 |
| | | | | | | | | | | | | | | | The random module currently relies on the GIL for the state synchronization which hampers threading performance. Instead add a lock to the RandomState object and take it for all operations calling into randomkit while releasing the GIL. This allows parallizing random number generation using multiple states or asynchronous generation in a worker thread. Note that with a large number of threads the standard mersenne twister used may exhibit overlap if the number of parallel streams is large compared to the size of the state space, though due to the limited scalability of Python in regards to threads this is likely not a big issue. | ||||
* | UPD: Make numpy.pxd and mtrand.pyx use non-deprecated macros/functions. | Charles Harris | 2012-04-06 | 1 | -38/+45 |
| | | | | | | | The non-deprecated macros and functions were defined for Cython in numpy.pxd and mtrand was fixed to use them. In particular, direct access to structure internals in mtrand.pyx needed to be replaced by the new access functions. | ||||
* | MOV: Rename numpy.pxi to numpy.pxd to conform to current Cython. | Charles Harris | 2012-04-06 | 1 | -0/+133 |