Subset dev#14
Conversation
| ## self.idealize_series() | ||
| event_array = np.zeros((0, 5)).astype(object) | ||
| for episode in self.data.series: | ||
| if self.idealization(episode.n_episode) is not None: |
There was a problem hiding this comment.
This is the same as if self.idealization(episode.n_episode): so you don't have to use is not None at the end. Python treats None as well as empty list ([]) and empty string ('') as False in this context.
There was a problem hiding this comment.
You are right. Maybe I put an explanatory comment.
| if datakey is None: | ||
| datakey = self.current_datakey |
There was a problem hiding this comment.
Another unimportant tip/comment: you can do this shorter like datakey = datakey or self.current_datakey.
| return_status = save_pickle(data=data, filepath=filepath) | ||
| >>>>>>> subsets | ||
| else: | ||
| print('Can only save as ".mat"!') |
There was a problem hiding this comment.
Oh wait, actually no. The save_pickle function this is referring to is still commented out. Nevermind!
There was a problem hiding this comment.
I removed it again
| selected_subsets,_ = self.main.ep_frame.subset_frame.subsets_check() | ||
| episodes = self.main.data.episodes_in_subsets(selected_subsets) | ||
| for ep in episodes: | ||
| print (f"Idealizing episode {ep.n_episode}") |
There was a problem hiding this comment.
I didn't know this also worked.
There was a problem hiding this comment.
I don't know if this is something should react to or not!
There was a problem hiding this comment.
I added a catch now for the case that the list returned is empty because nothing was checked, with an error message to the terminal.
| ) | ||
| else: | ||
| self.parent.main.data.subsets[name][0].remove(index) | ||
| n = self.parent.ep_list.item(index).text() |
There was a problem hiding this comment.
You overwrite this right away... I'm generally a bit confused.
There was a problem hiding this comment.
Yes, that's true, very messy isn't it. I commented it out.
|
I now looked at all the files, haven't yet run it myself. There are some minor changes to clean up that I had merged before, and merging this branch will reintroduce those, so it would be good to remove them. I think it should be possible to merge master locally and fix those and push, instead of doing manually. I usually can't guess right if git will think something is a conflict though. |
older python version needed to compile Axographio
allow selection of a subset of traces for idealisation