Commit dd643b1e authored by Peter Hawkins's avatar Peter Hawkins Committed by Copybara-Service
Browse files

[NumPy] Remove references to deprecated NumPy type aliases.

This change replaces references to a number of deprecated NumPy type aliases (np.bool, np.int, np.float, np.complex, np.object, np.str) with their recommended replacement (bool, int, float, complex, object, str).

NumPy 1.24 drops the deprecated aliases, so we must remove uses before updating NumPy.

PiperOrigin-RevId: 495546406
Change-Id: Iaf1bfd2000fee1bffada5138ae16ec192916c076
parent a0b0cd9c
...@@ -89,8 +89,8 @@ TEMPLATE_FEATURES = { ...@@ -89,8 +89,8 @@ TEMPLATE_FEATURES = {
'template_aatype': np.float32, 'template_aatype': np.float32,
'template_all_atom_masks': np.float32, 'template_all_atom_masks': np.float32,
'template_all_atom_positions': np.float32, 'template_all_atom_positions': np.float32,
'template_domain_names': np.object, 'template_domain_names': object,
'template_sequence': np.object, 'template_sequence': object,
'template_sum_probs': np.float32, 'template_sum_probs': np.float32,
} }
...@@ -1002,8 +1002,8 @@ class HmmsearchHitFeaturizer(TemplateHitFeaturizer): ...@@ -1002,8 +1002,8 @@ class HmmsearchHitFeaturizer(TemplateHitFeaturizer):
(1, num_res, residue_constants.atom_type_num), np.float32), (1, num_res, residue_constants.atom_type_num), np.float32),
'template_all_atom_positions': np.zeros( 'template_all_atom_positions': np.zeros(
(1, num_res, residue_constants.atom_type_num, 3), np.float32), (1, num_res, residue_constants.atom_type_num, 3), np.float32),
'template_domain_names': np.array([''.encode()], dtype=np.object), 'template_domain_names': np.array([''.encode()], dtype=object),
'template_sequence': np.array([''.encode()], dtype=np.object), 'template_sequence': np.array([''.encode()], dtype=object),
'template_sum_probs': np.array([0], dtype=np.float32) 'template_sum_probs': np.array([0], dtype=np.float32)
} }
return TemplateSearchResult( return TemplateSearchResult(
......
...@@ -137,8 +137,8 @@ def empty_placeholder_template_features( ...@@ -137,8 +137,8 @@ def empty_placeholder_template_features(
'template_all_atom_positions': np.zeros( 'template_all_atom_positions': np.zeros(
(num_templates, num_res, residue_constants.atom_type_num, 3), (num_templates, num_res, residue_constants.atom_type_num, 3),
dtype=np.float32), dtype=np.float32),
'template_domain_names': np.zeros([num_templates], dtype=np.object), 'template_domain_names': np.zeros([num_templates], dtype=object),
'template_sequence': np.zeros([num_templates], dtype=np.object), 'template_sequence': np.zeros([num_templates], dtype=object),
'template_sum_probs': np.zeros([num_templates], dtype=np.float32), 'template_sum_probs': np.zeros([num_templates], dtype=np.float32),
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment