From c353ec1807a0822aaeaad74a6af33678d864b137 Mon Sep 17 00:00:00 2001 From: Mario Geiger Date: Wed, 21 Sep 2022 11:24:41 -0400 Subject: [PATCH] fix math.gcd for python 3.8 --- e3nn_jax/_src/irreps_array.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/e3nn_jax/_src/irreps_array.py b/e3nn_jax/_src/irreps_array.py index 3930323f..2428fa25 100644 --- a/e3nn_jax/_src/irreps_array.py +++ b/e3nn_jax/_src/irreps_array.py @@ -1,14 +1,14 @@ +import functools import math import operator import warnings from typing import Any, List, Optional, Tuple, Union +import e3nn_jax as e3nn import jax import jax.numpy as jnp import jax.scipy import numpy as np - -import e3nn_jax as e3nn from e3nn_jax import Irreps, axis_angle_to_angles, config, matrix_to_angles, quaternion_to_angles from e3nn_jax._src.irreps import IntoIrreps @@ -556,7 +556,7 @@ def factor_mul_to_last_axis(self, factor=None) -> "IrrepsArray": [ 4 5 12 13 14]] """ if factor is None: - factor = math.gcd(*(mul for mul, _ in self.irreps)) + factor = functools.reduce(math.gcd, (mul for mul, _ in self.irreps)) if not all(mul % factor == 0 for mul, _ in self.irreps): raise ValueError(f"factor {factor} does not divide all multiplicities")