balintlaczko / MGT-python

Musical Gestures Toolbox for Python
https://www.uio.no/ritmo/english/research/labs/fourms/downloads/software/musicalgesturestoolbox/mgt-python/index.html
GNU General Public License v3.0
1 stars 0 forks source link

Error in second chaining example #29

Closed alexarje closed 4 years ago

alexarje commented 4 years ago

I get an error in the second example under chaining in the notebook. When running:

mg = mgmodule.MgObject('dance.avi', starttime=5, endtime=15, skip=3) mg.motion() mg.history() mg.motionhistory() mg.average()

I get the error:

Moviepy - Running:

"+ " ".join(cmd) Moviepy - Command successful Rendering motion video: |████████████████████████████████████████| 100.0% Complete Rendering history video: |████████████████████████████████████████| 100.0% Complete Rendering motion history video: |████████████████████████████████████████| 100.0% Complete Rendering average image: |████████████████████████████████████████| 100.0% Complete


TypeError Traceback (most recent call last) ~/anaconda3/lib/python3.7/site-packages/IPython/core/formatters.py in call(self, obj) 700 type_pprinters=self.type_printers, 701 deferred_pprinters=self.deferred_printers) --> 702 printer.pretty(obj) 703 printer.flush() 704 return stream.getvalue()

~/anaconda3/lib/python3.7/site-packages/IPython/lib/pretty.py in pretty(self, obj) 400 if cls is not object \ 401 and callable(cls.dict.get('repr')): --> 402 return _repr_pprint(obj, self, cycle) 403 404 return _default_pprint(obj, self, cycle)

~/anaconda3/lib/python3.7/site-packages/IPython/lib/pretty.py in _reprpprint(obj, p, cycle) 695 """A pprint that just redirects to the normal repr function.""" 696 # Find newlines and replace them with p.break() --> 697 output = repr(obj) 698 for idx,output_line in enumerate(output.splitlines()): 699 if idx:

TypeError: repr returned non-string (type NoneType)

balintlaczko commented 4 years ago

I think I know what this is though it is strange. Will test this on ubuntu. Could it be something related to anaconda...? ... and possibly to using f-strings in a repr function.

balintlaczko commented 4 years ago

Can confirm this both on Windows and Ubuntu 19.10 (in virtualbox). The problem is in fact a missing "return" keyword, lol. :)

balintlaczko commented 4 years ago

Tested on Windows 10 and Ubuntu 19.10