Author Topic: Bokeh Errors on deep reload  (Read 582 times)

dblob

  • Newbie
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Bokeh Errors on deep reload
« on: June 29, 2016, 09:17:34 PM »
Hi,

I recently upgrade to 3.0, and tried to use deep_reload, but I seem to be having some trouble with bokeh,  I get a lot of errors like:

2016-06-29 16:01:01,910 - TID=21456 - DEBUG : - Reloading dependency bokeh.plotting.figure
2016-06-29 16:01:01,918 - TID=21456 - ERROR : Error reloading bokeh.plotting.figure: Duplicate __view_model__ or __subtype__ declaration of 'Figure' for class Figure.  Previous definition: <class 'bokeh.plotting.figure.Figure'>
2016-06-29 16:01:01,918 - TID=21456 - ERROR : Traceback (most recent call last):
2016-06-29 16:01:01,920 - TID=21456 - ERROR :   File "pyxll", line 660, in _open
2016-06-29 16:01:01,921 - TID=21456 - ERROR :   File "C:\dev\Anaconda\lib\site-packages\bokeh\plotting\figure.py", line 14, in <module>
2016-06-29 16:01:01,921 - TID=21456 - ERROR :     class Figure(Plot):
2016-06-29 16:01:01,921 - TID=21456 - ERROR :   File "C:\dev\Anaconda\lib\site-packages\bokeh\model.py", line 49, in __new__
2016-06-29 16:01:01,921 - TID=21456 - ERROR :     Viewable.model_class_reverse_map[entry]))
2016-06-29 16:01:01,921 - TID=21456 - ERROR : Warning: Duplicate __view_model__ or __subtype__ declaration of 'Figure' for class Figure.  Previous definition: <class 'bokeh.plotting.figure.Figure'>
2016-06-29 16:01:01,921 - TID=21456 - DEBUG : - Reloading dependency bokeh.plotting

I get similar errors from other modules ;  seems to be related to static class variables.

Any ideas? 

Tony

  • Administrator
  • Hero Member
  • *****
  • Posts: 615
  • Karma: +14/-1
    • View Profile
Re: Bokeh Errors on deep reload
« Reply #1 on: June 29, 2016, 09:42:44 PM »
Hi,

some modules will have problems deep reloading. You can exclude them by using the 'deep_reload_exclude' option in the pyxll section of your config file. You can use that to list any modules or packages you don't want to traverse when deep reloading. You can also use the 'deep_reload_include' option if you only want to include certain packages (e.g. if you know there are only certain ones you expect to change).

Neither of these options are currently documented, but hopefully they will solve your issue. If you need any more information please let me know.

Best regards,
Tony

dblob

  • Newbie
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Re: Bokeh Errors on deep reload
« Reply #2 on: June 30, 2016, 02:07:01 PM »
Hi Tony,

That's perfect - thanks very much!

-Dave

dblob

  • Newbie
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Re: Bokeh Errors on deep reload
« Reply #3 on: June 30, 2016, 04:54:57 PM »
Any hope of using globs on the excludes, like bokeh.*? 

Tony

  • Administrator
  • Hero Member
  • *****
  • Posts: 615
  • Karma: +14/-1
    • View Profile
Re: Bokeh Errors on deep reload
« Reply #4 on: June 30, 2016, 10:00:06 PM »
Good idea! I'll add it to the todo list for the next minor release.

Thanks!
Tony

Tony

  • Administrator
  • Hero Member
  • *****
  • Posts: 615
  • Karma: +14/-1
    • View Profile
Re: Bokeh Errors on deep reload
« Reply #5 on: June 30, 2016, 10:02:03 PM »
Hmm, actually, doesn't just adding bokeh to the exclude list achieve the same thing?

Best regards,
Tony

dblob

  • Newbie
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Re: Bokeh Errors on deep reload
« Reply #6 on: July 26, 2016, 03:18:45 PM »
Sorry for the slow reply - that did work, thanks!

Tony

  • Administrator
  • Hero Member
  • *****
  • Posts: 615
  • Karma: +14/-1
    • View Profile
Re: Bokeh Errors on deep reload
« Reply #7 on: July 26, 2016, 06:37:02 PM »
Great, thanks for confirming. I'll make sure that's clear when I update the docs!