I wrote a very simple function to properly restart ipython console with elpy when evaluating the buffer or region:
(defun my-restart-python-console ()
"Restart python console before evaluate buffer or region to avoid various uncanny conflicts, like not reloding modules even when they are changed"
(interactive)
(kill-process "Python")
(kill-buffer "*Python*")
(elpy-shell-send-region-or-buffer))
Itt works but always ask confirmation, because "*Python*" has a running process, however I kill the process before killing the buffer.
The fun part: If I evaluate the function body line by line it works...