Skip to content

Commit

Permalink
Run isort on the code
Browse files Browse the repository at this point in the history
  • Loading branch information
Luthaf committed Aug 27, 2022
1 parent 60c6ec1 commit e794a8d
Show file tree
Hide file tree
Showing 21 changed files with 105 additions and 57 deletions.
19 changes: 12 additions & 7 deletions chemfiles/__init__.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
# -*- coding=utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals

from .misc import ChemfilesError, set_warnings_callback, add_configuration
from .misc import formats_list, guess_format
from .atom import Atom
from .residue import Residue
from .topology import Topology, BondOrder
from .cell import UnitCell, CellShape
from .cell import CellShape, UnitCell
from .frame import Frame
from .trajectory import Trajectory, MemoryTrajectory
from .selection import Selection
from .misc import (
ChemfilesError,
add_configuration,
formats_list,
guess_format,
set_warnings_callback,
)
from .property import Property
from .residue import Residue
from .selection import Selection
from .topology import BondOrder, Topology
from .trajectory import MemoryTrajectory, Trajectory

__version__ = "0.10.2"
5 changes: 3 additions & 2 deletions chemfiles/atom.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# -*- coding=utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from ctypes import c_double, c_uint64, c_char_p

from .utils import CxxPointer, _call_with_growing_buffer, string_type
from ctypes import c_char_p, c_double, c_uint64

from .misc import ChemfilesError
from .property import Property
from .utils import CxxPointer, _call_with_growing_buffer, string_type


class Atom(CxxPointer):
Expand Down
6 changes: 4 additions & 2 deletions chemfiles/cell.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# -*- coding=utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from ctypes import c_double, ARRAY

from ctypes import ARRAY, c_double
from enum import IntEnum

import numpy as np

from .utils import CxxPointer, ChemfilesError
from ._c_api import chfl_cellshape, chfl_vector3d
from .utils import ChemfilesError, CxxPointer


class CellShape(IntEnum):
Expand Down
12 changes: 7 additions & 5 deletions chemfiles/frame.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# -*- coding=utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals

from ctypes import POINTER, c_bool, c_char_p, c_double, c_uint64

import numpy as np
from ctypes import c_uint64, c_bool, c_double, c_char_p, POINTER

from .utils import CxxPointer, string_type
from .misc import ChemfilesError
from ._c_api import chfl_vector3d, chfl_bond_order
from ._c_api import chfl_bond_order, chfl_vector3d
from .atom import Atom
from .topology import Topology
from .cell import UnitCell
from .misc import ChemfilesError
from .property import Property
from .topology import Topology
from .utils import CxxPointer, string_type


class FrameAtoms(object):
Expand Down
4 changes: 2 additions & 2 deletions chemfiles/misc.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# -*- coding=utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import warnings

from ctypes import c_uint64, POINTER, create_string_buffer
import warnings
from ctypes import POINTER, c_uint64, create_string_buffer

from ._c_lib import _get_c_library

Expand Down
4 changes: 3 additions & 1 deletion chemfiles/property.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# -*- coding=utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals

import sys
from ctypes import c_bool, c_double

import numpy as np
from ctypes import c_double, c_bool

from ._c_api import chfl_property_kind, chfl_vector3d
from .misc import ChemfilesError
Expand Down
6 changes: 4 additions & 2 deletions chemfiles/residue.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# -*- coding=utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from ctypes import c_bool, c_int64, c_uint64, c_char_p

from ctypes import c_bool, c_char_p, c_int64, c_uint64

import numpy as np

from .utils import CxxPointer, _call_with_growing_buffer, string_type
from .misc import ChemfilesError
from .property import Property
from .utils import CxxPointer, _call_with_growing_buffer, string_type


class ResidueAtoms(object):
Expand Down
3 changes: 2 additions & 1 deletion chemfiles/selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
from __future__ import absolute_import, print_function, unicode_literals

from ctypes import c_uint64

import numpy as np

from .utils import CxxPointer, _call_with_growing_buffer
from ._c_api import chfl_match
from .utils import CxxPointer, _call_with_growing_buffer


class Selection(CxxPointer):
Expand Down
6 changes: 4 additions & 2 deletions chemfiles/topology.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# -*- coding=utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from ctypes import c_uint64, c_bool

from ctypes import c_bool, c_uint64
from enum import IntEnum

import numpy as np

from .utils import CxxPointer
from ._c_api import chfl_bond_order
from .atom import Atom
from .residue import Residue
from .utils import CxxPointer


class BondOrder(IntEnum):
Expand Down
5 changes: 3 additions & 2 deletions chemfiles/trajectory.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# -*- coding=utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from ctypes import c_uint64, c_char_p

