sphinx-fortran icon indicating copy to clipboard operation
sphinx-fortran copied to clipboard

exception: 'fromsky' with abstract interface

Open Cirdans-Home opened this issue 4 years ago • 3 comments

Hi,

I encounter the following exception Extension error: Handler <function fortran_parse at 0x7f35d1032170> for event 'builder-inited' threw an exception (exception: 'fromsky') when I try to parse a module with: .. f:automodule:: psfun_d_serial_mod if the module contains an abstract interface:

abstract interface
        function func (x,k)
            use psb_base_mod
            implicit none
            real(psb_dpk_)                          :: func
            real(psb_dpk_), intent (in)             :: x   
            integer(psb_ipk_), intent(in), optional :: k 
        end function func
 end interface

If the previous code is commented, then the generation of the documentation works as intended.

I am using Sphinx version 3.2.1 and Sphinx_Fortran 1.1.1

Thank you in advance!

Cirdans-Home avatar Oct 18 '20 14:10 Cirdans-Home

This appears to be due to a lack of support for abstract interfaces in numpy.f2py. I've opened an issue in numpy: numpy/numpy#18403.

jhaiduce avatar Feb 12 '21 16:02 jhaiduce

Hi @jhaiduce , it seems numpy supports this now, is it possible to extend sphinx-fortran? I think related is use of a general public interface to private functions to allow different forms of input, e.g.

interface CPL_send
    module procedure CPL_send_full, CPL_send_min
end interface CPL_send

where inputs are CPL_send_full(a, b, c) or CPL_send_min(a, b) which using Sphinx, breathe, doyxgen combo for C++ on the same interface is documented as

 CPL_send(a, b, c)
 CPL_send(a, b)

I currently get an error:

sphinxfortran.fortran_autodoc.F90toRstException: Unknown function, subroutine or program: cpl_send

edwardsmith999 avatar Jun 09 '22 15:06 edwardsmith999

Hi @jhaiduce , it seems numpy supports this now, is it possible to extend sphinx-fortran?

Probably, but I’ll defer to the developers on that question.

jhaiduce avatar Jun 10 '22 01:06 jhaiduce