Avoid warnings when accessing attributes on classes that may not be regular properties #134
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In astropy core, we need to do horrendous things like:
https://github.com/astropy/astropy/blob/46ca59e9a0bfa3b6687411ea7a6364fdebf91914/astropy/visualization/wcsaxes/patches.py#L17-L26
because sometimes Matplotlib deprecate properties - however because those are custom properties and not regular properties, we make use of getattr in sphinx-automodapi to access these which triggers the code inside the properties to run. So this PR just ignores any warning that may occur from running those properties which I think is sensible since there's nothing we can do about those warnings (this will be useful regardless of what dependency deprecates attributes/properties)
The test I added still fails though as the warning still appears a few times (the fix I did takes it down from 7 to 4 warnings). If anyone else fancies figuring out how to fix the test that would be great! Otherwise I'll try and pick this up when I have some time again (but probably not for another month :-/)