import sys
from ctypes import c_char_p, c_uint64

from .utils import CxxPointer, _call_with_growing_buffer
from .frame import Frame, Topology
from .misc import ChemfilesError
from .utils import CxxPointer, _call_with_growing_buffer

# Python 2 compatibility
if sys.hexversion >= 0x03000000:
Expand Down
4 changes: 2 additions & 2 deletions chemfiles/utils.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# -*- coding=utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals

import sys
from ctypes import create_string_buffer, c_uint64
from ctypes import c_uint64, create_string_buffer

from ._c_lib import _get_c_library
from .misc import ChemfilesError, _last_error


if sys.version_info >= (3, 0):
string_type = str
else:
Expand Down
6 changes: 4 additions & 2 deletions tests/atom.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# -*- coding=utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import unittest

import copy
import unittest

from chemfiles import Atom, ChemfilesError
from _utils import remove_warnings

from chemfiles import Atom, ChemfilesError


class TestAtom(unittest.TestCase):
def test_repr(self):
Expand Down
7 changes: 4 additions & 3 deletions tests/cell.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# -*- coding=utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import unittest

import copy
import unittest

from chemfiles import UnitCell, CellShape
from chemfiles import ChemfilesError
from _utils import remove_warnings

from chemfiles import CellShape, ChemfilesError, UnitCell


class TestUnitCell(unittest.TestCase):
def test_repr(self):
Expand Down
9 changes: 5 additions & 4 deletions tests/examples.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# -*- coding=utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import unittest
import tempfile
import shutil

import os
import shutil
import tempfile
import unittest

from chemfiles import Trajectory, Frame, Atom
from chemfiles import Atom, Frame, Trajectory

ROOT = os.path.dirname(__file__)

Expand Down
18 changes: 14 additions & 4 deletions tests/frame.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
# -*- coding=utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import unittest

import copy
import math
import numpy as np
import unittest

from chemfiles import Frame, UnitCell, Topology, Atom, Residue, ChemfilesError
from chemfiles import BondOrder, CellShape
import numpy as np
from _utils import remove_warnings

from chemfiles import (
Atom,
BondOrder,
CellShape,
ChemfilesError,
Frame,
Residue,
Topology,
UnitCell,
)


class TestFrame(unittest.TestCase):
def test_repr(self):
Expand Down
3 changes: 2 additions & 1 deletion tests/misc.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# -*- coding=utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals

import unittest
import warnings

import chemfiles
from chemfiles import Trajectory, ChemfilesError
from chemfiles import ChemfilesError, Trajectory


class RemoveChemfilesWarnings(object):
Expand Down
6 changes: 4 additions & 2 deletions tests/property.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# -*- coding=utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import unittest

import copy
import unittest

import numpy as np

from chemfiles import Property, ChemfilesError
from chemfiles import ChemfilesError, Property


class TestProperty(unittest.TestCase):
Expand Down
8 changes: 5 additions & 3 deletions tests/residue.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# -*- coding=utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import unittest

import copy
import numpy as np
import unittest

from chemfiles import Residue, ChemfilesError
import numpy as np
from _utils import remove_warnings

from chemfiles import ChemfilesError, Residue


class TestResidue(unittest.TestCase):
def test_repr(self):
Expand Down
5 changes: 3 additions & 2 deletions tests/selection.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# -*- coding=utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import unittest

import copy
import unittest

from chemfiles import Selection, Topology, Frame, Atom
from chemfiles import Atom, Frame, Selection, Topology


def testing_frame():
Expand Down
8 changes: 5 additions & 3 deletions tests/topology.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# -*- coding=utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import unittest

import copy
import numpy as np
import unittest

from chemfiles import Topology, Atom, Residue, BondOrder, ChemfilesError
import numpy as np
from _utils import remove_warnings

from chemfiles import Atom, BondOrder, ChemfilesError, Residue, Topology


class TestTopology(unittest.TestCase):
def test_repr(self):
Expand Down
18 changes: 13 additions & 5 deletions tests/trajectory.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
# -*- coding=utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import unittest
import numpy as np
import os

from chemfiles import Trajectory, MemoryTrajectory, Topology, Frame, UnitCell, Atom
from chemfiles import ChemfilesError
import os
import unittest

import numpy as np
from _utils import remove_warnings

from chemfiles import (
Atom,
ChemfilesError,
Frame,
MemoryTrajectory,
Topology,
Trajectory,
UnitCell,
)

EXPECTED_XYZ_TRAJECTORY = """4
Properties=species:S:1:pos:R:3
X 1 2 3
Expand Down

0 comments on commit e794a8d

Please sign in to comment.