The Gitlab server is succesfully updated to version 14.4.0

Many users are receiving emails regarding excessive amounts of log-in attempts, which are brute-force attempts to crack your password. We are working on a 2FA solution, so no action is needed yet. If you receive emails regarding "sign-in from new location", please check the IP address and if unknown, notify frza@dtu.dk immediately.

Commit fa949688 authored by Emmanuel Branlard's avatar Emmanuel Branlard Committed by Jenni Rinker
Browse files

Speed up rename in clean_turb

parent 6840f505
Pipeline #20542 passed with stage
in 1 minute and 33 seconds
......@@ -44,13 +44,16 @@ def clean_turb(spat_df, all_spat_df, turb_df, decimals=10):
spat_xyz = spat_xyz.T.loc[~spat_xyz.T.apply(np.round,
args=[decimals]).duplicated()].T
# for each column in all_spat_df, find the correct name using spat_df and rename it
rename_map={}
for colname in all_spat_df:
col = all_spat_df[colname]
k, x, y, z = col.values
pid = np.all(np.isclose(np.array([x, y, z]), spat_xyz.values.T),
axis=1).argmax() # use np.isclose for float comparisons
new_name = f'{"uvw"[int(k)]}_p{pid}'
turb_df.rename(columns={colname: new_name}, inplace=True)
if colname!=new_name:
rename_map[colname]=new_name
turb_df.rename(columns=rename_map, inplace=True)
# order according to spat_df
col_names = []
for colname in spat_df:
......
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