Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

384 deprecate toitoilim and foifoilim for selectdata #385

Merged
merged 17 commits into from
Dec 5, 2022

Conversation

tensionhead
Copy link
Contributor

@tensionhead tensionhead commented Dec 2, 2022

Make selectdata more similar to ft_selectdata.m

  • toi/toilim and foi/foilim gone in favor of latency and frequency as in ft_selectdata
  • (only!) toi and toilim were tolerant if the upper or lower boundary were outside of the range of a trial time, leading to inconsistent or at least intransparent results
  • This is now no longer the case: latency either throws an error if no trial fits, or kicks out trials which are not fitting to the desired time window retaining only the fitting trials
  • this means, that every latency selection now returns timelocked data , which should be pretty neat to continue with a freqanalysis and so on..
  • some selection focused tests could be greatly simplified as no toi and foi selections need to be tested anymore

Important

  • foi/foilim and toi/toilim remain valid parameters for freqanalysis, as also in ft_freqanalysis
  • foi/foilim remain valid for connectivityanalysys if a mtmfft spectral estimation is to be done on the fly from an AnalogData input
  • in none of these cases those parameters enter into a selection!

Author Guidelines

  • Is the change set < 600 lines?
  • Was the code checked for memory leaks/performance bottlenecks?
  • Is the code running locally and on the ESI cluster?
  • Is the code running on all supported platforms?

Reviewer Checklist

  • Are testing routines present?
  • Do parallel loops have a set length and correct termination conditions?
  • Do objects in the global package namespace perform proper parsing of their input?
  • Do code-blocks provide novel functionality, i.e., no re-factoring using builtin/external packages possible?
  • Code layout
    • Is the code PEP8 compliant?
    • Does the code adhere to agreed-upon naming conventions?
    • Are keywords clearly named and easy to understand?
    • No commented-out code?
  • Are all docstrings complete and accurate?
  • Is the CHANGELOG.md up to date?

- also introduced new class attribute `_selectionKeyWords`
- to sort out relevant keywords per data class
- TODO: repair the myriads of failing tests

Changes to be committed:
	modified:   syncopy/datatype/base_data.py
	modified:   syncopy/datatype/continuous_data.py
	modified:   syncopy/datatype/discrete_data.py
	modified:   syncopy/datatype/methods/selectdata.py
	modified:   syncopy/tests/test_selectdata.py
- now on to the rest..

Changes to be committed:
	modified:   syncopy/datatype/base_data.py
	modified:   syncopy/datatype/continuous_data.py
	modified:   syncopy/tests/test_selectdata.py
- previous commit just dealt with `test_general()`

Changes to be committed:
	modified:   syncopy/datatype/methods/selectdata.py
	modified:   syncopy/tests/test_selectdata.py
- we don't support unbounded [1, np.inf] interval selections anymore
- could be reintroduced if there's a user demand

Changes to be committed:
	modified:   syncopy/datatype/base_data.py
	modified:   syncopy/tests/test_continuousdata.py
Changes to be committed:
	modified:   syncopy/datatype/methods/definetrial.py
	modified:   syncopy/tests/test_discretedata.py
- passing plotting, preproc, resampledata

Changes to be committed:
	modified:   syncopy/shared/latency.py
	modified:   syncopy/tests/helpers.py
	modified:   syncopy/tests/test_plotting.py
	modified:   syncopy/tests/test_preproc.py
	modified:   syncopy/tests/test_resampledata.py
	modified:   syncopy/tests/test_specest_fooof.py
- connectivity and metadata tests passing
- TODO: the final boss enemy: test_specest
Changes to be committed:
	modified:   syncopy/datatype/continuous_data.py
	modified:   syncopy/tests/test_computationalroutine.py
	modified:   syncopy/tests/test_spike_psth.py
- that was a mean bug

Changes to be committed:
	modified:   syncopy/shared/computational_routine.py
- victory is ours

Changes to be committed:
	modified:   syncopy/tests/test_specest.py
- frontends don't wipe anymore..

Changes to be committed:
	modified:   syncopy/shared/computational_routine.py
	modified:   syncopy/tests/test_specest.py
