Skip to content

Commit

Permalink
fix math.gcd for python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
mariogeiger committed Sep 21, 2022
1 parent 24fa4cf commit c353ec1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions e3nn_jax/_src/irreps_array.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit c353ec1

Please sign in to comment.