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

Dev #62

Merged
merged 47 commits into from
Mar 16, 2022
Merged

Dev #62

merged 47 commits into from
Mar 16, 2022

Conversation

ctigaret
Copy link
Owner

Bug fixes in window management for matplotlib figures (still some work in progress).
Scipyen console has CTRL+SHIFT+K shortcut for clearing the window.
Fixed bugs in ScipyenInprocessKernel:

  • streams are now properly redirected.
  • fixes an issue in InProcessKernel having no 'io_loop' attribute, by setting eventloop to None, see AttributeError: 'InProcessKernel' object has no attribute 'io_loop' ipython/ipykernel#319
  • fixes an issue with the execute_request in the ipykernel.inprocess.InProcessKernel superclass which calls _abort_queues as a function (method) instead of await-ing it: execute-request in the ipykernel.inprocess.InProcessKernel is inherited directly from ipykernel.kernelbase.Kernel, but the latter calls _abort_queues which, inside InProcessKernel is defined as a coroutine and not a function (or method).

ctigaret and others added 30 commits January 30, 2022 22:50
…meindex

removes scipyen_desktop.sh; I now use the same script (scipyen) for
launching scipyen from the terminal, or via a desktop file (Linux)

envact: script which defined the 'scipyact' shell function which activates
the python virtual environment for running scipyen and is sourced by
the scipyen script. This ensures that scipyen can be called to launch Scipyen
without having to activate the environment specifically (on can stil do it
like this, but now one can type a single command)

Upon first installation, or changing the python virtual environment under
which Scipyen is supposed ot run, the script 'envact' must be edited
manually so that the correct environment is activated.

To activate the virtual environment WITHOUT launching Scipyen, the 'envact'
script file also needs to be sourced in (or its contents copied to) the
'.bashrc' file (or one of '.zshrc', '.cshrc', '.tcshrc' depending on what
shell you actually use - read their corresponding UNIX man pages for more details)






The script 'scipyen' needs to be made executable and a symbolic link to it created
in a directory included in the PATH environment variable (usually, $HOME/bin)
the preliminary invocation of the environment's activate script.

Signed-off-by: Cezar M. Tigaret <cezar.tigaret@gmail.com>
2) Add some documentation to the envact shell script; make clear it IS
compatible ONLY with bash and the Z shell (this overrides my comments
to the last commit)

3) gui.consoles.ScipyenInProcesKernel now also overrides
execute_request (a coroutine) to await _abort_queues() (which is
defined as a coroutine in the InProcessKernel superclass)

Signed-off-by: Cezar M. Tigaret <cezar.tigaret@gmail.com>
object created on the file_origin attribute of a neo object
-> useful to inspect protocol epochs
 together with getABF function, this is beginning to leverage the pyabf
functionality alongside neo framework

core.pyabfbridge: clean up code in epochTable2DF; now outputs the
DAC level and Delta level in the appropriate DAC units for the given
channel

ephys.membrane:
	analyse_AP_step_injection and analyse_AP_step_injection_series
now accept Istart and Istop in samples (default False), and as times
relative to the start of Vm signal (default True)
	the adaptation of these values tot the actual Vm signal times is
delegated to extract_AP_train()





Signed-off-by: Cezar M. Tigaret <cezar.tigaret@gmail.com>
…y with Python 3.9

scipyen.py: small cosmetic rearrangement of import statements w/o functional impact

Signed-off-by: Cezar M. Tigaret <cezar.tigaret@gmail.com>
…dent

configurations of Python and virtual Python environments

Signed-off-by: Cezar M. Tigaret <cezar@w009.psych.cf.ac.uk>
Signed-off-by: Cezar M. Tigaret <cezar@w009.psych.cf.ac.uk>
Adapted Scipyen configuration and launch scripts for the possibility of
using virtual environments with different Python versions (>= 9.7)

Signed-off-by: Cezar M. Tigaret <cezar@w009.psych.cf.ac.uk>
ephys.membrane: fixed bug in allowing use of samples instead of times,
for Istart, Istop in analyse_AP_step_injection_series

