Skip to content

Commit

Permalink
fmt: autoflake action
Browse files Browse the repository at this point in the history
  • Loading branch information
bhosale2 committed Aug 25, 2022
1 parent 7888efe commit f6e54e7
Show file tree
Hide file tree
Showing 48 changed files with 11 additions and 96 deletions.
1 change: 0 additions & 1 deletion elastica/_calculus.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
__doc__ = """ Quadrature and difference kernels """
import numpy as np
from numpy import zeros, empty
import numba
from numba import njit
from elastica.reset_functions_for_block_structure._reset_ghost_vector_or_scalar import (
_reset_vector_ghost,
Expand Down
1 change: 0 additions & 1 deletion elastica/_linalg.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
__doc__ = """ Convenient linear algebra kernels """
import numpy as np
import numba
from numba import njit
from numpy import sqrt
import functools
Expand Down
1 change: 0 additions & 1 deletion elastica/_rotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from numpy import sqrt
from numpy import arccos

import numba
from numba import njit

from elastica._linalg import _batch_matmul
Expand Down
1 change: 0 additions & 1 deletion elastica/boundary_conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

from abc import ABC, abstractmethod

import numba
from numba import njit

from elastica._linalg import _batch_matvec, _batch_matrix_transpose
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
__all__ = ["GenericSystemTypeFreeJoint", "GenericSystemTypeFixedJoint"]
from elastica.joint import FreeJoint, FixedJoint
from elastica.typing import SystemType
from elastica.utils import Tolerance, MaxDimension
import numpy as np
from typing import Optional

Expand Down
11 changes: 0 additions & 11 deletions elastica/experimental/interaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,16 @@

import numpy as np
from elastica.external_forces import NoForces
from elastica.interaction import *
from elastica.interaction import (
find_slipping_elements,
apply_normal_force_numba_rigid_body,
InteractionPlaneRigidBody,
)

import numba
from numba import njit
from elastica._linalg import (
_batch_matmul,
_batch_matvec,
_batch_cross,
_batch_norm,
_batch_dot,
_batch_product_i_k_to_ik,
_batch_product_i_ik_to_k,
_batch_product_k_ik_to_ik,
_batch_vector_sum,
_batch_matrix_transpose,
_batch_vec_oneD_vec_cross,
)


Expand Down
3 changes: 0 additions & 3 deletions elastica/external_forces.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
from elastica.typing import SystemType, RodType
from elastica.utils import _bspline

import numba
from numba import njit
from elastica._linalg import _batch_product_i_k_to_ik

Expand Down Expand Up @@ -52,9 +51,7 @@ def apply_forces(self, system: SystemType, time: np.float64 = 0.0):
Returns
-------
"""

pass

def apply_torques(self, system: SystemType, time: np.float64 = 0.0):
Expand Down
7 changes: 1 addition & 6 deletions elastica/memory_block/memory_block_rigid_body.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,10 @@
import numpy as np
from typing import Sequence

from elastica.rigidbody import RigidBodyBase, Cylinder
from elastica.rigidbody import RigidBodyBase

# from elastica.rigidbody.rigid_body import RigidBody
from elastica.rigidbody.data_structures import _RigidRodSymplecticStepperMixin
from elastica.rod.data_structures import _RodSymplecticStepperMixin
from elastica.reset_functions_for_block_structure import _reset_scalar_ghost
from elastica.rod.cosserat_rod import CosseratRod
from elastica.rigidbody import sphere, cylinder
from elastica._linalg import _batch_matvec, _batch_cross


class MemoryBlockRigidBody(RigidBodyBase, _RigidRodSymplecticStepperMixin):
Expand Down
1 change: 0 additions & 1 deletion elastica/modules/base_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from typing import Iterable, Callable, AnyStr

from collections.abc import MutableSequence
from itertools import chain

from elastica.rod import RodBase
from elastica.rigidbody import RigidBodyBase
Expand Down
1 change: 0 additions & 1 deletion elastica/modules/constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
Provides the constraints interface to enforce displacement boundary conditions (see `boundary_conditions.py`).
"""

import numpy as np
from elastica.boundary_conditions import ConstraintBase


Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
__doc__ = """Reset the ghost vectors or scalar variables using functions implemented in Numba"""

import numpy as np
import numba
from numba import njit


Expand Down
2 changes: 1 addition & 1 deletion elastica/rigidbody/data_structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import numpy as np

from elastica._rotations import _get_rotation_matrix, _rotate
from elastica._rotations import _get_rotation_matrix
from elastica.rod.data_structures import _RodSymplecticStepperMixin

"""
Expand Down
3 changes: 1 addition & 2 deletions elastica/rigidbody/rigid_body.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
__doc__ = """"""

import numpy as np
from abc import ABC, abstractmethod
from abc import ABC
from elastica._linalg import _batch_matvec, _batch_cross
from elastica.utils import MaxDimension


class RigidBodyBase(ABC):
Expand Down
1 change: 0 additions & 1 deletion elastica/rod/cosserat_rod.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
__doc__ = """ Rod classes and implementation details """
__all__ = ["CosseratRod"]

import typing

import numpy as np
import functools
Expand Down
1 change: 0 additions & 1 deletion elastica/rod/data_structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"_DynamicState",
]
import numpy as np
import numba
from numba import njit
from elastica._rotations import _get_rotation_matrix, _rotate
from elastica._linalg import _batch_matmul
Expand Down
6 changes: 1 addition & 5 deletions elastica/systems/analytical.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
__doc__ = "Analytically integrable systems, used primarily for testing time-steppers of Elastica Numba implementation"

import numpy as np
import numba
from elastica._rotations import _get_rotation_matrix, _rotate
from elastica._linalg import _batch_matmul
from elastica._rotations import _rotate
from elastica.rod.data_structures import _RodSymplecticStepperMixin
from elastica.rod.data_structures import _bootstrap_from_data
from elastica.rod.data_structures import _KinematicState, _DynamicState


class BaseStatefulSystem:
Expand Down
2 changes: 0 additions & 2 deletions elastica/timestepper/_stepper_interface.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
__doc__ = "Time stepper interface"

import numpy as np


class _TimeStepper:
"""Interface classes for all time-steppers"""
Expand Down
1 change: 0 additions & 1 deletion elastica/timestepper/symplectic_steppers.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
__doc__ = """Symplectic time steppers and concepts for integrating the kinematic and dynamic equations of rod-like objects. """

import numpy as np
import math

# from elastica._elastica_numba._timestepper._symplectic_steppers import (
# SymplecticStepperTag,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import numpy as np
from matplotlib import pyplot as plt
from matplotlib.colors import to_rgb
from mpl_toolkits import mplot3d
from scipy.spatial.transform import Rotation

from elastica.rigidbody import Cylinder
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import numpy as np
from matplotlib import pyplot as plt
from mpl_toolkits import mplot3d
from matplotlib.colors import to_rgb
from scipy.linalg import norm


Expand Down
1 change: 0 additions & 1 deletion examples/JointCases/joint_cases_postprocessing.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import numpy as np
from matplotlib import pyplot as plt
from matplotlib.colors import to_rgb
from mpl_toolkits import mplot3d
from scipy.spatial.transform import Rotation


Expand Down
1 change: 0 additions & 1 deletion examples/MuscularFlagella/connection_flagella.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
__doc__ = """Muscular flagella connection class Numba implementation. """
__all__ = ["MuscularFlagellaConnection"]
import numpy as np
import numba
from numba import njit
from elastica.joint import FreeJoint
from elastica._linalg import _batch_matvec
Expand Down
5 changes: 0 additions & 5 deletions examples/MuscularFlagella/post_processing.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import numpy as np
from matplotlib import pyplot as plt
from matplotlib.colors import to_rgb
from matplotlib import cm
from tqdm import tqdm

from typing import Dict, Sequence
Expand All @@ -18,8 +16,6 @@ def plot_video(

# 2d case <always 2d case for now>
import matplotlib.animation as animation
from matplotlib.patches import Circle
from mpl_toolkits.mplot3d import proj3d, Axes3D

# simulation time
sim_time = np.array(rods_history[0]["time"])
Expand Down Expand Up @@ -130,7 +126,6 @@ def plot_video_2D(

# 2d case <always 2d case for now>
import matplotlib.animation as animation
from matplotlib.patches import Circle

# simulation time
sim_time = np.array(rods_history[0]["time"])
Expand Down
1 change: 0 additions & 1 deletion examples/MuscularSnake/muscle_forces.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
__doc__ = """ Muscular snake muscle forces NumPy implementation """
__all__ = ["MuscleForces"]
import numpy as np
import numba
from numba import njit
from elastica import NoForces
from elastica._calculus import difference_kernel
Expand Down
1 change: 0 additions & 1 deletion examples/MuscularSnake/post_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from matplotlib import pyplot as plt
from matplotlib.colors import to_rgb
from matplotlib import cm
from mpl_toolkits.mplot3d import proj3d, Axes3D
from tqdm import tqdm

from typing import Dict, Sequence
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ def plot_video(
dpi = 50

# min_limits = np.roll(np.array([0.0, -0.5 * cylinder_height, 0.0]), _roll_key)
from mpl_toolkits.mplot3d import Axes3D

fig = plt.figure(1, figsize=(10, 8), frameon=True, dpi=dpi)
ax = plt.axes(projection="3d") # fig.add_subplot(111)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from elastica import *
from examples.RodContactCase.post_processing import (
plot_video_with_surface,
plot_velocity,
plot_link_writhe_twist,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from elastica import *
from examples.RodContactCase.post_processing import (
plot_video_with_surface,
plot_velocity,
plot_link_writhe_twist,
)

Expand Down
2 changes: 0 additions & 2 deletions examples/RodContactCase/post_processing.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import numpy as np
from matplotlib import pyplot as plt
from matplotlib.colors import to_rgb
from mpl_toolkits.mplot3d import proj3d, Axes3D
from tqdm import tqdm

from typing import Dict, Sequence
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from elastica.external_forces import GravityForces, MuscleTorques
from elastica.interaction import AnisotropicFrictionalPlane
from elastica.callback_functions import CallBackBaseClass
from elastica.timestepper.symplectic_steppers import PositionVerlet, PEFRL
from elastica.timestepper.symplectic_steppers import PositionVerlet
from elastica.timestepper import integrate


Expand Down
1 change: 0 additions & 1 deletion examples/Visualization/_povmacros.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"""

import os
import subprocess
from collections import defaultdict

Expand Down
1 change: 0 additions & 1 deletion examples/convergence_functions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import numpy as np
from matplotlib import pyplot as plt
from mpl_toolkits import mplot3d
from matplotlib.colors import to_rgb
from scipy.linalg import norm

Expand Down
1 change: 0 additions & 1 deletion tests/test_boundary_conditions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
__doc__ = """ Test Boundary conditions for in Elastica implementation"""
import sys

# System imports
import numpy as np
Expand Down
4 changes: 2 additions & 2 deletions tests/test_callback_functions.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
__doc__ = """ Call back functions for rod test module """
import os, sys
import os

# System imports
import logging
import numpy as np
from numpy.testing import assert_allclose, assert_array_equal
from numpy.testing import assert_allclose
from elastica.callback_functions import CallBackBaseClass, MyCallBack, ExportCallBack
from elastica.utils import Tolerance
import tempfile
Expand Down
3 changes: 0 additions & 3 deletions tests/test_data_structures.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
__doc__ = """ Data structures module import test"""

# System imports
import pytest
import importlib
import elastica


if __name__ == "__main__":
Expand Down
3 changes: 1 addition & 2 deletions tests/test_external_forces.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
__doc__ = """ External forcing for rod test module for Elastica implementation"""
import sys

# System imports
import numpy as np
from numpy.testing import assert_allclose, assert_array_equal
from numpy.testing import assert_allclose
import pytest

from elastica.external_forces import (
Expand Down
1 change: 0 additions & 1 deletion tests/test_math/test_governing_equations.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
_compute_bending_twist_strains,
_compute_damping_torques,
_compute_internal_torques,
_update_accelerations,
_get_z_vector,
)
import pytest
Expand Down
2 changes: 0 additions & 2 deletions tests/test_math/test_rotation_non_numba_impls.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
_skew_symmetrize_sq, # noqa
)

from elastica.utils import Tolerance


###############################################################################
##################### Implementation tests start ##############################
Expand Down
1 change: 0 additions & 1 deletion tests/test_math/test_timestepper.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,6 @@ class TestSteppersAgainstRodLikeSystems:
def test_symplectics_against_ellipse_motion(self, symplectic_stepper):
from elastica.systems.analytical import (
make_simple_system_with_positions_directors,
SimpleSystemWithPositionsDirectors,
)

random_start_position = np.random.randn(3, 1)
Expand Down
1 change: 0 additions & 1 deletion tests/test_modules/test_callbacks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
__doc__ = """ Test modules for callback """
import numpy as np
from numpy.testing import assert_allclose
import pytest

from elastica.modules import CallBacks
Expand Down
Loading

0 comments on commit f6e54e7

Please sign in to comment.