@@ -451,11 +451,11 @@ def as_dict(self):
451
451
raise NotImplementedError
452
452
453
453
@classmethod
454
- def from_dict (cls , d ) :
454
+ def from_dict (cls , dct ) -> AbstractChemenvStrategy :
455
455
"""
456
456
Reconstructs the SimpleAbundanceChemenvStrategy object from a dict representation of the
457
457
SimpleAbundanceChemenvStrategy object created using the as_dict method.
458
- :param d : dict representation of the SimpleAbundanceChemenvStrategy object
458
+ :param dct : dict representation of the SimpleAbundanceChemenvStrategy object
459
459
460
460
Returns:
461
461
StructureEnvironments object.
@@ -819,21 +819,21 @@ def as_dict(self):
819
819
}
820
820
821
821
@classmethod
822
- def from_dict (cls , d ) :
822
+ def from_dict (cls , dct : dict ) -> SimplestChemenvStrategy :
823
823
"""
824
824
Reconstructs the SimplestChemenvStrategy object from a dict representation of the SimplestChemenvStrategy object
825
825
created using the as_dict method.
826
- :param d : dict representation of the SimplestChemenvStrategy object
826
+ :param dct : dict representation of the SimplestChemenvStrategy object
827
827
828
828
Returns:
829
829
StructureEnvironments object.
830
830
"""
831
831
return cls (
832
- distance_cutoff = d ["distance_cutoff" ],
833
- angle_cutoff = d ["angle_cutoff" ],
834
- additional_condition = d ["additional_condition" ],
835
- continuous_symmetry_measure_cutoff = d ["continuous_symmetry_measure_cutoff" ],
836
- symmetry_measure_type = d ["symmetry_measure_type" ],
832
+ distance_cutoff = dct ["distance_cutoff" ],
833
+ angle_cutoff = dct ["angle_cutoff" ],
834
+ additional_condition = dct ["additional_condition" ],
835
+ continuous_symmetry_measure_cutoff = dct ["continuous_symmetry_measure_cutoff" ],
836
+ symmetry_measure_type = dct ["symmetry_measure_type" ],
837
837
)
838
838
839
839
@@ -1017,16 +1017,16 @@ def as_dict(self):
1017
1017
}
1018
1018
1019
1019
@classmethod
1020
- def from_dict (cls , d ) :
1020
+ def from_dict (cls , dct : dict ) -> SimpleAbundanceChemenvStrategy :
1021
1021
"""
1022
1022
Reconstructs the SimpleAbundanceChemenvStrategy object from a dict representation of the
1023
1023
SimpleAbundanceChemenvStrategy object created using the as_dict method.
1024
- :param d : dict representation of the SimpleAbundanceChemenvStrategy object
1024
+ :param dct : dict representation of the SimpleAbundanceChemenvStrategy object
1025
1025
1026
1026
Returns:
1027
1027
StructureEnvironments object.
1028
1028
"""
1029
- return cls (additional_condition = d ["additional_condition" ])
1029
+ return cls (additional_condition = dct ["additional_condition" ])
1030
1030
1031
1031
1032
1032
class TargetedPenaltiedAbundanceChemenvStrategy (SimpleAbundanceChemenvStrategy ):
@@ -1185,21 +1185,21 @@ def __eq__(self, other: object) -> bool:
1185
1185
)
1186
1186
1187
1187
@classmethod
1188
- def from_dict (cls , d ) :
1188
+ def from_dict (cls , dct ) -> TargetedPenaltiedAbundanceChemenvStrategy :
1189
1189
"""
1190
1190
Reconstructs the TargetedPenaltiedAbundanceChemenvStrategy object from a dict representation of the
1191
1191
TargetedPenaltiedAbundanceChemenvStrategy object created using the as_dict method.
1192
- :param d : dict representation of the TargetedPenaltiedAbundanceChemenvStrategy object
1192
+ :param dct : dict representation of the TargetedPenaltiedAbundanceChemenvStrategy object
1193
1193
1194
1194
Returns:
1195
1195
TargetedPenaltiedAbundanceChemenvStrategy object.
1196
1196
"""
1197
1197
return cls (
1198
- additional_condition = d ["additional_condition" ],
1199
- max_nabundant = d ["max_nabundant" ],
1200
- target_environments = d ["target_environments" ],
1201
- target_penalty_type = d ["target_penalty_type" ],
1202
- max_csm = d ["max_csm" ],
1198
+ additional_condition = dct ["additional_condition" ],
1199
+ max_nabundant = dct ["max_nabundant" ],
1200
+ target_environments = dct ["target_environments" ],
1201
+ target_penalty_type = dct ["target_penalty_type" ],
1202
+ max_csm = dct ["max_csm" ],
1203
1203
)
1204
1204
1205
1205
@@ -2812,20 +2812,20 @@ def as_dict(self):
2812
2812
}
2813
2813
2814
2814
@classmethod
2815
- def from_dict (cls , d ) :
2815
+ def from_dict (cls , dct ) -> WeightedNbSetChemenvStrategy :
2816
2816
"""
2817
2817
Reconstructs the WeightedNbSetChemenvStrategy object from a dict representation of the
2818
2818
WeightedNbSetChemenvStrategy object created using the as_dict method.
2819
- :param d : dict representation of the WeightedNbSetChemenvStrategy object
2819
+ :param dct : dict representation of the WeightedNbSetChemenvStrategy object
2820
2820
2821
2821
Returns:
2822
2822
WeightedNbSetChemenvStrategy object.
2823
2823
"""
2824
2824
return cls (
2825
- additional_condition = d ["additional_condition" ],
2826
- symmetry_measure_type = d ["symmetry_measure_type" ],
2827
- nb_set_weights = d ["nb_set_weights" ],
2828
- ce_estimator = d ["ce_estimator" ],
2825
+ additional_condition = dct ["additional_condition" ],
2826
+ symmetry_measure_type = dct ["symmetry_measure_type" ],
2827
+ nb_set_weights = dct ["nb_set_weights" ],
2828
+ ce_estimator = dct ["ce_estimator" ],
2829
2829
)
2830
2830
2831
2831
@@ -2985,35 +2985,35 @@ def as_dict(self):
2985
2985
}
2986
2986
2987
2987
@classmethod
2988
- def from_dict (cls , d ) :
2988
+ def from_dict (cls , dct ) -> MultiWeightsChemenvStrategy :
2989
2989
"""
2990
2990
Reconstructs the MultiWeightsChemenvStrategy object from a dict representation of the
2991
2991
MultipleAbundanceChemenvStrategy object created using the as_dict method.
2992
- :param d : dict representation of the MultiWeightsChemenvStrategy object
2992
+ :param dct : dict representation of the MultiWeightsChemenvStrategy object
2993
2993
2994
2994
Returns:
2995
2995
MultiWeightsChemenvStrategy object.
2996
2996
"""
2997
- if d ["normalized_angle_distance_weight" ] is not None :
2998
- nad_w = NormalizedAngleDistanceNbSetWeight .from_dict (d ["normalized_angle_distance_weight" ])
2997
+ if dct ["normalized_angle_distance_weight" ] is not None :
2998
+ nad_w = NormalizedAngleDistanceNbSetWeight .from_dict (dct ["normalized_angle_distance_weight" ])
2999
2999
else :
3000
3000
nad_w = None
3001
3001
return cls (
3002
- additional_condition = d ["additional_condition" ],
3003
- symmetry_measure_type = d ["symmetry_measure_type" ],
3004
- dist_ang_area_weight = DistanceAngleAreaNbSetWeight .from_dict (d ["dist_ang_area_weight" ])
3005
- if d ["dist_ang_area_weight" ] is not None
3002
+ additional_condition = dct ["additional_condition" ],
3003
+ symmetry_measure_type = dct ["symmetry_measure_type" ],
3004
+ dist_ang_area_weight = DistanceAngleAreaNbSetWeight .from_dict (dct ["dist_ang_area_weight" ])
3005
+ if dct ["dist_ang_area_weight" ] is not None
3006
3006
else None ,
3007
- self_csm_weight = SelfCSMNbSetWeight .from_dict (d ["self_csm_weight" ])
3008
- if d ["self_csm_weight" ] is not None
3007
+ self_csm_weight = SelfCSMNbSetWeight .from_dict (dct ["self_csm_weight" ])
3008
+ if dct ["self_csm_weight" ] is not None
3009
3009
else None ,
3010
- delta_csm_weight = DeltaCSMNbSetWeight .from_dict (d ["delta_csm_weight" ])
3011
- if d ["delta_csm_weight" ] is not None
3010
+ delta_csm_weight = DeltaCSMNbSetWeight .from_dict (dct ["delta_csm_weight" ])
3011
+ if dct ["delta_csm_weight" ] is not None
3012
3012
else None ,
3013
- cn_bias_weight = CNBiasNbSetWeight .from_dict (d ["cn_bias_weight" ])
3014
- if d ["cn_bias_weight" ] is not None
3013
+ cn_bias_weight = CNBiasNbSetWeight .from_dict (dct ["cn_bias_weight" ])
3014
+ if dct ["cn_bias_weight" ] is not None
3015
3015
else None ,
3016
- angle_weight = AngleNbSetWeight .from_dict (d ["angle_weight" ]) if d ["angle_weight" ] is not None else None ,
3016
+ angle_weight = AngleNbSetWeight .from_dict (dct ["angle_weight" ]) if dct ["angle_weight" ] is not None else None ,
3017
3017
normalized_angle_distance_weight = nad_w ,
3018
- ce_estimator = d ["ce_estimator" ],
3018
+ ce_estimator = dct ["ce_estimator" ],
3019
3019
)
0 commit comments