INSTALL - hopefully, final update



Signed-off-by: Cezar M. Tigaret <cezar@w009.psych.cf.ac.uk>
ctigaret and others added 17 commits March 8, 2022 23:46
Signed-off-by: ctigaret <cezar.tigaret@gmail.com>
must investigate

Signed-off-by: ctigaret <cezar.tigaret@gmail.com>
seems like a "race" condition with the observed_vars in the DataBag
workspace model that appears after some long list of variables
(mileage varies of different computers and python versions)

MUST DEFINITELY SORT THIS OUT - REDESIGN OF WORKSPACE MODEL?

Signed-off-by: Cezar M. Tigaret <cezar.tigaret@gmail.com>
…gone?

Signed-off-by: Cezar M. Tigaret <cezar@w009.psych.cf.ac.uk>
Signed-off-by: ctigaret <cezar.tigaret@gmail.com>
…ve shell

(and inherited by Scipyen consoles) because the zmq one clear the system (OS)
console where scipyen is launched, instead of the ipython console used by
scipyen

Signed-off-by: ctigaret <cezar.tigaret@gmail.com>
Signed-off-by: Cezar M. Tigaret <cezar.tigaret@gmail.com>
Signed-off-by: Cezar M. Tigaret <cezar.tigaret@gmail.com>
1)
core.quantities: removed obsolete function symbol_from_quantity

2)
ephys.membrane: make vm_thr a parameter present to all functions from
analyse_AP_step_injection_series down the call stack to detect_AP_rises
TODO: streamline this code!

3)
gui.mainwindow:
3.1) class WindowManager:
call show() when matplotlib figure activated in workspace viewer
(FIXME: if minimized it won't be restored! - using Qt5Agg)

3.2) class ScipyenWindow:
3.2.1) call plt.close() when matplotlib figure is removed
3.2.2) When choosing a neo DataObject to be plotted with matplotlib,
we now introspect in order to:
3.2.2.1) plot data vs object's domain (the 'times' attribute)
3.2.2.2) get appropriate xlabel and ylabel

4)
gui.pictgui class ItemsListDialog
Fix bug in self.listWidget.setMinimumWidth which is ALWAYS expecting an int!
(previously it was a float due to the fm.width(longestItem) * 1.1 call )

Signed-off-by: Cezar M. Tigaret <cezar@w009.psych.cf.ac.uk>
class WindowManager - fixed bug calling get_window_title() on a matplotlib figure
(the alleged returned stirng was nto used anyway)

class ScipyenWindow - related to script management
fix bug/update code to reflect that self.recentScripts is a plain old list
and not a deque (as it was previously)
This is because the confuse/YAML framework does not support deque objects)


Signed-off-by: Cezar M. Tigaret <cezar@w009.psych.cf.ac.uk>
class WindowManager
FIXME: self._setCurrentWindow and self._raiseCurrentWindow do the same thing?

Signed-off-by: Cezar M. Tigaret <cezar@w009.psych.cf.ac.uk>
Signed-off-by: Cezar M. Tigaret <cezar@w009.psych.cf.ac.uk>
… ALL mpl Figure windows!!!

gui.workspacemodel.WorkspaceModel.pre-execute
 begin dealing with mpl Figures c'ted at console

Signed-off-by: Cezar M. Tigaret <cezar@w009.psych.cf.ac.uk>
setting current viewer (double vs single click in workspace viewer)

Workspace model now generates "visible" bindings to mpl figures
created at console (but ONLY direcly, and not via plt.plot...-like
functions)

TODO: add an observed of plt.get_fignums() to capture the latter condition
This is somewhat contrived, as mpl figures generated by code executed
INSIDE python, NOT the console (e.g. running a module cole) will NOT be
captured

Signed-off-by: Cezar M. Tigaret <cezar.tigaret@gmail.com>
@ctigaret ctigaret merged commit 59cb5b4 into master Mar 16, 2022
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.

1 participant