Skip to content

Commit

Permalink
Allow variable log size in sensitivity analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
jannisteunissen committed Oct 13, 2023
1 parent 61d97b4 commit 5985e21
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tools/sensitivity_analyze_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@
logs = sorted(args.logs)
logs_df = [pd.read_csv(f, delim_whitespace=True) for f in args.logs]

log_sizes = np.array([len(df) for df in logs_df])
max_size, min_size = log_sizes.max(), log_sizes.min()

if max_size > min_size:
print(f'Warning: logs have different size, truncating to {min_size} rows')
logs_df = [df.head(min_size) for df in logs_df]

all_cases = {}

for log, df in zip(logs, logs_df):
Expand All @@ -44,7 +51,7 @@

effect_magnitudes = np.zeros(len(reaction_ix))

print(f'Using data at time t = {times[args.time_index]}')
print(f'Using data at time t = {times[args.time_index]}\n')

# Here mu indicates the mean derivative, mustar the mean absolute derivative,
# and sigma the standard deviation in the derivative. All derivatives w.r.t. a
Expand Down

0 comments on commit 5985e21

Please sign in to comment.