Skip to content

Commit

Permalink
Switch macOS wheel building to new M1 runners (#3596)
Browse files Browse the repository at this point in the history
* more descriptive variable names

* prefer list += other over list.extend(other)

* run macOS wheel building on faster, now free M1 runners
  • Loading branch information
janosh authored Jan 31, 2024
1 parent 7dd059c commit adf5af6
Show file tree
Hide file tree
Showing 37 changed files with 401 additions and 452 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ jobs:
needs: test
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest, macos-14, windows-latest]
python-version: ["39", "310", "311"]
runs-on: ${{ matrix.os }}
steps:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -451,11 +451,11 @@ def as_dict(self):
raise NotImplementedError

@classmethod
def from_dict(cls, d):
def from_dict(cls, dct) -> AbstractChemenvStrategy:
"""
Reconstructs the SimpleAbundanceChemenvStrategy object from a dict representation of the
SimpleAbundanceChemenvStrategy object created using the as_dict method.
:param d: dict representation of the SimpleAbundanceChemenvStrategy object
:param dct: dict representation of the SimpleAbundanceChemenvStrategy object
Returns:
StructureEnvironments object.
Expand Down Expand Up @@ -819,21 +819,21 @@ def as_dict(self):
}

@classmethod
def from_dict(cls, d):
def from_dict(cls, dct: dict) -> SimplestChemenvStrategy:
"""
Reconstructs the SimplestChemenvStrategy object from a dict representation of the SimplestChemenvStrategy object
created using the as_dict method.
:param d: dict representation of the SimplestChemenvStrategy object
:param dct: dict representation of the SimplestChemenvStrategy object
Returns:
StructureEnvironments object.
"""
return cls(
distance_cutoff=d["distance_cutoff"],
angle_cutoff=d["angle_cutoff"],
additional_condition=d["additional_condition"],
continuous_symmetry_measure_cutoff=d["continuous_symmetry_measure_cutoff"],
symmetry_measure_type=d["symmetry_measure_type"],
distance_cutoff=dct["distance_cutoff"],
angle_cutoff=dct["angle_cutoff"],
additional_condition=dct["additional_condition"],
continuous_symmetry_measure_cutoff=dct["continuous_symmetry_measure_cutoff"],
symmetry_measure_type=dct["symmetry_measure_type"],
)


Expand Down Expand Up @@ -1017,16 +1017,16 @@ def as_dict(self):
}

@classmethod
def from_dict(cls, d):
def from_dict(cls, dct: dict) -> SimpleAbundanceChemenvStrategy:
"""
Reconstructs the SimpleAbundanceChemenvStrategy object from a dict representation of the
SimpleAbundanceChemenvStrategy object created using the as_dict method.
:param d: dict representation of the SimpleAbundanceChemenvStrategy object
:param dct: dict representation of the SimpleAbundanceChemenvStrategy object
Returns:
StructureEnvironments object.
"""
return cls(additional_condition=d["additional_condition"])
return cls(additional_condition=dct["additional_condition"])


class TargetedPenaltiedAbundanceChemenvStrategy(SimpleAbundanceChemenvStrategy):
Expand Down Expand Up @@ -1185,21 +1185,21 @@ def __eq__(self, other: object) -> bool:
)

@classmethod
def from_dict(cls, d):
def from_dict(cls, dct) -> TargetedPenaltiedAbundanceChemenvStrategy:
"""
Reconstructs the TargetedPenaltiedAbundanceChemenvStrategy object from a dict representation of the
TargetedPenaltiedAbundanceChemenvStrategy object created using the as_dict method.
:param d: dict representation of the TargetedPenaltiedAbundanceChemenvStrategy object
:param dct: dict representation of the TargetedPenaltiedAbundanceChemenvStrategy object
Returns:
TargetedPenaltiedAbundanceChemenvStrategy object.
"""
return cls(
additional_condition=d["additional_condition"],
max_nabundant=d["max_nabundant"],
target_environments=d["target_environments"],
target_penalty_type=d["target_penalty_type"],
max_csm=d["max_csm"],
additional_condition=dct["additional_condition"],
max_nabundant=dct["max_nabundant"],
target_environments=dct["target_environments"],
target_penalty_type=dct["target_penalty_type"],
max_csm=dct["max_csm"],
)


Expand Down Expand Up @@ -2812,20 +2812,20 @@ def as_dict(self):
}

@classmethod
def from_dict(cls, d):
def from_dict(cls, dct) -> WeightedNbSetChemenvStrategy:
"""
Reconstructs the WeightedNbSetChemenvStrategy object from a dict representation of the
WeightedNbSetChemenvStrategy object created using the as_dict method.
:param d: dict representation of the WeightedNbSetChemenvStrategy object
:param dct: dict representation of the WeightedNbSetChemenvStrategy object
Returns:
WeightedNbSetChemenvStrategy object.
"""
return cls(
additional_condition=d["additional_condition"],
symmetry_measure_type=d["symmetry_measure_type"],
nb_set_weights=d["nb_set_weights"],
ce_estimator=d["ce_estimator"],
additional_condition=dct["additional_condition"],
symmetry_measure_type=dct["symmetry_measure_type"],
nb_set_weights=dct["nb_set_weights"],
ce_estimator=dct["ce_estimator"],
)


Expand Down Expand Up @@ -2985,35 +2985,35 @@ def as_dict(self):
}

@classmethod
def from_dict(cls, d):
def from_dict(cls, dct) -> MultiWeightsChemenvStrategy:
"""
Reconstructs the MultiWeightsChemenvStrategy object from a dict representation of the
MultipleAbundanceChemenvStrategy object created using the as_dict method.
:param d: dict representation of the MultiWeightsChemenvStrategy object
:param dct: dict representation of the MultiWeightsChemenvStrategy object
Returns:
MultiWeightsChemenvStrategy object.
"""
if d["normalized_angle_distance_weight"] is not None:
nad_w = NormalizedAngleDistanceNbSetWeight.from_dict(d["normalized_angle_distance_weight"])
if dct["normalized_angle_distance_weight"] is not None:
nad_w = NormalizedAngleDistanceNbSetWeight.from_dict(dct["normalized_angle_distance_weight"])
else:
nad_w = None
return cls(
additional_condition=d["additional_condition"],
symmetry_measure_type=d["symmetry_measure_type"],
dist_ang_area_weight=DistanceAngleAreaNbSetWeight.from_dict(d["dist_ang_area_weight"])
if d["dist_ang_area_weight"] is not None
additional_condition=dct["additional_condition"],
symmetry_measure_type=dct["symmetry_measure_type"],
dist_ang_area_weight=DistanceAngleAreaNbSetWeight.from_dict(dct["dist_ang_area_weight"])
if dct["dist_ang_area_weight"] is not None
else None,
self_csm_weight=SelfCSMNbSetWeight.from_dict(d["self_csm_weight"])
if d["self_csm_weight"] is not None
self_csm_weight=SelfCSMNbSetWeight.from_dict(dct["self_csm_weight"])
if dct["self_csm_weight"] is not None
else None,
delta_csm_weight=DeltaCSMNbSetWeight.from_dict(d["delta_csm_weight"])
if d["delta_csm_weight"] is not None
delta_csm_weight=DeltaCSMNbSetWeight.from_dict(dct["delta_csm_weight"])
if dct["delta_csm_weight"] is not None
else None,
cn_bias_weight=CNBiasNbSetWeight.from_dict(d["cn_bias_weight"])
if d["cn_bias_weight"] is not None
cn_bias_weight=CNBiasNbSetWeight.from_dict(dct["cn_bias_weight"])
if dct["cn_bias_weight"] is not None
else None,
angle_weight=AngleNbSetWeight.from_dict(d["angle_weight"]) if d["angle_weight"] is not None else None,
angle_weight=AngleNbSetWeight.from_dict(dct["angle_weight"]) if dct["angle_weight"] is not None else None,
normalized_angle_distance_weight=nad_w,
ce_estimator=d["ce_estimator"],
ce_estimator=dct["ce_estimator"],
)
Original file line number Diff line number Diff line change
Expand Up @@ -1947,8 +1947,7 @@ def _cg_csm_separation_plane_optim2(
sep2 = separation_indices[2]
# separation_perm = list(sep0)
ordind = local_plane.project_and_to2dim_ordered_indices(inp)
# separation_perm.extend(
# [separation_indices[1][ii] for ii in ordind])
# separation_perm.extend([separation_indices[1][ii] for ii in ordind])
inp1 = separation_indices[1].take(ordind)
# separation_perm.extend(sep2)
separation_perm = np.concatenate((sep0, inp1, sep2))
Expand Down
Loading

0 comments on commit adf5af6

Please sign in to comment.