Skip to content
Snippets Groups Projects
Commit e90a37bf authored by simply-nicky's avatar simply-nicky
Browse files

Merge branch 'dev0'

parents dbbc7eb1 ea4b7f04
No related branches found
No related tags found
No related merge requests found
...@@ -22,7 +22,7 @@ copyright = '2020, Nikolay Ivanov' ...@@ -22,7 +22,7 @@ copyright = '2020, Nikolay Ivanov'
author = 'Nikolay Ivanov' author = 'Nikolay Ivanov'
# The full version, including alpha/beta/rc tags # The full version, including alpha/beta/rc tags
release = '0.1.7' release = '0.1.8'
# -- General configuration --------------------------------------------------- # -- General configuration ---------------------------------------------------
......
...@@ -2,9 +2,9 @@ cimport numpy as np ...@@ -2,9 +2,9 @@ cimport numpy as np
import numpy as np import numpy as np
from .beam_calc cimport * from .beam_calc cimport *
from libc.math cimport sqrt, cos, sin, pi, erf from libc.math cimport sqrt, cos, sin, pi, erf
from libc.time cimport time_t, time
from cython.parallel import prange from cython.parallel import prange
cimport openmp cimport openmp
from posix.time cimport clock_gettime, timespec, CLOCK_REALTIME
ctypedef np.complex128_t complex_t ctypedef np.complex128_t complex_t
ctypedef np.uint64_t uint_t ctypedef np.uint64_t uint_t
...@@ -300,9 +300,8 @@ def barcode_steps(double x0, double x1, double br_dx, double rd): ...@@ -300,9 +300,8 @@ def barcode_steps(double x0, double x1, double br_dx, double rd):
gsl_rng *r = gsl_rng_alloc(gsl_rng_mt19937) gsl_rng *r = gsl_rng_alloc(gsl_rng_mt19937)
double bs_min = max(1 - rd, 0), bs_max = min(1 + rd, 2) double bs_min = max(1 - rd, 0), bs_max = min(1 + rd, 2)
double[::1] bx_arr = np.empty(br_n, dtype=np.float64) double[::1] bx_arr = np.empty(br_n, dtype=np.float64)
timespec ts time_t t = time(NULL)
clock_gettime(CLOCK_REALTIME, &ts) gsl_rng_set(r, t)
gsl_rng_set(r, ts.tv_sec + ts.tv_nsec)
if br_n: if br_n:
bx_arr[0] = x0 + br_dx * ((bs_max - bs_min) * gsl_rng_uniform_pos(r) - 1) bx_arr[0] = x0 + br_dx * ((bs_max - bs_min) * gsl_rng_uniform_pos(r) - 1)
for i in range(1, br_n): for i in range(1, br_n):
...@@ -457,10 +456,9 @@ def make_frames(double[:, ::1] i_x, double[::1] i_y, double[::1] sc_x, double[:: ...@@ -457,10 +456,9 @@ def make_frames(double[:, ::1] i_x, double[::1] i_y, double[::1] sc_x, double[::
uint_t[:, :, ::1] frames = np.empty((a, b, c), dtype=np.uint64) uint_t[:, :, ::1] frames = np.empty((a, b, c), dtype=np.uint64)
double[::1] i_ys = np.empty(b, dtype=np.float64) double[::1] i_ys = np.empty(b, dtype=np.float64)
gsl_rng *r = gsl_rng_alloc(gsl_rng_mt19937) gsl_rng *r = gsl_rng_alloc(gsl_rng_mt19937)
timespec ts time_t t = time(NULL)
unsigned long seed unsigned long seed
clock_gettime(CLOCK_REALTIME, &ts) gsl_rng_set(r, t)
gsl_rng_set(r, ts.tv_sec + ts.tv_nsec)
for i in range(b): for i in range(b):
i_ys[i] = convolve_c(i_y, sc_y, i) i_ys[i] = convolve_c(i_y, sc_y, i)
for i in prange(a, schedule='guided', nogil=True): for i in prange(a, schedule='guided', nogil=True):
......
...@@ -39,7 +39,7 @@ with open('README.md', 'r') as readme: ...@@ -39,7 +39,7 @@ with open('README.md', 'r') as readme:
long_description = readme.read() long_description = readme.read()
setup(name='pyrost', setup(name='pyrost',
version='0.1.7', version='0.1.8',
author='Nikolay Ivanov', author='Nikolay Ivanov',
author_email="nikolay.ivanov@desy.de", author_email="nikolay.ivanov@desy.de",
long_description=long_description, long_description=long_description,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment