Closed danbeibei closed 1 year ago
OK, I understand the point about polymorphism now. Happy to merge once you fix the minor issue with the type_check
default value.
I fixed the type_check default value. I also reworked a bit the case where the fortran type is not known to f90wrap.
thank you! I'll wait for the upcoming build improvements before doing a new release.
This pull request addresses two current limitations:
This pr adds type and shape checks in the python wrapper function. It raises TypeError if the type/shape provided to the python function does not match the type/shape of the wrapped Fortran subroutine. It allows better support for Fortran interfaces. For instance, it enables one to wrap:
Known limitation: as Fortran
logical
is mapped to Cint
there is no differentiation of pythonbool
andint32
.It should solve issue #107
A command line flag is added to activate those checks, so that old behavior is still possible and is the default. The flag could be removed so that the checks are always added, but this could break existing code. It does break some tests in the exemple directory, though they seem easily fixable.