Skip to content

Conversation

@kohlerca
Copy link
Contributor

@kohlerca kohlerca commented Oct 8, 2025

This PR is a revision of the existing Trials objects. Several improvements are implemented:

Functionality

  1. Added additional methods to retrieve spike train or analog signal data across the trial repetitions (get_spiketrains_trial_by_trial and get_analogsignals_trial_by_trial).
  2. Moved redundant code to the base class Trials, for improved maintenance.
  3. Refactored unit tests to include content checks. The tests are based on a base unit test class that is shared across different test cases and provides custom assertions to compare Neo objects.
  4. Changed name convention of arguments to identify trials as indexes (trial_index), instead of the previous trial_id or trial_number.

Documentation

  1. Module docstring text improved.
  2. General revision of all classes and methods docstrings, to harmonize style and add detailed content of the API.
  3. Added usage examples to TrialsFromBlock and TrialsFromList.

TODOs

  • Sphinx configuration to handle links to Neo classes in the documentation.

Cristiano Köhler added 30 commits June 18, 2025 17:42
…s.py to trials.py. GPFA methods and unit tests adjusted.
…s are accessed by indexes (instead of ambiguous terms ID or number).

Added deprecations with warning decorator and corresponding unit tests.
@coveralls
Copy link
Collaborator

coveralls commented Oct 8, 2025

Coverage Status

coverage: 88.323% (+0.06%) from 88.262%
when pulling 6f018b8 on INM-6:enh/trial_by_trial_methods
into 5392583 on NeuralEnsemble:master.

@kohlerca kohlerca requested a review from mdenker October 9, 2025 12:01
@kohlerca kohlerca added enhancement Editing an existing module, improving something documentation Indicates a need for improvements or additions to documentation maintenance labels Oct 9, 2025
@kohlerca kohlerca added this to the v1.2.0 milestone Dec 1, 2025
@kohlerca kohlerca marked this pull request as ready for review December 2, 2025 10:30
individual data of each trial.

The classes of this module abstract from these specific data representations
by introducing a set of :class:`Trials` classes with a common API. These
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While working on instantaneous_rate fix PR #649 , I noticed that sphinx doesn't create a link for :class:Trials . Further check on RTD seems to reveal there is no page for this base class? dedicated pages only exist for the subclasses (e.g. TrailsFromBlocks etc..).
Should we leave this as is, add a page for the base class, or link to the existing Trials documentation wherever a reference is needed(e.g. in statistics.py etc..)?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One fix i tried out is using the :mod: cross referencing, so this takes us to the right module page. So for trials one lands on the trials page, from there TrailsFromBlocks or the other one can be selected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Indicates a need for improvements or additions to documentation enhancement Editing an existing module, improving something maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants