Skip to content

Commit adf5af6

Browse files
authored
Switch macOS wheel building to new M1 runners (#3596)
* more descriptive variable names * prefer list += other over list.extend(other) * run macOS wheel building on faster, now free M1 runners
1 parent 7dd059c commit adf5af6

37 files changed

+401
-452
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ jobs:
113113
needs: test
114114
strategy:
115115
matrix:
116-
os: [ubuntu-latest, macos-latest, windows-latest]
116+
os: [ubuntu-latest, macos-14, windows-latest]
117117
python-version: ["39", "310", "311"]
118118
runs-on: ${{ matrix.os }}
119119
steps:

pymatgen/analysis/chemenv/coordination_environments/chemenv_strategies.py

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -451,11 +451,11 @@ def as_dict(self):
451451
raise NotImplementedError
452452

453453
@classmethod
454-
def from_dict(cls, d):
454+
def from_dict(cls, dct) -> AbstractChemenvStrategy:
455455
"""
456456
Reconstructs the SimpleAbundanceChemenvStrategy object from a dict representation of the
457457
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
459459
460460
Returns:
461461
StructureEnvironments object.
@@ -819,21 +819,21 @@ def as_dict(self):
819819
}
820820

821821
@classmethod
822-
def from_dict(cls, d):
822+
def from_dict(cls, dct: dict) -> SimplestChemenvStrategy:
823823
"""
824824
Reconstructs the SimplestChemenvStrategy object from a dict representation of the SimplestChemenvStrategy object
825825
created using the as_dict method.
826-
:param d: dict representation of the SimplestChemenvStrategy object
826+
:param dct: dict representation of the SimplestChemenvStrategy object
827827
828828
Returns:
829829
StructureEnvironments object.
830830
"""
831831
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"],
837837
)
838838

839839

@@ -1017,16 +1017,16 @@ def as_dict(self):
10171017
}
10181018

10191019
@classmethod
1020-
def from_dict(cls, d):
1020+
def from_dict(cls, dct: dict) -> SimpleAbundanceChemenvStrategy:
10211021
"""
10221022
Reconstructs the SimpleAbundanceChemenvStrategy object from a dict representation of the
10231023
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
10251025
10261026
Returns:
10271027
StructureEnvironments object.
10281028
"""
1029-
return cls(additional_condition=d["additional_condition"])
1029+
return cls(additional_condition=dct["additional_condition"])
10301030

10311031

10321032
class TargetedPenaltiedAbundanceChemenvStrategy(SimpleAbundanceChemenvStrategy):
@@ -1185,21 +1185,21 @@ def __eq__(self, other: object) -> bool:
11851185
)
11861186

11871187
@classmethod
1188-
def from_dict(cls, d):
1188+
def from_dict(cls, dct) -> TargetedPenaltiedAbundanceChemenvStrategy:
11891189
"""
11901190
Reconstructs the TargetedPenaltiedAbundanceChemenvStrategy object from a dict representation of the
11911191
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
11931193
11941194
Returns:
11951195
TargetedPenaltiedAbundanceChemenvStrategy object.
11961196
"""
11971197
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"],
12031203
)
12041204

12051205

@@ -2812,20 +2812,20 @@ def as_dict(self):
28122812
}
28132813

28142814
@classmethod
2815-
def from_dict(cls, d):
2815+
def from_dict(cls, dct) -> WeightedNbSetChemenvStrategy:
28162816
"""
28172817
Reconstructs the WeightedNbSetChemenvStrategy object from a dict representation of the
28182818
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
28202820
28212821
Returns:
28222822
WeightedNbSetChemenvStrategy object.
28232823
"""
28242824
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"],
28292829
)
28302830

28312831

@@ -2985,35 +2985,35 @@ def as_dict(self):
29852985
}
29862986

29872987
@classmethod
2988-
def from_dict(cls, d):
2988+
def from_dict(cls, dct) -> MultiWeightsChemenvStrategy:
29892989
"""
29902990
Reconstructs the MultiWeightsChemenvStrategy object from a dict representation of the
29912991
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
29932993
29942994
Returns:
29952995
MultiWeightsChemenvStrategy object.
29962996
"""
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"])
29992999
else:
30003000
nad_w = None
30013001
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
30063006
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
30093009
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
30123012
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
30153015
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,
30173017
normalized_angle_distance_weight=nad_w,
3018-
ce_estimator=d["ce_estimator"],
3018+
ce_estimator=dct["ce_estimator"],
30193019
)

pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1947,8 +1947,7 @@ def _cg_csm_separation_plane_optim2(
19471947
sep2 = separation_indices[2]
19481948
# separation_perm = list(sep0)
19491949
ordind = local_plane.project_and_to2dim_ordered_indices(inp)
1950-
# separation_perm.extend(
1951-
# [separation_indices[1][ii] for ii in ordind])
1950+
# separation_perm.extend([separation_indices[1][ii] for ii in ordind])
19521951
inp1 = separation_indices[1].take(ordind)
19531952
# separation_perm.extend(sep2)
19541953
separation_perm = np.concatenate((sep0, inp1, sep2))

0 commit comments

Comments
 (0)