Skip to content

Commit

Permalink
WIP: prototype for asking questions of sim data
Browse files Browse the repository at this point in the history
  • Loading branch information
tacaswell committed Jan 23, 2025
1 parent 214ce63 commit df9c9de
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions sims/ingest_runs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# %% [markdown]
# proto-typing for building "database" of results

# %%
import pandas as pd
from dataclasses import asdict
from hello_world import reduce
from pathlib import Path

# %%

config = reduce.load_all_config(Path('/nsls2/data3/projects/next_iiia_hrd/xrt_output/'))

# %%
df = pd.DataFrame({k: {f'{outer}.{inner}': v for outer, cfg in asdict(v).items() for inner, v in cfg.items()} for k,v in config.items()}).T
df['job'] = [_.name[:-4] for _ in df.index]


# %%
for n, g in df.groupby('job'):
print(n, len(g.index))
# %%

results = {k:reduce.reduce_file(k, mode='cython') for k in config}
# %%

0 comments on commit df9c9de

Please sign in to comment.