silence deprecation warning
This commit is contained in:
parent
b00b4bb0ad
commit
67f0ab2ce8
|
@ -183,7 +183,7 @@ def scale_to_coprime(v):
|
||||||
# Python 3.9 provides math.lcm, see https://stackoverflow.com/questions/51716916.
|
# Python 3.9 provides math.lcm, see https://stackoverflow.com/questions/51716916.
|
||||||
return a * b // np.gcd(a, b)
|
return a * b // np.gcd(a, b)
|
||||||
|
|
||||||
m = (np.array(v) * reduce(lcm, map(lambda x: int(get_square_denominator(x)),v)) ** 0.5).astype(np.int)
|
m = (np.array(v) * reduce(lcm, map(lambda x: int(get_square_denominator(x)),v)) ** 0.5).astype(int)
|
||||||
m = m//reduce(np.gcd,m)
|
m = m//reduce(np.gcd,m)
|
||||||
|
|
||||||
with np.errstate(invalid='ignore'):
|
with np.errstate(invalid='ignore'):
|
||||||
|
|
|
@ -347,7 +347,7 @@ class TestGrid:
|
||||||
@pytest.mark.parametrize('approach',['Laguerre','Voronoi'])
|
@pytest.mark.parametrize('approach',['Laguerre','Voronoi'])
|
||||||
def test_tessellate_bicrystal(self,approach):
|
def test_tessellate_bicrystal(self,approach):
|
||||||
cells = np.random.randint(5,10,3)*2
|
cells = np.random.randint(5,10,3)*2
|
||||||
size = cells.astype(np.float)
|
size = cells.astype(float)
|
||||||
seeds = np.vstack((size*np.array([0.5,0.25,0.5]),size*np.array([0.5,0.75,0.5])))
|
seeds = np.vstack((size*np.array([0.5,0.25,0.5]),size*np.array([0.5,0.75,0.5])))
|
||||||
material = np.zeros(cells)
|
material = np.zeros(cells)
|
||||||
material[:,cells[1]//2:,:] = 1
|
material[:,cells[1]//2:,:] = 1
|
||||||
|
|
Loading…
Reference in New Issue