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

request: nwbfile.create_electrode_table_region should take type range #350

Open
bendichter opened this issue Feb 1, 2018 · 5 comments
Open
Labels
category: enhancement improvements of code or code behavior priority: low alternative solution already working and/or relevant to only specific user(s)
Milestone

Comments

@bendichter
Copy link
Contributor

Low priority, but this would be a nice little usability improvement.

When I try

all_table_region = nwbfile.create_electrode_table_region(
    range(electrode_counter), 'all electrodes')

I get

TypeError: incorrect type for 'region' (got 'range', expected 'slice, list, tuple or RegionReference')

I can fix this by wrapping range in list, but it would be nice if pynwb handled this kind of thing.

@oruebel
Copy link
Contributor

oruebel commented Feb 1, 2018

@bendichter this I think at least in part a Python 2 vs. 3 issue. In Python 2 range is a list and in 3 its an iterator (i.e., what xrange is in Python2). Because of this it is not uncommon in Py3 that you have to do list(range(...)).

@bendichter
Copy link
Contributor Author

bendichter commented Feb 1, 2018 via email

@neuromusic
Copy link

@oruebel would it be reasonable to request that it takes any iterable?

@bendichter
Copy link
Contributor Author

I'd also like NWB objects to accept pandas.Series objects. Again, I can get it in with np.array(series), but it would be more usable if these objects accepted iterators.

@neuromusic
Copy link

in general, broader support for duck typing in pynwb would make the package way more user friendly

@oruebel oruebel self-assigned this May 18, 2018
@oruebel oruebel added this to the NWB 2.0 Full milestone May 18, 2018
@ajtritt ajtritt modified the milestones: NWB 2.0 Full, NWB 2.x Aug 28, 2018
@rly rly unassigned oruebel Apr 11, 2024
@rly rly modified the milestones: NWB 2.x, Future Apr 11, 2024
@rly rly added category: enhancement improvements of code or code behavior priority: low alternative solution already working and/or relevant to only specific user(s) labels Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: enhancement improvements of code or code behavior priority: low alternative solution already working and/or relevant to only specific user(s)
Projects
None yet
Development

No branches or pull requests

5 participants