def has_integer_powers(self):
"""
Check if the dimension object has only integer powers.
All the dimension powers should be integers, but rational powers may
appear in intermediate steps. This method may be used to check that the
final result is well-defined.
"""
for dpow in self.get_dimensional_dependencies().values():
if not isinstance(dpow, (int, Integer)):
return False
else:
return True
# base dimensions (MKS)
评论列表
文章目录