lucabaldini / pyxpe

Python utilities for the X-ray Polarimetry Explorers
GNU General Public License v3.0
0 stars 0 forks source link

avoid multiple random generator in xperandom.py #12

Closed csgro closed 8 years ago

csgro commented 8 years ago

Current default engine is native python "random" module, but theta and phi uses numpy "random" module. This is bad for seeding and consistency, we should stick to one default generator.

csgro commented 8 years ago

As temporary fix for seeding we can seed both in set_seed:

def set_seed(self, seed=None): self.engine.seed(seed) np.random.seed(seed)

lucabaldini commented 8 years ago

The Python native generator is notoriously small and does not allow vectorization---I'd go with numpy without any hesitation.

My 2 cents, Luca

csgro commented 8 years ago

Now using numpy random, after commit 2331b5c Closing this issue.