Skip to content

Commit

Permalink
MAINT: Replace deprecated distutils.version
Browse files Browse the repository at this point in the history
  • Loading branch information
pastewka committed Jan 4, 2024
1 parent 236cabe commit ea8ab17
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions matscipy/io/opls.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

import time
import copy
import sys
import re
import distutils.version

from looseversion import LooseVersion

import numpy as np
import ase
Expand Down Expand Up @@ -359,7 +359,7 @@ def write_lammps_atoms(prefix, atoms, units='metal'):
fileobj.write('%d dihedral types\n' % (len(dtypes)))

# cell
if distutils.version.LooseVersion(ase_version_str) > distutils.version.LooseVersion('3.11.0'):
if LooseVersion(ase_version_str) > LooseVersion('3.11.0'):
p = ase.calculators.lammpsrun.Prism(atoms.get_cell())
else:
p = ase.calculators.lammpsrun.prism(atoms.get_cell())
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ dependencies = [
"numpy>=1.16.0",
"scipy>=1.2.3",
"ase>=3.16.0",
"looseversion"
]

[project.optional-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion tests/test_c2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import tempfile
import unittest

from distutils.version import LooseVersion
from looseversion import LooseVersion

class c2dCliTest(matscipytest.MatSciPyTestCase):
"""Tests c2d and pnp command line interfaces"""
Expand Down

0 comments on commit ea8ab17

Please sign in to comment.