Skip to content

Commit

Permalink
Merge pull request #896 from ml-evs/close_#864
Browse files Browse the repository at this point in the history
Assign `__init__` arg to instance attribute to fix sklearn base `__repr__`
  • Loading branch information
janosh authored Dec 17, 2022
2 parents 93cde56 + 1f33511 commit e1b83b3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions matminer/featurizers/structure/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def __init__(self, desired_features=None):
desired_features: [str] - choose from "density", "vpa",
"packing fraction"
"""
self.desired_features = desired_features
self.features = ["density", "vpa", "packing fraction"] if not desired_features else desired_features

def precheck(self, s: Structure) -> bool:
Expand Down
1 change: 1 addition & 0 deletions matminer/featurizers/structure/symmetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class GlobalSymmetryFeatures(BaseFeaturizer):
all_features = ["spacegroup_num", "crystal_system", "crystal_system_int", "is_centrosymmetric", "n_symmetry_ops"]

def __init__(self, desired_features=None):
self.desired_features = desired_features
self.features = desired_features if desired_features else self.all_features

def featurize(self, s):
Expand Down

0 comments on commit e1b83b3

Please sign in to comment.