Skip to content

Fix fixed-y max calculation to use full plot_data signals#173

Draft
mandarmp with Copilot wants to merge 7 commits into
mainfrom
copilot/fixed-y
Draft

Fix fixed-y max calculation to use full plot_data signals#173
mandarmp with Copilot wants to merge 7 commits into
mainfrom
copilot/fixed-y

Conversation

Copilot AI commented May 30, 2026

Copy link
Copy Markdown
Contributor

Fixed-y scaling was deriving y_max from the first non-empty signal in plot_data, which could under-estimate the axis limit when another signal had a higher peak. The fixed-y path now computes y_max from all relevant signals and uses the true maximum.

  • Problem summary

    • Fixed-y y-limit selection returned early from _extract_fixed_y_max, so rate_signal could mask a larger participation_signal peak (or vice versa).
  • Change made

    • Updated fixed-y max extraction in IPNAnalysis/mea_analysis_routine.py to:
      • iterate both rate_signal and participation_signal
      • collect valid finite positive maxima from each
      • return the global max across collected values (or None if no valid data)
  • Effect on behavior

    • Fixed-y plots now normalize against the actual highest plotted network value across stored plot_data signals, improving consistency across wells.
maxima = []
for key in ("rate_signal", "participation_signal"):
    signal = plot_data.get(key)
    ...
    max_val = float(np.nanmax(finite))
    if max_val > 0:
        maxima.append(max_val)

return max(maxima) if maxima else None

Copilot AI changed the title Make --fixed-y regenerate plots from saved network outputs when spike times are unavailable Clarify raster semantics and swap network subplot y-axes May 30, 2026
Copilot AI changed the title Clarify raster semantics and swap network subplot y-axes Plot raster by physical channels and align network subplot axes May 30, 2026
Copilot AI changed the title Plot raster by physical channels and align network subplot axes Make --fixed-y derive project-wide y-max from existing results May 30, 2026
Copilot AI changed the title Make --fixed-y derive project-wide y-max from existing results Make --fixed-y default to existing-data replot mode May 30, 2026
Copilot AI changed the title Make --fixed-y default to existing-data replot mode Avoid burst re-analysis when generating --fixed-y plots May 30, 2026
Copilot AI changed the title Avoid burst re-analysis when generating --fixed-y plots Fix fixed-y max calculation to use full plot_data signals May 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants