Skip to content

Change signal's duplicate_with_new_array to duplicate_with_new_data - #189

Closed
jpgill86 wants to merge 1 commit into
NeuralEnsemble:masterfrom
jpgill86:neo-0.7.0-compatibility
Closed

jpgill86 wants to merge 1 commit into
NeuralEnsemble:masterfrom
jpgill86:neo-0.7.0-compatibility

Conversation

@jpgill86

Copy link
Copy Markdown
Contributor

For compatibility with Neo 0.7.0 (soon to be released)

@pep8speaks

pep8speaks commented Nov 26, 2018 •

Copy link
Copy Markdown

Hello @jpgill86! Thanks for updating the PR.

Line 74:80: E501 line too long (84 > 79 characters)
Line 146:1: W293 blank line contains whitespace
Line 149:1: W293 blank line contains whitespace
Line 150:74: W291 trailing whitespace
Line 155:75: W291 trailing whitespace
Line 231:75: E502 the backslash is redundant between brackets
Line 243:59: E502 the backslash is redundant between brackets
Line 244:9: E128 continuation line under-indented for visual indent
Line 245:59: E502 the backslash is redundant between brackets
Line 246:9: E128 continuation line under-indented for visual indent
Line 379:80: E501 line too long (80 > 79 characters)
Line 475:31: E231 missing whitespace after ','

Line 23:1: E302 expected 2 blank lines, found 1
Line 27:57: W291 trailing whitespace
Line 30:53: W291 trailing whitespace
Line 31:57: W291 trailing whitespace
Line 34:53: W291 trailing whitespace
Line 35:53: W291 trailing whitespace
Line 36:57: W291 trailing whitespace
Line 39:69: W291 trailing whitespace
Line 42:69: W291 trailing whitespace
Line 43:52: W291 trailing whitespace
Line 46:5: E265 block comment should start with '# '
Line 47:5: E265 block comment should start with '# '
Line 71:70: W291 trailing whitespace
Line 88:74: W291 trailing whitespace
Line 89:13: E128 continuation line under-indented for visual indent
Line 94:57: W291 trailing whitespace
Line 95:13: E128 continuation line under-indented for visual indent
Line 102:5: E265 block comment should start with '# '
Line 102:5: E303 too many blank lines (2)
Line 103:5: E265 block comment should start with '# '
Line 104:5: E265 block comment should start with '# '
Line 106:5: E301 expected 1 blank line, found 0
Line 109:66: W291 trailing whitespace
Line 110:13: E128 continuation line under-indented for visual indent
Line 114:66: W291 trailing whitespace
Line 115:13: E128 continuation line under-indented for visual indent
Line 119:66: W291 trailing whitespace
Line 120:13: E128 continuation line under-indented for visual indent
Line 123:66: W291 trailing whitespace
Line 124:13: E128 continuation line under-indented for visual indent
Line 128:67: W291 trailing whitespace
Line 129:13: E128 continuation line under-indented for visual indent
Line 132:67: W291 trailing whitespace
Line 133:13: E128 continuation line under-indented for visual indent
Line 137:13: E128 continuation line under-indented for visual indent
Line 138:67: W291 trailing whitespace
Line 139:13: E128 continuation line under-indented for visual indent
Line 144:67: W291 trailing whitespace
Line 145:13: E128 continuation line under-indented for visual indent
Line 148:67: W291 trailing whitespace
Line 149:13: E128 continuation line under-indented for visual indent
Line 153:13: E128 continuation line under-indented for visual indent
Line 156:66: W291 trailing whitespace
Line 157:13: E128 continuation line under-indented for visual indent
Line 160:66: W291 trailing whitespace
Line 161:13: E128 continuation line under-indented for visual indent
Line 165:13: E128 continuation line under-indented for visual indent
Line 167:5: E265 block comment should start with '# '
Line 168:5: E265 block comment should start with '# '
Line 169:5: E265 block comment should start with '# '
Line 174:67: W291 trailing whitespace
Line 175:13: E128 continuation line under-indented for visual indent
Line 180:69: W291 trailing whitespace
Line 181:52: W291 trailing whitespace
Line 185:13: E128 continuation line under-indented for visual indent
Line 203:17: E128 continuation line under-indented for visual indent
Line 212:57: E127 continuation line over-indented for visual indent
Line 411:21: E128 continuation line under-indented for visual indent
Line 413:1: E305 expected 2 blank lines after class or function definition, found 1

Comment last updated on December 02, 2018 at 19:34 Hours UTC

@jpgill86

Copy link
Copy Markdown
Contributor Author

Unless a more clever approach is taken in which the method called is determined dynamically depending on which version of Neo is installed, requirements.txt will need bumped too. I can try that after Neo 0.7.0 is officially released to see if the Travis tests pass.

@jpgill86

Copy link
Copy Markdown
Contributor Author

Actually, I think there will be many more changes needed if elephant is going to support Neo 0.7.0 fully, which changed a lot more than the name of this one method.

@mdenker

mdenker commented Nov 26, 2018 •

Copy link
Copy Markdown
Member

Cool, thanks for the quick response to this breaking issue. I can confirm your fix passes the corresponding tests on my machine with the upcoming Neo 0.7 code.

As you expect, there are a few other issues that arise, in particular an issue in the instantaneous rate, spike train correlation, as well as in the neo_utils module. It seems at first glance that at least some of these issues have to do with changes in the way t_start and t_stop are handled when rescaling a spike train. Previously, t_start and t_stop were scaled along with the spike times, in 0.7. this behavior seems changed and the start and stop are left alone (which may be rather the desired behavior). Requires more investigation, though...

@mdenker

mdenker commented Nov 27, 2018

Copy link
Copy Markdown
Member

The t_start and t_stop issue breaking some of Elephant's tests is now handled in
NeuralEnsemble/python-neo#613
NeuralEnsemble/python-neo#614

@jpgill86

Copy link
Copy Markdown
Contributor Author

To handle the breaking change described here (Neo's AnalogSignal.duplicate_with_new_array was renamed to AnalogSignal.duplicate_with_new_data in 0.7.0), we could try to preserve backwards compatibility with older versions of Neo by dynamically using one name or the other depending on which version is installed. Is it worth it?

Since Neo 0.7.0 is live on PyPI, I'm going to, for now, try the simpler thing in this PR and just bump the Neo requirement to 0.7.0, and then we can see how the Travis tests fare.

@mdenker

mdenker commented Nov 30, 2018

Copy link
Copy Markdown
Member

Yes, the version number must be fixed. I think this is reasonable, since Neo and Elephant are coupled so strongly, that "hot fixes" will not be a good idea at this stage.

However, we considered to make matching releases of the next major versions, i.e., fixing Elephant to use

neo>=0.7.0,<0.8.0

such that the future Neo releases up to Neo 1.0.0 (which are likely to have considerable enhancements) will not break Elephant.

@jpgill86

jpgill86 commented Dec 2, 2018

Copy link
Copy Markdown
Contributor Author

Alright, that sounds reasonable. I'm going to remove the change to requirements.txt from this PR since that seems to be part of a larger discussion and requires the coordination of multiple fixes.

@jpgill86
jpgill86 force-pushed the neo-0.7.0-compatibility branch from 736f567 to ee5a28d Compare December 2, 2018 19:34
@mdenker

mdenker commented Dec 3, 2018

Copy link
Copy Markdown
Member

Ok, yes, that makes sense. Will merge this fix as is.

@jpgill86

Copy link
Copy Markdown
Contributor Author

Neo 0.7.1 was released today and added duplicate_with_new_array (the old method name) as an alias for duplicate_with_new_data for backwards compatibility (see NeuralEnsemble/python-neo#622).

This means that the latest release of elephant (0.6.0) works again with the latest Neo (0.7.1) with respect to this particular function (though other compatibility issues still exist, see #192).

The alias is deprecated and may be removed in a future release of Neo, so the changes proposed in this PR should still be merged into elephant to ensure future compatibility. Doing so will break backwards compatibility with Neo < 0.7.0, but, as I understand it, that's acceptable since the plan is for elephant and Neo to have matched releases.

@mdenker

mdenker commented Apr 1, 2019

Copy link
Copy Markdown
Member

This PR was merged and extended into cumulativ fix #203 to test CI pass.

@mdenker mdenker closed this Apr 1, 2019
@mdenker

mdenker commented Apr 1, 2019

Copy link
Copy Markdown
Member

Neo Version number of upcoming 0.6.1 will be fixed to >=0.7.0 and <0.8.0 to prevent similar breaks on 0.8.0 release.

@mdenker mdenker added this to the v0.6.1 milestone Apr 1, 2019
@jpgill86
jpgill86 deleted the neo-0.7.0-compatibility branch April 2, 2019 20:47
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.

3 participants