File tree Expand file tree Collapse file tree 5 files changed +5
-5
lines changed
tests/protein/nodes/features Expand file tree Collapse file tree 5 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -1210,7 +1210,7 @@ def get_ring_centroids(ring_atom_df: pd.DataFrame) -> pd.DataFrame:
1210
1210
"""
1211
1211
return (
1212
1212
ring_atom_df .groupby ("node_id" )
1213
- .mean ()[["x_coord" , "y_coord" , "z_coord" ]]
1213
+ .mean (numeric_only = True )[["x_coord" , "y_coord" , "z_coord" ]]
1214
1214
.reset_index ()
1215
1215
)
1216
1216
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ def add_sidechain_vector(
47
47
if "rgroup_df" not in g .graph .keys ():
48
48
g .graph ["rgroup_df" ] = compute_rgroup_dataframe (g .graph ["raw_pdb_df" ])
49
49
50
- sc_centroid = g .graph ["rgroup_df" ].groupby ("node_id" ).mean ()
50
+ sc_centroid = g .graph ["rgroup_df" ].groupby ("node_id" ).mean (numeric_only = True )
51
51
52
52
# Iterate over nodes and compute vector
53
53
for n , d in g .nodes (data = True ):
Original file line number Diff line number Diff line change @@ -1138,7 +1138,7 @@ def number_groups_of_runs(list_of_values: List[Any]) -> List[str]:
1138
1138
"""
1139
1139
df = pd .DataFrame ({"val" : list_of_values })
1140
1140
df ["idx" ] = df ["val" ].shift () != df ["val" ]
1141
- df ["sum" ] = df .groupby ("val" )["idx" ].cumsum ()
1141
+ df ["sum" ] = df .groupby ("val" )["idx" ].cumsum (numeric_only = True )
1142
1142
return list (df ["val" ].astype (str ) + df ["sum" ].astype (str ))
1143
1143
1144
1144
Original file line number Diff line number Diff line change @@ -267,7 +267,7 @@ def protein_to_pyg(
267
267
268
268
if store_bfactor :
269
269
# group by residue_id and average b_factor per residue
270
- residue_bfactors = df .groupby ("residue_id" )["b_factor" ].mean ()
270
+ residue_bfactors = df .groupby ("residue_id" )["b_factor" ].mean (numeric_only = True )
271
271
out .bfactor = torch .from_numpy (residue_bfactors .values )
272
272
273
273
return out
Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ def test_add_sidechain_vector():
138
138
sc_true = np .array (
139
139
g .graph ["rgroup_df" ]
140
140
.groupby ("node_id" )
141
- .mean ()
141
+ .mean (numeric_only = True )
142
142
.loc [n ][["x_coord" , "y_coord" , "z_coord" ]]
143
143
)
144
144
np .testing .assert_almost_equal (
You can’t perform that action at this time.
0 commit comments