Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions notebooks/AnalysisExamples.ipynb
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "db89e36d",
"metadata": {},
"source": [
"<!-- parity-note -->\n",
"## MATLAB Parity Note\n",
"- Source MATLAB helpfile: `AnalysisExamples.mlx`\n",
"- Fidelity status: `high_fidelity`\n",
"- Remaining justified differences: Advanced MATLAB algorithm-selection branches and some report plots are still lighter in Python."
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down
12 changes: 12 additions & 0 deletions notebooks/DecodingExample.ipynb
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "c488b5fa",
"metadata": {},
"source": [
"<!-- parity-note -->\n",
"## MATLAB Parity Note\n",
"- Source MATLAB helpfile: `DecodingExample.mlx`\n",
"- Fidelity status: `partial`\n",
"- Remaining justified differences: Core decoding workflow is present, but MATLAB decoding options and reference outputs are not yet fully matched."
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down
12 changes: 12 additions & 0 deletions notebooks/DecodingExampleWithHist.ipynb
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "739c56fe",
"metadata": {},
"source": [
"<!-- parity-note -->\n",
"## MATLAB Parity Note\n",
"- Source MATLAB helpfile: `DecodingExampleWithHist.mlx`\n",
"- Fidelity status: `partial`\n",
"- Remaining justified differences: History-aware decoding is available, but the MATLAB workflow still has richer option handling and reference outputs."
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down
12 changes: 12 additions & 0 deletions notebooks/ExplicitStimulusWhiskerData.ipynb
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "8bf801b2",
"metadata": {},
"source": [
"<!-- parity-note -->\n",
"## MATLAB Parity Note\n",
"- Source MATLAB helpfile: `ExplicitStimulusWhiskerData.mlx`\n",
"- Fidelity status: `partial`\n",
"- Remaining justified differences: Dataset-backed workflow is present, but figure-level and narrative parity with MATLAB are still incomplete."
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down
12 changes: 12 additions & 0 deletions notebooks/HippocampalPlaceCellExample.ipynb
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "cd1a2218",
"metadata": {},
"source": [
"<!-- parity-note -->\n",
"## MATLAB Parity Note\n",
"- Source MATLAB helpfile: `HippocampalPlaceCellExample.mlx`\n",
"- Fidelity status: `partial`\n",
"- Remaining justified differences: Core place-cell workflow is ported, but MATLAB figure sequencing and summary outputs are not yet exact."
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down
29 changes: 12 additions & 17 deletions notebooks/HybridFilterExample.ipynb
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "0e36ffa9",
"metadata": {},
"source": [
"<!-- parity-note -->\n",
"## MATLAB Parity Note\n",
"- Source MATLAB helpfile: `HybridFilterExample.mlx`\n",
"- Fidelity status: `partial`\n",
"- Remaining justified differences: Hybrid filtering workflow executes, but MATLAB-specific output details and downstream validation remain incomplete."
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -22,30 +34,13 @@
"matplotlib.use(\"Agg\")\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"from scipy.io import loadmat\n",
"\n",
"from nstat.data_manager import ensure_example_data\n",
"from nstat.notebook_figures import FigureTracker\n",
"\n",
"np.random.seed(0)\n",
"DATA_DIR = ensure_example_data(download=True)\n",
"OUTPUT_ROOT = REPO_ROOT / \"output\" / \"notebook_images\"\n",
"__tracker = FigureTracker(topic='HybridFilterExample', output_root=OUTPUT_ROOT, expected_count=2)\n",
"\n",
"def _load_example_globals(name: str) -> dict[str, object]:\n",
" candidates = [\n",
" Path(name),\n",
" DATA_DIR / name,\n",
" DATA_DIR / \"mEPSCs\" / name,\n",
" DATA_DIR / \"Place Cells\" / name,\n",
" DATA_DIR / \"Explicit Stimulus\" / name,\n",
" ]\n",
" for path in candidates:\n",
" if path.exists():\n",
" data = loadmat(path)\n",
" return {k: v for k, v in data.items() if not k.startswith(\"__\")}\n",
" return {}\n",
"\n",
"# SECTION 0: Section 0\n",
"# Hybrid Point Process Filter Example\n",
"# This example is based on an implementation of the Hybrid Point Process filter described in General-purpose filter design for neural prosthetic devices by Srinivasan L, Eden UT, Mitter SK, Brown EN in J Neurophysiol. 2007 Oct, 98(4):2456-75."
Expand Down
12 changes: 12 additions & 0 deletions notebooks/PPSimExample.ipynb
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "8968c9f0",
"metadata": {},
"source": [
"<!-- parity-note -->\n",
"## MATLAB Parity Note\n",
"- Source MATLAB helpfile: `PPSimExample.mlx`\n",
"- Fidelity status: `high_fidelity`\n",
"- Remaining justified differences: MATLAB plotting/report formatting remains lighter, but the core point-process simulation workflow is closely aligned."
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down
12 changes: 12 additions & 0 deletions notebooks/StimulusDecode2D.ipynb
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "59333bc7",
"metadata": {},
"source": [
"<!-- parity-note -->\n",
"## MATLAB Parity Note\n",
"- Source MATLAB helpfile: `StimulusDecode2D.mlx`\n",
"- Fidelity status: `partial`\n",
"- Remaining justified differences: The 2D stimulus decoding workflow runs, but MATLAB-equivalent outputs and tolerance-backed parity checks still need expansion."
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down
12 changes: 12 additions & 0 deletions notebooks/TrialExamples.ipynb
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "93f72e2f",
"metadata": {},
"source": [
"<!-- parity-note -->\n",
"## MATLAB Parity Note\n",
"- Source MATLAB helpfile: `TrialExamples.mlx`\n",
"- Fidelity status: `high_fidelity`\n",
"- Remaining justified differences: Some MATLAB plotting/display details remain simplified, but the core Trial object workflow now follows the MATLAB semantics closely."
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down
12 changes: 12 additions & 0 deletions notebooks/ValidationDataSet.ipynb
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "575b2a91",
"metadata": {},
"source": [
"<!-- parity-note -->\n",
"## MATLAB Parity Note\n",
"- Source MATLAB helpfile: `ValidationDataSet.mlx`\n",
"- Fidelity status: `partial`\n",
"- Remaining justified differences: Validation dataset coverage exists, but MATLAB reference summaries and figure parity are not yet complete."
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down
12 changes: 12 additions & 0 deletions notebooks/nSTATPaperExamples.ipynb
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "21e0c2ce",
"metadata": {},
"source": [
"<!-- parity-note -->\n",
"## MATLAB Parity Note\n",
"- Source MATLAB helpfile: `nSTATPaperExamples.mlx`\n",
"- Fidelity status: `high_fidelity`\n",
"- Remaining justified differences: Python uses standalone figshare-backed data access and generated gallery assets rather than MATLAB path-based setup."
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down
10 changes: 1 addition & 9 deletions nstat/ConfidenceInterval.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
from __future__ import annotations

from ._compat import warn_deprecated_adapter
from .confidence_interval import ConfidenceInterval as _ConfidenceInterval


class ConfidenceInterval(_ConfidenceInterval):
def __init__(self, *args, **kwargs) -> None:
warn_deprecated_adapter("nstat.ConfidenceInterval.ConfidenceInterval", "nstat.confidence_interval.ConfidenceInterval")
super().__init__(*args, **kwargs)

from .confidence_interval import ConfidenceInterval

__all__ = ["ConfidenceInterval"]
10 changes: 1 addition & 9 deletions nstat/ConfigColl.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
from __future__ import annotations

from ._compat import warn_deprecated_adapter
from .trial import ConfigCollection


class ConfigColl(ConfigCollection):
def __init__(self, *args, **kwargs) -> None:
warn_deprecated_adapter("nstat.ConfigColl.ConfigColl", "nstat.trial.ConfigCollection")
super().__init__(*args, **kwargs)

from .trial import ConfigCollection as ConfigColl

__all__ = ["ConfigColl"]
10 changes: 1 addition & 9 deletions nstat/CovColl.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
from __future__ import annotations

from ._compat import warn_deprecated_adapter
from .trial import CovariateCollection


class CovColl(CovariateCollection):
def __init__(self, *args, **kwargs) -> None:
warn_deprecated_adapter("nstat.CovColl.CovColl", "nstat.trial.CovariateCollection")
super().__init__(*args, **kwargs)

from .trial import CovariateCollection as CovColl

__all__ = ["CovColl"]
10 changes: 1 addition & 9 deletions nstat/DecodingAlgorithms.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
from __future__ import annotations

from ._compat import warn_deprecated_adapter
from .decoding_algorithms import DecodingAlgorithms as _DecodingAlgorithms


class DecodingAlgorithms(_DecodingAlgorithms):
def __init__(self, *args, **kwargs) -> None:
warn_deprecated_adapter("nstat.DecodingAlgorithms.DecodingAlgorithms", "nstat.decoding.DecoderSuite")
super().__init__(*args, **kwargs)

from .decoding_algorithms import DecodingAlgorithms

__all__ = ["DecodingAlgorithms"]
10 changes: 1 addition & 9 deletions nstat/FitResSummary.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
from __future__ import annotations

from ._compat import warn_deprecated_adapter
from .fit import FitResSummary as _FitResSummary


class FitResSummary(_FitResSummary):
def __init__(self, *args, **kwargs) -> None:
warn_deprecated_adapter("nstat.FitResSummary.FitResSummary", "nstat.fit.FitSummary")
super().__init__(*args, **kwargs)

from .fit import FitResSummary

__all__ = ["FitResSummary"]
10 changes: 1 addition & 9 deletions nstat/FitResult.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
from __future__ import annotations

from ._compat import warn_deprecated_adapter
from .fit import FitResult as _FitResult


class FitResult(_FitResult):
def __init__(self, *args, **kwargs) -> None:
warn_deprecated_adapter("nstat.FitResult.FitResult", "nstat.fit.FitResult")
super().__init__(*args, **kwargs)

from .fit import FitResult

__all__ = ["FitResult"]
10 changes: 1 addition & 9 deletions nstat/TrialConfig.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
from __future__ import annotations

from ._compat import warn_deprecated_adapter
from .trial import TrialConfig as _TrialConfig


class TrialConfig(_TrialConfig):
def __init__(self, *args, **kwargs) -> None:
warn_deprecated_adapter("nstat.TrialConfig.TrialConfig", "nstat.trial.TrialConfig")
super().__init__(*args, **kwargs)

from .trial import TrialConfig

__all__ = ["TrialConfig"]
26 changes: 26 additions & 0 deletions nstat/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import sys as _sys
from types import ModuleType as _ModuleType

from .ConfidenceInterval import ConfidenceInterval
from .ConfigColl import ConfigColl
from .CovColl import CovColl
Expand Down Expand Up @@ -27,6 +30,29 @@
from .nspikeTrain import nspikeTrain
from .nstColl import nstColl

from . import analysis as _analysis_module
from . import cif as _cif_module
from . import events as _events_module
from . import history as _history_module
from . import trial as _trial_module

_sys.modules.setdefault(f"{__name__}.Analysis", _analysis_module)
_sys.modules.setdefault(f"{__name__}.CIF", _cif_module)
_sys.modules.setdefault(f"{__name__}.Events", _events_module)
_sys.modules.setdefault(f"{__name__}.History", _history_module)
_sys.modules.setdefault(f"{__name__}.Trial", _trial_module)


class _NstatModule(_ModuleType):
def __getattribute__(self, name: str):
value = super().__getattribute__(name)
if isinstance(value, _ModuleType) and hasattr(value, name):
return getattr(value, name)
return value


_sys.modules[__name__].__class__ = _NstatModule


def __getattr__(name: str):
if name == "nstat_install":
Expand Down
Loading