Skip to content

Commit

Permalink
Remove runtime depdendency on packaging for featomic-torch
Browse files Browse the repository at this point in the history
  • Loading branch information
Luthaf committed Dec 12, 2024
1 parent cf12d41 commit 80f4f96
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/featomic_torch/featomic/torch/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import numpy as np
import torch
from metatensor.torch.atomistic import System
from packaging import version

import featomic

Expand Down Expand Up @@ -86,7 +85,8 @@ def _is_torch_system(system):
if not isinstance(system, torch.ScriptObject):
return False

if version.parse(torch.__version__) >= version.parse("2.1"):
torch_version_tuple = tuple(map(int, torch.__version__.split(".")[:2]))
if torch_version_tuple >= (2, 1):
return system._type().name() == "System"

# For older torch version, we check that we have the right properties
Expand Down

0 comments on commit 80f4f96

Please sign in to comment.