Skip to content

Commit

Permalink
Replace deprecated numpy type aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
ml-evs committed May 28, 2023
1 parent c611f69 commit feb3a4c
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion matminer/featurizers/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class FunctionFeaturizer(BaseFeaturizer):
include pairwise combined features
postprocess (function or type): type to cast functional outputs
to, if, for example, you want to include the possibility of
complex numbers in your outputs, use postprocess=np.complex,
complex numbers in your outputs, use postprocess=np.complex128,
defaults to float
combo_function (function): function to combine multi-features,
defaults to np.prod (i.e. cumulative product of expressions),
Expand Down
2 changes: 1 addition & 1 deletion matminer/featurizers/structure/matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def get_ohv(self, sp, period_tag):
ohd[l][curr_shell[2]] = 1
nume += curr_shell[2]
shell_num += 1
my_ohv = np.zeros(self.size, np.int)
my_ohv = np.zeros(self.size, np.int32)
k = 0
for j in range(4):
for i in range(2 * (2 * j + 1)):
Expand Down
2 changes: 1 addition & 1 deletion matminer/featurizers/structure/rdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ def featurize(self, s):
# Add oxidation states.
struct = ValenceIonicRadiusEvaluator(struct).structure

distribution = np.zeros(self.nbins, dtype=np.float)
distribution = np.zeros(self.nbins, dtype=np.float64)

for site in struct.sites:
this_charge = float(site.specie.oxi_state)
Expand Down
2 changes: 1 addition & 1 deletion matminer/featurizers/tests/test_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def test_featurize(self):

# Test complex functionality
expressions = ["sqrt(x)"]
ff = FunctionFeaturizer(expressions=expressions, postprocess=np.complex)
ff = FunctionFeaturizer(expressions=expressions, postprocess=np.complex128)
new_df = ff.fit_featurize_dataframe(self.test_df, "a", inplace=False)
self.assertEqual(new_df["sqrt(a)"][0], 1j)

Expand Down
2 changes: 1 addition & 1 deletion matminer/featurizers/utils/grdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def __call__(self, r_ij):
return np.logical_and(
np.greater_equal(r_ij, self.start),
np.less(r_ij, self.start + self.width),
dtype=np.float,
dtype=np.float64,
)

def volume(self, cutoff):
Expand Down

0 comments on commit feb3a4c

Please sign in to comment.