sphinx-contrib / matlabdomain

A Sphinx extension for documenting Matlab code
http://sphinxcontrib-matlabdomain.readthedocs.io/
Other
69 stars 45 forks source link

`MatClassDocumenter::document_member_section` handles empty `:exclude-members:` incorrectly. #189

Closed joeced closed 1 year ago

joeced commented 1 year ago

As reported in #188, we get this error

AttributeError: '_All' object has no attribute 'copy'

if this directive is used

.. autoclass:: folder.ClassNanme
    :members: 
    :exclude-members: 
    :no-undoc-members: 

.. autoattribute:: folder.ClassNanme.propname

Note, that the if :exclude-members: is empty, Sphinx returns a special object that is always empty, not a set. In MatClassDocumenter::document_member_section we try copy this object which is not possible. Later we try to add extra excluded members to this object, which is also not possible.

Further, the option "exclude-members" should be exclude_members_option and not member_option.

Edit: Fixed the above, but now the autoattribute directive error trigger this error

Exception occurred:
  File "...\matlabdomain\sphinxcontrib\mat_types.py", line 1613, in for_module
    mod = entities_table[modname]
          ~~~~~~~~~~~~~~^^^^^^^^^
KeyError: 'sphinxcontrib.mat_types'
joeced commented 1 year ago

@rdzman did you see this?

I thought I had a solution ready, but not quite yet.

rdzman commented 1 year ago

Sorry, I had not seen this. Anything you need from me? (Haven't had time to look into it at all yet).

joeced commented 1 year ago

No, I found the issues. I just wanted to let you know

joeced commented 1 year ago

Fixed in 09c3bc9ba69ac104eebdcdbce367e3cdc08bf13e