Python implementation of image segmentation algorithm of Shepherd et al (2019) Operational Large-Scale Segmentation of Imagery Based on Iterative Elimination. Remote Sensing 11(6).
This kludge will allow classes decorated with @jitclass to also render in Sphinx with the numpydoc extension. These two don't play well together, so this fakes the jitclass decorator when running with sphinx.
The last bit of ugliness I had to do was in shepseg.py, where I needed to make the RowColArray_Type declaration conditional on no sphinx. I tried several ways around this, but they either failed with sphinx, or failed when running for real, so this is all I have left.
One thing I had hopes for was making the fake jitclass decorator return a derived class with an extra field for .class_type.instance_type. This works, in principle, but numpydoc won't render the resulting class, whereas if it returns the real original class, numpydoc renders it fine. I don't understand why.
No thoughts, happy to go with this for now. This stuff may start working in future without this (?) so probably not worth spending too much effort. Merge when ready.
This kludge will allow classes decorated with
@jitclass
to also render in Sphinx with the numpydoc extension. These two don't play well together, so this fakes the jitclass decorator when running with sphinx.The last bit of ugliness I had to do was in shepseg.py, where I needed to make the
RowColArray_Type
declaration conditional on no sphinx. I tried several ways around this, but they either failed with sphinx, or failed when running for real, so this is all I have left.One thing I had hopes for was making the fake jitclass decorator return a derived class with an extra field for .class_type.instance_type. This works, in principle, but numpydoc won't render the resulting class, whereas if it returns the real original class, numpydoc renders it fine. I don't understand why.
@gillins Any thoughts?