[qudi-dev] Re: About debugging Qudi modules

  • From: Sami Koho <sami.koho@xxxxxxxxx>
  • To: "Dr. Kay Jahnke" <kay@xxxxxxxxxxxxxxxxxxx>
  • Date: Mon, 4 May 2020 19:55:09 +0200

Hi Kay,

thanks a lot for your reply. Indeed, I realised that my question was a little 
bit unclear. I guess I was wondering whether it would be possible to configure 
a module for testing/debugging without loading the whole manager UI. I’m quite 
used to writing unit tests on other platforms, so I was wondering whether 
there’s a way to do that. After some experimentation I ended up doing what you 
suggested here: running Qudi through the PyCharm debugger and then testing 
things on notebooks/console. Seems to work just fine. I prefer using a real 
debugger, as it makes finding and correcting errors quite a bit quicker. 

Best,

Sami


On 4. May 2020, at 19.34, Dr. Kay Jahnke <kay@xxxxxxxxxxxxxxxxxxx> wrote:

Hi Sami,

it's good to hear that you are using qudi.

I have to confess I don't really understand your question: 
I'm using PyCharm and it brings a debugger with it, if you want it. There is 
no difference for the debugger, if you use an elaborate module as qudi or 
just a single script.

On the other hand, qudi itself has a debug-output that can be used by calling 
self.log.debug('Message'). This is automatically saved to the log file and 
can be shown in the manager by activating the debug output. I'm always using 
this and not the debugger from the IDE.

Also when starting with a new functionality first you should make a plan of 
what your hardware can do and how and then define what your tool chain should 
do and what you want the GUI to look like (on paper). In programming I start 
by writing a dummy hardware and connect it to the logic. This I can then 
generalize into an interface and make the logic fully functional. Until this 
point I'm mostly using jupyter notebooks. My next step is then the GUI at 
which point I can get rid of my first notebook (although I will always keep 
it for testing). The actual hardware I tackle last and make (mostly minor) 
adjustments to the already tested tool chain.

Does my answer help you a bit?
Feel free to post further questions.

Cheers,
Kay

Am 04.05.2020 um 12:14 schrieb Sami Koho:
Hi,

I am writing some new Qudi modules, with new code on  hardware, interfaces, 
logic and gui layers. I was wondering if there’s an easy way for getting the 
module Connected and running in a debugger? 

Best,

Sami


-- 
Dr. Kay Jahnke
Director of R&D operations

Mobile:       +49-152-534 303 59
Office:       +49-731-50 22194
Email:        kay@xxxxxxxxxxxxxxxxxxx <mailto:kay@xxxxxxxxxxxxxxxxxxx>
Web:  www.nvision-imaging.com <https://www.nvision-imaging.com/>
<mbhhekhfkbllnhho.png>
*******************************************************************************************
Company Name / Firma: NVision Imaging Technologies GmbH
Address / Adresse: Albert-Einstein-Allee 11, 89081 DE-Ulm
Headquarters / Sitz der Gesellschaft: Ulm (Germany)
Registered in / Amtsgericht Ulm / HRB 731965
Board of Management / Geschäftsführung: Sella Brosh (CEO), Ilai Schwartz
VAT / USt-IdNr: DE 300286448; EORI-Nummer: DE214289851211797
*******************************************************************************************

Other related posts: