Closed mmyros closed 3 years ago
wrapper.multitaper_connectivities()
is an alternative to wrapper.multitaper_connectivity()
that is potentially more useful as it can accept multiple methods and return them all in the same set of coordinates
Is there a way this can all just be one function multitaper_connectivity
? Like you could pass either a string or a iterable as the method (aka a list of strings) and this would be handled properly inside of the one function. What do you think?
Yes, I wanted to get your opinion on how to best approach this. There will be a difference in the output depending on whether or the "method" is a string or iterable: output will be DataArray or Dataset. DataArray can be plotted right away as xar.plot()
, whereas Dataset needs to have das["method"].plot()
. This will be true even is 'method' is an iterable length one. Do you think that's ok?
Ah I see what you mean. I guess the options are:
I feel like 3 will provide the most consistent interface for the user even if there isn't the magic of just being able to plot immediately, although I do admit that 2 is also pretty nice and users would probably figure it out. 1 is my least favorite because I think the best part of having the combined function is just quick ease of use and two functions seems confusing.
I'm okay with either 2 or 3. 3 will probably lead to the least prolonged confusion because the user will always use the same syntax if they understand the example (although not guaranteed). Do you have a preference for one over the other?
Having thought about this a bit more, I implemented option 2. It may be a bit tricky to document, but it feels like the convenience is worth it. Also, sticking with a string input may be easiest for a complete newcomer to coding. Feel free to override me though!
See wrapper.multitaper_connectivities()