3D graphs
This commit is contained in:
parent
b970948ba8
commit
571bc09516
File diff suppressed because one or more lines are too long
@ -28,6 +28,24 @@ def read_xyz(path: str):
|
||||
return df
|
||||
|
||||
|
||||
def read_xyz_alt(path: str):
|
||||
df = pd.read_csv(path)
|
||||
df['N'] = df.index + 1
|
||||
|
||||
# Find the outermost corner of this object
|
||||
df['r'] = (
|
||||
(df.x.abs() + np.sqrt(0.5)) ** 2 +
|
||||
(df.y.abs() + np.sqrt(0.5)) ** 2 +
|
||||
(df.z.abs() + np.sqrt(0.5)) ** 2
|
||||
) ** 0.5
|
||||
|
||||
df['cr'] = df.r.cummax()
|
||||
df['fd'] = np.log(df.N) / np.log(df.cr)
|
||||
df['run'] = os.path.splitext(Path(path).name)[0]
|
||||
|
||||
return df
|
||||
|
||||
|
||||
def read_load(load_dir: str, reader=read_xy):
|
||||
paths = glob(f'{load_dir}/*.csv')
|
||||
return pd.concat([reader(path) for path in paths])
|
||||
@ -78,3 +96,16 @@ def fd_stats(dfs):
|
||||
fds = [mean_of_tail(df.fd, 0.1) for df in dfs]
|
||||
fds_clean = [f for f in fds if f < np.inf]
|
||||
return np.mean(fds_clean), np.mean(fds_clean) / np.sqrt(fds_clean.length())
|
||||
|
||||
|
||||
def linear(x, a, b):
|
||||
return x * a + b
|
||||
|
||||
|
||||
def mean_across(df):
|
||||
runs = df.run.unique().size
|
||||
data = df.groupby('N').agg({'fd': ['mean', 'std', ['stderr', lambda fd: np.std(fd) / np.sqrt(runs)]]}) \
|
||||
.reset_index() \
|
||||
.replace([np.inf, -np.inf], np.nan)
|
||||
|
||||
return data
|
||||
|
||||
Loading…
Reference in New Issue
Block a user