<div dir="ltr">Hi Nick,<div><br></div><div>you can use 3rd party Python packages/modules. numpy is even a standard GRASS dependency.</div><div><br></div><div>For extensions (GRASS modules) contributed to GRASS Addons it in best to just write into the code and documentation what is required (and maybe include also suggestion how to install these dependencies on different platforms).</div>

<div class="gmail_extra"><br></div><div class="gmail_extra">The problem is when the module is included into trunk (i.e. the main source) then:</div><div class="gmail_extra">1) we need to add a new dependency (e.g. case of numpy or PIL) or</div>

<div class="gmail_extra">2) we need to include 3rd party library into the source code (e.g. PyDispatcher and perhaps also ctypes) or</div><div class="gmail_extra">3) you can enable the functionality on runtime which usually means that you just leave everything on the user and you just check if the import was successful (by try-except block) and report that this and this needs to be installed and than exit (using fatal_error function); in GUI this is used for visvis library which enables additional export options in g.gui.animation, in this there is a label in the interface which says that you should install visvis.<br>

Each of this options has some drawbacks...<br><br>Small methods/functions can be copied (and modified) if you need just some limited part of 3rd party library functionality. Do not forget to put the reference to the original code and authors into the source code for further reference (and because of copyright/authorship).<br>

<br>License of 3rd party library should always be considered but since most of the libraries are licensed under 'GPL 2 or higher' (same as grass) or some more permissive licence (MIT style, new BSD, LGPL) it is usually not an issue.<br>

<br>I hope that other developers agree at least to certain extend. Actually, I don't know if something like this is specified somewhere but it definitively should be.<br><br>Vaclav<br><br><div class="gmail_quote">On Sat, Sep 28, 2013 at 6:23 AM, Nick Ves <span dir="ltr"><<a href="mailto:vesnikos@gmail.com" target="_blank">vesnikos@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div style="font-family:tahoma,sans-serif">

It's acceptable to use external python mobules (popular ones like scipy, numpy) if you want to contribute a script?</div><div style="font-family:tahoma,sans-serif">
<br></div><div style="font-family:tahoma,sans-serif">Or you have to be 'purist' by either invoking grass commands through pygrass or re-writing methods found in 3d-party modules?<span class=""><font color="#888888"><br>

<br>N  </font></span></div>
</div>
<br>_______________________________________________<br>
grass-dev mailing list<br>
<a href="mailto:grass-dev@lists.osgeo.org">grass-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/grass-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-dev</a><br></blockquote></div><br></div></div>