silence deprecation warning

This commit is contained in:
Martin Diehl 2021-02-22 08:35:15 +01:00
parent b00b4bb0ad
commit 67f0ab2ce8
2 changed files with 2 additions and 2 deletions

View File

@ -183,7 +183,7 @@ def scale_to_coprime(v):
# Python 3.9 provides math.lcm, see https://stackoverflow.com/questions/51716916.
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)
with np.errstate(invalid='ignore'):

View File

@ -347,7 +347,7 @@ class TestGrid:
@pytest.mark.parametrize('approach',['Laguerre','Voronoi'])
def test_tessellate_bicrystal(self,approach):
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])))
material = np.zeros(cells)
material[:,cells[1]//2:,:] = 1