3131
3232class DpfSolution :
3333 """Main class of post result API."""
34+
3435 def __init__ (self , data_sources , model ):
3536 """Initialization of the solution using data_sources
3637 and dpf.core.Model object."""
@@ -67,8 +68,11 @@ def _check_nodal_location(self, **kwargs):
6768 raise NodalLocationError ()
6869
6970 def __str__ (self ):
70- txt = '%s solution object.' % self ._model .metadata .result_info .analysis_type .capitalize () + \
71- '\n \n \n Data Sources\n ------------------------------\n '
71+ txt = (
72+ "%s solution object."
73+ % self ._model .metadata .result_info .analysis_type .capitalize ()
74+ + "\n \n \n Data Sources\n ------------------------------\n "
75+ )
7276 ds_str = self ._data_sources .__str__ ()
7377 txt += ds_str
7478 txt += "\n \n "
@@ -77,12 +81,11 @@ def __str__(self):
7781
7882
7983class DpfMecanicSolution (DpfSolution ):
80-
8184 def __init__ (self , data_sources , model ):
8285 super ().__init__ (data_sources , model )
8386 self .misc = MecanicMisc (model , data_sources )
8487
85- #result classes
88+ # result classes
8689 def stress (self , ** kwargs ):
8790 """Returns a stress object from which it is possible to get ResultData.
8891
@@ -113,7 +116,9 @@ def elastic_strain(self, **kwargs):
113116 >>> solution = post.load_solution(file.rst)
114117 >>> elastic_strain = solution.elastic_strain(node_scoping = [1, 43])
115118 """
116- return ElasticStrain (data_sources = self ._data_sources , model = self ._model , ** kwargs )
119+ return ElasticStrain (
120+ data_sources = self ._data_sources , model = self ._model , ** kwargs
121+ )
117122
118123 def plastic_strain (self , ** kwargs ):
119124 """Returns a plastic strain object from which it is possible to get ResultData.
@@ -129,7 +134,9 @@ def plastic_strain(self, **kwargs):
129134 >>> solution = post.load_solution(file.rst)
130135 >>> plastic_strain = solution.plastic_strain(node_scoping = [1, 43])
131136 """
132- return PlasticStrain (data_sources = self ._data_sources , model = self ._model , ** kwargs )
137+ return PlasticStrain (
138+ data_sources = self ._data_sources , model = self ._model , ** kwargs
139+ )
133140
134141 def displacement (self , ** kwargs ):
135142 """Returns a displacement object from which it is possible to get ResultData.
@@ -145,7 +152,9 @@ def displacement(self, **kwargs):
145152 >>> solution = post.load_solution(file.rst)
146153 >>> displacement = solution.displacement(node_scoping = [1, 43])
147154 """
148- return Displacement (data_sources = self ._data_sources , model = self ._model , ** kwargs )
155+ return Displacement (
156+ data_sources = self ._data_sources , model = self ._model , ** kwargs
157+ )
149158
150159 def structural_temperature (self , ** kwargs ):
151160 """Returns a temperature object from which it is possible to get ResultData.
@@ -161,11 +170,14 @@ def structural_temperature(self, **kwargs):
161170 >>> solution = post.load_solution(file.rst)
162171 >>> temperature = solution.structural_temperature(node_scoping = [1, 43])
163172 """
164- return StructuralTemperature (data_sources = self ._data_sources , model = self ._model , ** kwargs )
173+ return StructuralTemperature (
174+ data_sources = self ._data_sources , model = self ._model , ** kwargs
175+ )
165176
166177
167178class DpfMecanicComplexSolution (DpfSolution ):
168179 """Main class of post solution if the analysis gives complex solution (Modal, Harmonic)."""
180+
169181 def __init__ (self , data_sources , model ):
170182 super ().__init__ (data_sources , model )
171183 self .misc = ComplexMecanicMisc (model , data_sources )
@@ -185,7 +197,7 @@ def has_complex_result(self):
185197 tfq_sup = self ._model .metadata .time_freq_support
186198 if not tfq_sup :
187199 return False
188- if ( tfq_sup .complex_frequencies == None ) :
200+ if tfq_sup .complex_frequencies == None :
189201 return False
190202 return True
191203
@@ -203,7 +215,9 @@ def displacement(self, **kwargs):
203215 >>> solution = post.load_solution(file.rst)
204216 >>> displacement = solution.displacement(node_scoping = [1, 43])
205217 """
206- return ComplexDisplacement (data_sources = self ._data_sources , model = self ._model , ** kwargs )
218+ return ComplexDisplacement (
219+ data_sources = self ._data_sources , model = self ._model , ** kwargs
220+ )
207221
208222 def structural_temperature (self , ** kwargs ):
209223 """Returns a temperature object from which it is possible to get ResultData.
@@ -219,7 +233,9 @@ def structural_temperature(self, **kwargs):
219233 >>> solution = post.load_solution(file.rst)
220234 >>> temperature = solution.structural_temperature(node_scoping = [1, 43])
221235 """
222- return ComplexStructuralTemperature (data_sources = self ._data_sources , model = self ._model , ** kwargs )
236+ return ComplexStructuralTemperature (
237+ data_sources = self ._data_sources , model = self ._model , ** kwargs
238+ )
223239
224240 def plastic_strain (self , ** kwargs ):
225241 """Returns a plastic strain object from which it is possible to get ResultData.
@@ -235,7 +251,9 @@ def plastic_strain(self, **kwargs):
235251 >>> solution = post.load_solution(file.rst)
236252 >>> plastic_strain = solution.plastic_strain(node_scoping = [1, 43])
237253 """
238- return ComplexPlasticStrain (data_sources = self ._data_sources , model = self ._model , ** kwargs )
254+ return ComplexPlasticStrain (
255+ data_sources = self ._data_sources , model = self ._model , ** kwargs
256+ )
239257
240258 def elastic_strain (self , ** kwargs ):
241259 """Returns an elastic strain object from which it is possible to get ResultData.
@@ -251,7 +269,9 @@ def elastic_strain(self, **kwargs):
251269 >>> solution = post.load_solution(file.rst)
252270 >>> elastic_strain = solution.elastic_strain(node_scoping = [1, 43])
253271 """
254- return ComplexElasticStrain (data_sources = self ._data_sources , model = self ._model , ** kwargs )
272+ return ComplexElasticStrain (
273+ data_sources = self ._data_sources , model = self ._model , ** kwargs
274+ )
255275
256276 def stress (self , ** kwargs ):
257277 """Returns a stress object from which it is possible to get ResultData.
@@ -267,14 +287,17 @@ def stress(self, **kwargs):
267287 >>> solution = post.load_solution(file.rst)
268288 >>> stress = solution.stress(node_scoping = [1, 43])
269289 """
270- return ComplexStress (data_sources = self ._data_sources , model = self ._model , ** kwargs )
290+ return ComplexStress (
291+ data_sources = self ._data_sources , model = self ._model , ** kwargs
292+ )
271293
272294
273295class DpfThermalSolution (DpfSolution ):
274296 """Main class of post solution if thermal analysis."""
297+
275298 def __init__ (self , data_sources , model ):
276299 super ().__init__ (data_sources , model )
277- #self.misc = ThermalMisc(model, data_sources)
300+ # self.misc = ThermalMisc(model, data_sources)
278301
279302 def __str__ (self ):
280303 txt = super ().__str__ ()
@@ -330,7 +353,9 @@ def electric_potential(self, **kwargs):
330353 >>> ep = solution.electric_potential(node_scoping = [1, 43])
331354 """
332355 self ._check_nodal_location (** kwargs )
333- return ElectricPotential (data_sources = self ._data_sources , model = self ._model , ** kwargs )
356+ return ElectricPotential (
357+ data_sources = self ._data_sources , model = self ._model , ** kwargs
358+ )
334359
335360 def electric_field (self , ** kwargs ):
336361 """Returns an electric field object from which it is possible to get ResultData.
@@ -346,4 +371,6 @@ def electric_field(self, **kwargs):
346371 >>> solution = post.load_solution(file.rst)
347372 >>> ef = solution.electric_field(node_scoping = [1, 43])
348373 """
349- return ElectricField (data_sources = self ._data_sources , model = self ._model , ** kwargs )
374+ return ElectricField (
375+ data_sources = self ._data_sources , model = self ._model , ** kwargs
376+ )
0 commit comments