@tensionhead tensionhead linked an issue Dec 2, 2022 that may be closed by this pull request
- also catched missing single frequency selection

Changes to be committed:
	modified:   syncopy/datatype/base_data.py
	modified:   syncopy/tests/test_connectivity.py
Changes to be committed:
	modified:   syncopy/plotting/sp_plotting.py
	modified:   syncopy/tests/test_plotting.py
- removed support for np.inf entry

Changes to be committed:
	modified:   syncopy/datatype/base_data.py
	modified:   syncopy/tests/test_connectivity.py
	modified:   syncopy/tests/test_selectdata.py
@tensionhead tensionhead marked this pull request as ready for review December 2, 2022 14:57
@codecov
Copy link

codecov bot commented Dec 2, 2022

Codecov Report

Base: 69.82% // Head: 68.59% // Decreases project coverage by -1.22% ⚠️

Coverage data is based on head (19d03a2) compared to base (8a649c9).
Patch coverage: 83.33% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #385      +/-   ##
==========================================
- Coverage   69.82%   68.59%   -1.23%     
==========================================
  Files          78       78              
  Lines        9460     9403      -57     
  Branches     1931     1920      -11     
==========================================
- Hits         6605     6450     -155     
- Misses       2379     2448      +69     
- Partials      476      505      +29     
Impacted Files Coverage Δ
syncopy/nwanalysis/connectivity_analysis.py 71.03% <0.00%> (-1.38%) ⬇️
syncopy/plotting/sp_plotting.py 68.12% <0.00%> (-10.63%) ⬇️
syncopy/shared/computational_routine.py 77.72% <ø> (-0.47%) ⬇️
syncopy/datatype/methods/selectdata.py 78.72% <60.00%> (+1.54%) ⬆️
syncopy/datatype/base_data.py 78.90% <90.00%> (-3.41%) ⬇️
syncopy/datatype/continuous_data.py 81.75% <100.00%> (-3.82%) ⬇️
syncopy/datatype/discrete_data.py 78.30% <100.00%> (-5.34%) ⬇️
syncopy/datatype/methods/definetrial.py 83.90% <100.00%> (+0.23%) ⬆️
syncopy/shared/latency.py 76.71% <100.00%> (ø)
syncopy/tests/helpers.py 100.00% <100.00%> (+3.80%) ⬆️
... and 14 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@tensionhead tensionhead added the FT compat Field Trip compatibility label Dec 2, 2022
@dfsp-spirit dfsp-spirit self-assigned this Dec 5, 2022
@dfsp-spirit
Copy link
Collaborator

dfsp-spirit commented Dec 5, 2022

Thanks a lot for this change, which brings us closer to fieldtrip!

I have read through all the changes, and I am currently testing it locally.

I just noticed that in our [quickstart guide](https://syncopy.readthedocs.io/en/latest/quickstart/quickstart.html), the first plot command includes a `toilim` selection and therefore fails: `data.singlepanelplot(trials=0, toilim=[0, 0.5])`.

I guess we should double-check that in our doc-sprint branch and fix it there once this is merged. It would be good to complete the quick start guide once ourselves before the new release, just to be sure it is still up-to-date and working with the latest version.

UPDATE: I have fixed this in the quickstart guide already.

@dfsp-spirit dfsp-spirit self-requested a review December 5, 2022 13:17
Copy link
Collaborator

@dfsp-spirit dfsp-spirit left a comment

Choose a reason for hiding this comment

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

Thanks a lot for this change!

syncopy/datatype/methods/selectdata.py Show resolved Hide resolved
@dfsp-spirit dfsp-spirit merged commit d4a4d75 into dev Dec 5, 2022
@tensionhead tensionhead deleted the 384-deprecate-toitoilim-and-foifoilim-for-selectdata branch December 5, 2022 16:53
@tensionhead
Copy link
Contributor Author

Thanks for the final fixes and the quick merge 🙂 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FT compat Field Trip compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deprecate toi/toilim and foi/foilim for selectdata
2 participants