Skip to content

Commit

Permalink
Fix bug in fixing seed for synthetic data (#267)
Browse files Browse the repository at this point in the history
* Bug in synthetic data seed setting fixed when seed=0

* Fixes #260; Residuals now same in Py3 tutorials as in Py2.
  • Loading branch information
thjsal authored Feb 6, 2023
1 parent 9350b0d commit 4760c72
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 96 deletions.
44 changes: 22 additions & 22 deletions docs/source/Instrument_synergy.ipynb

Large diffs are not rendered by default.

152 changes: 80 additions & 72 deletions docs/source/Modeling.ipynb

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions xpsi/tools/synthesise.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def synthesise_exposure(double exposure_time,
T = gsl_rng_default
r = gsl_rng_alloc(T)

if gsl_seed:
if gsl_seed is not None:
gsl_rng_set(r, gsl_seed);
else:
gsl_rng_set(r, time.time());
Expand Down Expand Up @@ -440,7 +440,7 @@ def synthesise_given_total_count_number(double[::1] phases,
T = gsl_rng_default
r = gsl_rng_alloc(T)

if gsl_seed:
if gsl_seed is not None:
gsl_rng_set(r, gsl_seed);
else:
gsl_rng_set(r, time.time());
Expand Down

0 comments on commit 4760c72

Please sign in to comment.