Skip to content

Add PORTING_MAP.md, Trial plot methods, and Example 04 parity fixes#57

Merged
iahncajigas merged 4 commits intomainfrom
feature/phase0-porting-map
Mar 11, 2026
Merged

Add PORTING_MAP.md, Trial plot methods, and Example 04 parity fixes#57
iahncajigas merged 4 commits intomainfrom
feature/phase0-porting-map

Conversation

@iahncajigas
Copy link
Copy Markdown
Contributor

@iahncajigas iahncajigas commented Mar 11, 2026

Summary

  • Add PORTING_MAP.md documenting full class-level architecture mapping between Matlab and Python repos (484+ methods across 16 classes)
  • Add explicit Trial.plotRaster() and Trial.plotCovariates() methods
  • Fix Example 04 behavioral parity: dAIC/dBIC sign convention and _compute_place_field sampleRate scaling

Example 04 fixes (found via cross-repo behavioral verification):

  1. dAIC/dBIC sign: Matlab's getDiffAIC(1) computes Zernike − Gaussian; Python was computing Gaussian − Zernike (opposite sign). dKS was already correct.
  2. sampleRate scaling: Matlab's evalLambda produces exp(Xβ) × sampleRate (firing rate in Hz); Python's _compute_place_field helper omitted the sampleRate factor.

Test plan

  • 180 tests pass (2 skipped)
  • All 5 paper examples run end-to-end with --export-figures
  • Example 04 outputs correct sign convention: Mean dAIC (Zern-Gauss): -43.79
  • Verified against Matlab source for all 5 examples

🤖 Generated with Claude Code

Iahn Cajigas and others added 2 commits March 11, 2026 11:43
Phase 0 inventory complete: comprehensive Matlab→Python mapping
document covering all 16 classes (484+ methods), standalone functions,
library functions, paper examples, and helpfile notebooks.

Trial now exposes plotRaster() and plotCovariates() as standalone
methods matching the Matlab API, in addition to the combined plot().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Two discrepancies found via cross-repo verification against Matlab:

1. dAIC/dBIC sign convention: Matlab uses getDiffAIC(1) which computes
   Zernike - Gaussian, but Python manually computed Gaussian - Zernike
   (opposite sign). Fixed to match Matlab. dKS was already correct.

2. _compute_place_field missing sampleRate: Matlab's evalLambda computes
   exp(X*b) * sampleRate to produce firing rates in Hz. Python helper
   omitted the sampleRate multiplication. Added sample_rate parameter
   and wired through all call sites.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@iahncajigas iahncajigas changed the title Add PORTING_MAP.md and Trial.plotRaster/plotCovariates Add PORTING_MAP.md, Trial plot methods, and Example 04 parity fixes Mar 11, 2026
Iahn Cajigas and others added 2 commits March 11, 2026 13:02
Documented ~80 public methods across Analysis (21), CIF (22),
History (7), Events (3), ConfidenceInterval (8), TrialConfig (5),
and ConfigCollection (5). All docstrings translated from Matlab help
text with NumPy convention (Parameters/Returns/See Also sections).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Complete docstring coverage for all public methods across:
- SignalObj, Covariate, nspikeTrain (core.py — ~60, ~15, ~25 methods)
- FitResult, FitSummary (fit.py — ~30, ~15 methods)
- CovariateCollection, SpikeTrainCollection, Trial, TrialConfig,
  ConfigCollection (trial.py — ~40, ~50, ~30+, ~5, ~10 methods)
- DecodingAlgorithms (decoding_algorithms.py — class + 12 public methods)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@iahncajigas iahncajigas merged commit e29ddd8 into main Mar 11, 2026
13 checks passed
@iahncajigas iahncajigas deleted the feature/phase0-porting-map branch March 11, 2026 18:55
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.

1 participant