<!DOCTYPE html><html><head><meta name="qrichtext" content="1"><style type="text/css">
p, li { white-space: pre-wrap; }
</style>
<style type="text/css">body { font-family:'Times New Roman'; font-size:13px}</style>
</head>
<body style=" font-family:'monospace'; font-size:9pt; font-weight:400; font-style:normal;">On Tue, 26 Sep 2017 15:27:59 +0100, Even Rouault <even.rouault@spatialys.com> wrote:<br><br><blockquote style="margin: 0 0 0.80ex; border-left: #0000FF 2px solid; padding-left: 1ex">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">On mardi 26 septembre 2017 15:08:09 CEST Joaquim Luis wrote:</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> >> P.S. - It seems strange to use python as a CI interface to a C/C++</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> >> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> >> library. Is there a reason the test harness isn't in C/C++?</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> > </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> > Mateusz already answered on that. Writing Python tests is faster/easier</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> > than C/C++ ones. We/I tend to limit C/C++ written tests to part of the</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> > API not available >through the Python API.</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> That's where Julia might help. From Julia we can call any of the C</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> functions directly from the gdal lib without needing to compile anything.</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> There is this Julia wrapper https://github.com/visr/GDAL.jl but I confess</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> that never used it and it probably does not provide wrappers to all</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> functions. Bur new ones are not difficult to write.</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p></blockquote><div><br></div><div><br></div><blockquote style="margin: 0 0 0.80ex; border-left: #0000FF 2px solid; padding-left: 1ex">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Actually there's a similar mechanism in Python with the ctypes module:</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">https://docs.python.org/3/library/ctypes.html</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">I had used it a bit. For example in</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">https://trac.osgeo.org/gdal/browser/trunk/autotest/gcore/testnonboundtoswig.py#L166</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Downside of this approach is that if you could get the function prototype wrong</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">and a runtime crash, as there's no checking against the .h files.</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Even</p>
</blockquote><div><br></div><div><br></div><div>Right, but in Julia a function wrapper may be as simple as</div><div> <table class="highlight tab-size js-file-line-container" data-tab-size="8"><tbody><tr><td id="LC359" class="blob-code blob-code-inner js-file-line">
<table class="highlight tab-size js-file-line-container" data-tab-size="8"><tbody><tr><td id="LC359" class="blob-code blob-code-inner js-file-line"><span class="pl-k">function</span> <span class="pl-en">getdriverbyname</span>(arg1)</td>
</tr>
<tr>
</tr></tbody></table><table class="highlight tab-size js-file-line-container" data-tab-size="8"><tbody><tr><td id="LC360" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1"> checknull</span>(<span class="pl-c1">ccall</span>((<span class="pl-c1">:GDALGetDriverByName</span>,libgdal),Ptr{GDALDriverH},(Cstring,),arg1))</td>
</tr>
<tr>
</tr></tbody></table><div><span class="pl-k">end</span> </div><div><br></div></td></tr><tr></tr></tbody></table></div></body></html>