Skip to content

Commit 186330a

Browse files
authored
Remove unused module imports (#33)
* Remove unused imports * Update flake8 config
1 parent f486b9e commit 186330a

17 files changed

+49
-74
lines changed

.flake8

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[flake8]
2-
# To be added once code is refactored: E501, F401
3-
select = W191, W291, W293, W391, E115, E117, E122, E124, E125, E225, E231, E301, E303, F403
2+
# To be added once code is refactored: E501
3+
select = W191, W291, W293, W391, E115, E117, E122, E124, E125, E225, E231, E301, E303, F401, F403
4+
per-file-ignores = __init__.py:F401
45
count = True
56
max-complexity = 10
67
max-line-length = 100

ansys/dpf/post/common.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
"""Module containing the common tools for a better usage of the DPF-Post module."""
22

3-
from enum import Enum
4-
53

64
# class ElShapes(Enum):
75
# """Class with Enum inheritance. Must be used to

ansys/dpf/post/dpf_solution.py

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,26 @@
88
"""
99

1010

11-
from ansys.dpf.post.common import _AvailableKeywords
12-
from ansys.dpf.core import Operator as _Operator
1311
from ansys.dpf.core import locations
14-
15-
from ansys.dpf.post.stress import Stress, ComplexStress
16-
from ansys.dpf.post.strain import ElasticStrain, ComplexElasticStrain
17-
from ansys.dpf.post.strain import PlasticStrain, ComplexPlasticStrain
18-
from ansys.dpf.post.temperature import StructuralTemperature
19-
from ansys.dpf.post.temperature import ComplexStructuralTemperature
20-
from ansys.dpf.post.temperature import Temperature, HeatFlux
21-
from ansys.dpf.post.displacement import Displacement, ComplexDisplacement
12+
from ansys.dpf.post.common import _AvailableKeywords
13+
from ansys.dpf.post.displacement import ComplexDisplacement, Displacement
2214
from ansys.dpf.post.electric_results import ElectricField, ElectricPotential
23-
24-
from ansys.dpf.post.misc_results import Misc, MecanicMisc, ComplexMecanicMisc, ThermalMisc
25-
2615
from ansys.dpf.post.errors import NodalLocationError
16+
from ansys.dpf.post.misc_results import ComplexMecanicMisc, MecanicMisc
17+
from ansys.dpf.post.strain import (
18+
ComplexElasticStrain,
19+
ComplexPlasticStrain,
20+
ElasticStrain,
21+
PlasticStrain,
22+
)
23+
from ansys.dpf.post.stress import ComplexStress, Stress
24+
from ansys.dpf.post.temperature import (
25+
ComplexStructuralTemperature,
26+
HeatFlux,
27+
StructuralTemperature,
28+
Temperature,
29+
)
30+
2731

2832
class DpfSolution:
2933
"""Main class of post result API."""

ansys/dpf/post/electric_results.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
"""This module contains the electric results class ."""
22

3+
from ansys.dpf.post.common import _AvailableKeywords
34
from ansys.dpf.post.scalar import Scalar
45
from ansys.dpf.post.vector import Vector
5-
from ansys.dpf.core.common import locations
6-
from ansys.dpf.post.common import _AvailableKeywords
76

87

98
class ElectricField(Vector):

ansys/dpf/post/misc.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
import platform
2-
import glob
3-
import os
4-
from pkgutil import iter_modules
5-
61
from scooby import Report as ScoobyReport
72

83

ansys/dpf/post/misc_results.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
"""This module contains all the miscallenous results."""
22

3-
from ansys.dpf.post.result_data import ResultData
4-
from ansys.dpf.post.common import _AvailableKeywords
5-
from ansys.dpf.core import locations
6-
from ansys.dpf.post import dpf_solution
73
from ansys.dpf.core import Operator as _Operator
4+
from ansys.dpf.core import locations
5+
from ansys.dpf.post.common import _AvailableKeywords
6+
from ansys.dpf.post.result_data import ResultData
7+
88

99
class Misc():
1010
"""This class contains miscellaneous results.

ansys/dpf/post/result_data.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,8 @@
44
This is a fields container wrapper."""
55

66
from textwrap import wrap
7-
import os
8-
import sys
97

10-
import pyvista as pv
11-
import matplotlib.pyplot as pyplot
12-
13-
from ansys.dpf.core import Operator, FieldsContainer
8+
from ansys.dpf.core import FieldsContainer, Operator
149
from ansys.dpf.core.common import types
1510
from ansys.dpf.core.plotter import Plotter as DpfPlotter
1611
from ansys.dpf.post.result_evaluation import ResultEvaluator

ansys/dpf/post/result_object.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
"""This module contains the super class of the
22
stress/strain/structural_temperature/displacement objects."""
33

4-
from ansys.dpf.core.common import locations
54
from ansys.dpf.core import Operator
65
from ansys.dpf.post.result_data import ResultData
76
from ansys.dpf.post.result_definition import Definition
87

8+
99
class Result:
1010
def __init__(self, data_sources, model, **kwargs):
1111
self._data_sources = data_sources

tests/test_basics.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
import os
2-
3-
from ansys import dpf
41
from ansys.dpf import post
52
from ansys.dpf.post.common import _AnalysisType
6-
from ansys.dpf.post.static_analysis import StaticAnalysisSolution
7-
from ansys.dpf.post.modal_analysis import ModalAnalysisSolution
83
from ansys.dpf.post.harmonic_analysis import HarmonicAnalysisSolution
4+
from ansys.dpf.post.modal_analysis import ModalAnalysisSolution
5+
from ansys.dpf.post.static_analysis import StaticAnalysisSolution
96
from ansys.dpf.post.transient_analysis import TransientAnalysisSolution
107

118

tests/test_common.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from ansys import dpf
21
from ansys.dpf import post
32

43

0 commit comments

Comments
 (0)