@@ -320,8 +320,7 @@ def snyder_total(self, structure: Structure) -> float:
320
320
321
321
@raise_if_unphysical
322
322
def clarke_thermalcond (self , structure : Structure ) -> float :
323
- """
324
- Calculates Clarke's thermal conductivity (in SI units).
323
+ """Calculates Clarke's thermal conductivity.
325
324
326
325
Args:
327
326
structure: pymatgen structure object
@@ -339,8 +338,7 @@ def clarke_thermalcond(self, structure: Structure) -> float:
339
338
340
339
@raise_if_unphysical
341
340
def cahill_thermalcond (self , structure : Structure ) -> float :
342
- """
343
- Calculates Cahill's thermal conductivity (in SI units).
341
+ """Calculate Cahill's thermal conductivity.
344
342
345
343
Args:
346
344
structure: pymatgen structure object
@@ -354,12 +352,11 @@ def cahill_thermalcond(self, structure: Structure) -> float:
354
352
355
353
@due .dcite (
356
354
Doi ("10.1039/C7EE03256K" ),
357
- description = "Minimum thermal conductivity in the context of diffuson -mediated thermal transport" ,
355
+ description = "Minimum thermal conductivity in the context of diffusion -mediated thermal transport" ,
358
356
)
359
357
@raise_if_unphysical
360
358
def agne_diffusive_thermalcond (self , structure : Structure ) -> float :
361
- """
362
- Calculates Agne's diffusive thermal conductivity (in SI units).
359
+ """Calculates Agne's diffusive thermal conductivity.
363
360
364
361
Please cite the original authors if using this method
365
362
M. T. Agne, R. Hanus, G. J. Snyder, Energy Environ. Sci. 2018, 11, 609-616.
@@ -397,23 +394,23 @@ def debye_temperature(self, structure: Structure) -> float:
397
394
return 1.05457e-34 / 1.38065e-23 * vm * (6 * np .pi ** 2 / v0 ) ** (1 / 3 )
398
395
399
396
@property
400
- def universal_anisotropy (self ):
397
+ def universal_anisotropy (self ) -> float :
401
398
"""Returns the universal anisotropy value."""
402
399
return 5 * self .g_voigt / self .g_reuss + self .k_voigt / self .k_reuss - 6.0
403
400
404
401
@property
405
- def homogeneous_poisson (self ):
402
+ def homogeneous_poisson (self ) -> float :
406
403
"""Returns the homogeneous poisson ratio."""
407
404
return (1 - 2 / 3 * self .g_vrh / self .k_vrh ) / (2 + 2 / 3 * self .g_vrh / self .k_vrh )
408
405
409
- def green_kristoffel (self , u ):
406
+ def green_kristoffel (self , u ) -> float :
410
407
"""Returns the Green-Kristoffel tensor for a second-order tensor."""
411
408
return self .einsum_sequence ([u , u ], "ijkl,i,l" )
412
409
413
410
@property
414
411
def property_dict (self ):
415
412
"""Returns a dictionary of properties derived from the elastic tensor."""
416
- props = [
413
+ props = (
417
414
"k_voigt" ,
418
415
"k_reuss" ,
419
416
"k_vrh" ,
@@ -423,7 +420,7 @@ def property_dict(self):
423
420
"universal_anisotropy" ,
424
421
"homogeneous_poisson" ,
425
422
"y_mod" ,
426
- ]
423
+ )
427
424
return {prop : getattr (self , prop ) for prop in props }
428
425
429
426
def get_structure_property_dict (
@@ -441,7 +438,7 @@ def get_structure_property_dict(
441
438
ignore_errors (bool): if set to true, will set problem properties
442
439
that depend on a physical tensor to None, defaults to False
443
440
"""
444
- s_props = [
441
+ s_props = (
445
442
"trans_v" ,
446
443
"long_v" ,
447
444
"snyder_ac" ,
@@ -450,7 +447,7 @@ def get_structure_property_dict(
450
447
"clarke_thermalcond" ,
451
448
"cahill_thermalcond" ,
452
449
"debye_temperature" ,
453
- ]
450
+ )
454
451
sp_dict : dict [str , float | Structure | None ]
455
452
if ignore_errors and (self .k_vrh < 0 or self .g_vrh < 0 ):
456
453
sp_dict = {prop : None for prop in s_props }
@@ -514,8 +511,8 @@ def from_independent_strains(cls, strains, stresses, eq_stress=None, vasp=False,
514
511
c_ij [ii , jj ] = np .polyfit (strains [:, ii ], stresses [:, jj ], 1 )[0 ]
515
512
if vasp :
516
513
c_ij *= - 0.1 # Convert units/sign convention of vasp stress tensor
517
- c = cls .from_voigt (c_ij )
518
- return c .zeroed (tol )
514
+ instance = cls .from_voigt (c_ij )
515
+ return instance .zeroed (tol )
519
516
520
517
521
518
class ComplianceTensor (Tensor ):
0 commit comments