<div dir="ltr">OK guys, <div><br></div><div>the script called g.search.module is now in trunk, I've added tests (Vašek: they seem to be far too verbose to me, anything I could do about that?)</div><div><br></div><div>I've left the colorize and print_output functions in the file, reason: better code structure would have to be implemented (read: IMHO decorator at least for colorize should be used and I'm to doubt for now to get working)</div><div><br></div><div>still hope, it's ok for you as it is now, if not, just let me know</div><div><br></div><div>cheers and thanks for help</div><div><br></div><div>Jachym</div></div><br><div class="gmail_quote"><div dir="ltr">po 30. 11. 2015 v 16:19 odesílatel Vaclav Petras <<a href="mailto:wenzeslaus@gmail.com">wenzeslaus@gmail.com</a>> napsal:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Nov 30, 2015 at 3:27 AM, Jachym Cepicky <span dir="ltr"><<a href="mailto:jachym.cepicky@gmail.com" target="_blank">jachym.cepicky@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>about the tests - generally yes, I'm writing it. Are you referring to <a href="http://r3.info" target="_blank">r3.info</a> or to g.search.* modules? I could not found any example to <a href="http://r3.info" target="_blank">r3.info</a> tests</div></blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>I meant <a href="http://r3.info" target="_blank">r3.info</a> as it is more critical but g.search.* is similar just not critical.<br></div><div><br><a href="https://grass.osgeo.org/grass71/manuals/libpython/gunittest_testing.html#tests-of-grass-modules" target="_blank">https://grass.osgeo.org/grass71/manuals/libpython/gunittest_testing.html#tests-of-grass-modules</a><br><a href="https://trac.osgeo.org/grass/browser/grass/trunk/raster/r.mapcalc/testsuite/test_r_mapcalc.py#L80" target="_blank">https://trac.osgeo.org/grass/browser/grass/trunk/raster/r.mapcalc/testsuite/test_r_mapcalc.py#L80</a><br><a href="https://trac.osgeo.org/grass/browser/grass/trunk/lib/python/gunittest/testsuite/test_assertions.py" target="_blank">https://trac.osgeo.org/grass/browser/grass/trunk/lib/python/gunittest/testsuite/test_assertions.py</a><br> </div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><br></div><div>I've rewritten <a href="http://r3.info" target="_blank">r3.info</a> so that the code is the same, as <a href="http://r.info" target="_blank">r.info</a> (with -e flag) - but I can not tell, I'm satisfied with the result</div></blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>I also cannot tell.<br><br><a href="https://trac.osgeo.org/grass/changeset/66983" target="_blank">https://trac.osgeo.org/grass/changeset/66983</a><br><a href="https://trac.osgeo.org/grass/changeset/66984" target="_blank">https://trac.osgeo.org/grass/changeset/66984</a><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>(there are line breaks and quotes in the strings, what IMHO is really not good)<br></div></blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>The comments, history or whatever it is is written as shell command for r and r3, so the strings are in quotes (to be general) and long lines are broken and continuation is done by backslash. With <a href="http://r3.info" target="_blank">r3.info</a> I now get:<br></div><div><br>comments="r3.flow input="test1" flowaccumulation="test2" unit="cell" step=0.25\ limit=2000 max_error=1e-5 direction="down""<br><br></div><div>I'm not sure how exactly this compares to <a href="http://r.info" target="_blank">r.info</a>. Vectors have this in some better way but it's part of the format and I'm not familiar with it.<br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div></div><div><br></div><div>My time resources allocatable to this task are slowly reaching to their end. I would need clear decision from you guys (since you are in charge to mess around GRASS code base):</div><div><br></div><div>Where to put print_output & supporting functions?</div></blockquote></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br>print_output can go to lib/python/script/utils.py (grass.script.utils). The others probably too, although I would mark them as experimental (not guaranteed API).<br> </div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Where to write tests for them?</div></blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>In a file in the testsuite directory at the level of the tested file, i.e. lib/python/script/testsuite for lib/python/script/utils.py.<br><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>(I assume standard unittest package is being used)</div></blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>unittest and grass.gnunittest, please see<br><br><a href="https://grass.osgeo.org/grass71/manuals/libpython/gunittest_testing.html" target="_blank">https://grass.osgeo.org/grass71/manuals/libpython/gunittest_testing.html</a><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Can I omit g.search.data for now? (I would like to put some better code structure, as I can see it more clear now) - so I would put only g.search.module for now to GRASS trunk?</div><div></div></blockquote></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"></div><br></div><div class="gmail_extra">Sure.<br><br></div><div class="gmail_extra">Thanks! I'm looking forward to it.<br></div></div>
</blockquote></div>