Aufgrund von Umarbeiten des s3 Storage wird es in GitLab, in nächster Zeit, mögliche Performance-Einbußen geben. Näheres dazu unter: https://maintenance.itc.rwth-aachen.de/ticket/status/messages/43/show_ticket/6670

Commit fde5cd79 authored by Marcus Wirtz's avatar Marcus Wirtz

[simulations] Fix python2 integer divisions

parent ea6f3278
Pipeline #361214 passed with stages
in 6 minutes and 15 seconds
......@@ -1109,7 +1109,7 @@ class SourceGeometry:
self.rmax = (3*self.n_src/4/np.pi/source_density)**(1/3.)
else:
assert not isinstance(source_density, np.ndarray), "Dont set 'rmax' when using a varying source denity!"
self.n_src = int(round(4/3*np.pi*self.rmax**3 * source_density))
self.n_src = int(round(4/3.*np.pi*self.rmax**3 * source_density))
if sources is not None:
assert np.all(sources.shape[-1] >= self.n_src), "Too few 'sources' for given keywords \
'source_density' and 'rmax'!"
......
......@@ -586,7 +586,7 @@ class TestSourceGeometry(unittest.TestCase):
universe2.set_sources(source_density=1e-3, rmax=universe.rmax)
self.assertTrue((universe2.n_src == self.n_src) and (universe.rmax == universe2.rmax))
sources = coord.rand_vec(1000) * 30 * np.random.random((1, 1000))**(1/3)
sources = coord.rand_vec(1000) * 30 * np.random.random((1, 1000))**(1/3.)
distances = np.sqrt(np.sum(sources**2, axis=0))
universe = SourceGeometry(self.nsets)
universe.set_sources(source_density=1e-3, sources=sources, n_src=self.n_src)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment