astropy / SPISEA

Stellar Population Synthesis Modeling
https://spisea.readthedocs.io/en/stable/index.html
64 stars 32 forks source link

Implement seed=0, Suppress known warnings #14

Closed MichaelMedford closed 4 years ago

MichaelMedford commented 4 years ago

There are two features in this pull request, both motivated by launching many instances of PyPopStar through PopSyCLE on a supercomputer. The warnings that PyPopStar produces are clogging up my output files and these commits clear them away.

First, the current implementation does not support a fixed seed of 0. This pull explicitly asks if if seed is None, instead of asking if seed, in order to fix this problem.

Second, the RuntimeWarning: invalid value encountered in greater result = getattr(super(), op)(other) warning will be gone by casting nan values to 0 before asking if the values in the array or greater than 5 or less than 101.

The last error that I want to suppress (RuntimeWarning: invalid value encountered in true_divide slope = (y_hi - y_lo) / (x_hi - x_lo)[:, None]) will be easier to fix once the random seed issue is fixed, so expect that coming later.