[prev in list] [next in list] [prev in thread] [next in thread] 

List:       grass-dev
Subject:    Re: [GRASS-dev] What is the status of g.list, g.remove, g.mlist and g.mremove?
From:       Huidae Cho <grass4u () gmail ! com>
Date:       2014-09-30 18:33:14
Message-ID: CANEOyhpqZcm1szSMmGrbBXVAxqJW7oZgrvbMaRHx85ssW3z4xg () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


cls.runModule('g.remove', flags='f', type='rast3d',
pattern=','.join(['map_1', 'map_2', 'map_3', 'map_4', 'map_5',
'test_flowaccum']))

should work. I think now we see a new challenge with separate type and map
name options. In GUI, how should we list map names for the pattern option?

1. Select map types first
2. List only those maps based on the selected map types.

It looks like we need some python tricks for g.remove GUI?

-- 
Huidae



On Tue, Sep 30, 2014 at 11:30 AM, Vaclav Petras <wenzeslaus@gmail.com>
wrote:

> 
> 
> On Fri, Sep 26, 2014 at 6:53 AM, Huidae Cho <grass4u@gmail.com> wrote:
> 
> > Markus,
> > 
> > It has to be a single parameter because of commas in a pattern. Multiple
> > map names are handled as a pattern internally e.g. map1,map2 => {map1,map2}.
> > 
> Then of course, PyGRASS has no chance to know that and the recent type
> enforcement addition will force you to use string instead of a list
> 
> cls.runModule('g.remove', flags='f', type='rast3d', pattern=['map_1',
> 'map_2', 'map_3', 'map_4', 'map_5', 'test_flowaccum'])
> ...
> TypeError: The Parameter <pattern> does not accept multiple inputs
> 
> 
> http://fatra.cnr.ncsu.edu/grassgistests/reports_for_date-2014-09-30-07-00/report_for_nc_spm_08_grass7_nc/raster3d/r3.flow/r3flow_test/index.html
>  
> (This test ends with error, PyGRASS is used internally.)
> 
> I don't know what to do about it besides stating that it how it is or
> relaxing the type checks in PyGRASS. Adding some info to the option like
> "behaves as multiple=YES" seem too complicated.
> 
> Vaclav
> 
> > Regards,
> > Huidae
> > On Sep 26, 2014 5:48 AM, "Markus Neteler" <neteler@osgeo.org> wrote:
> > 
> > > Hi Huidae,
> > > 
> > > On Thu, Sep 25, 2014 at 6:20 PM, Huidae Cho <grass4u@gmail.com> wrote:
> > > > Markus,
> > > > 
> > > > Currently, g.remove supports "g.remove vect pattern=map1,map2".
> > > Pattern can
> > > > take multiple map names separated by a comma.
> > > 
> > > ok, good. Perhaps I got just confused because the help text does not
> > > show this yet:
> > > 
> > > current:
> > > g.remove [-refb] type=datatype[,datatype,...] pattern=string
> > > ...
> > > 
> > > expected:
> > > g.remove [-refb] type=datatype[,datatype,...]
> > > pattern=string[,string,...]
> > > ...
> > > 
> > > It would be multiple = YES for pattern to have that but I don't know
> > > if any other changes might be required then.
> > > 
> > > Best
> > > Markus
> > > 
> > 
> 


[Attachment #5 (text/html)]

<div dir="ltr"><span \
style="font-family:arial,sans-serif;font-size:13px">cls.runModule(&#39;g.remove&#39;, \
flags=&#39;f&#39;, type=&#39;rast3d&#39;, pattern=&#39;,&#39;.join([&#39;map_1&#39;, \
&#39;map_2&#39;, &#39;map_3&#39;, &#39;map_4&#39;, &#39;map_5&#39;, \
&#39;test_flowaccum&#39;]))</span><div><span \
style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span \
style="font-family:arial,sans-serif;font-size:13px">should work. I think now we see a \
new challenge with separate type and map name options. In GUI, how should we list map \
names for the pattern option?</span></div><div><span \
style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span \
style="font-family:arial,sans-serif;font-size:13px">1. Select map types \
first</span></div><div><span style="font-family:arial,sans-serif;font-size:13px">2. \
List only those maps based on the selected map types.</span></div><div><span \
style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span \
style="font-family:arial,sans-serif;font-size:13px">It looks like we need some python \
tricks for g.remove GUI?</span></div><div><span \
style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span \
style="font-family:arial,sans-serif;font-size:13px">--  </span></div><div><span \
style="font-family:arial,sans-serif;font-size:13px">Huidae</span></div><div><span \
style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span \
style="font-family:arial,sans-serif;font-size:13px"><br></span></div></div><div \
class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 30, 2014 at 11:30 AM, \
Vaclav Petras <span dir="ltr">&lt;<a href="mailto:wenzeslaus@gmail.com" \
target="_blank">wenzeslaus@gmail.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div \
class="gmail_quote"><span class="">On Fri, Sep 26, 2014 at 6:53 AM, Huidae Cho <span \
dir="ltr">&lt;<a href="mailto:grass4u@gmail.com" \
target="_blank">grass4u@gmail.com</a>&gt;</span> wrote:<br></span><blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"><p dir="ltr">Markus,</p> <p dir="ltr">It has to be \
a single parameter because of commas in a pattern. Multiple map names are handled as \
a pattern internally e.g. map1,map2 =&gt; {map1,map2}.</p></blockquote><div>Then of \
course, PyGRASS has no chance to know that and the recent type enforcement addition \
will force you to use string instead of a \
list<br><br>cls.runModule(&#39;g.remove&#39;, flags=&#39;f&#39;, \
type=&#39;rast3d&#39;, pattern=[&#39;map_1&#39;, &#39;map_2&#39;, &#39;map_3&#39;, \
&#39;map_4&#39;, &#39;map_5&#39;, &#39;test_flowaccum&#39;])<br>...<br>TypeError: The \
Parameter &lt;pattern&gt; does not accept multiple inputs<br><br><a \
href="http://fatra.cnr.ncsu.edu/grassgistests/reports_for_date-2014-09-30-07-00/report_for_nc_spm_08_grass7_nc/raster3d/r3.flow/r3flow_test/index.html" \
target="_blank">http://fatra.cnr.ncsu.edu/grassgistests/reports_for_date-2014-09-30-07-00/report_for_nc_spm_08_grass7_nc/raster3d/r3.flow/r3flow_test/index.html</a> \
<br><br></div><div>(This test ends with error, PyGRASS is used \
internally.)<br><br></div><div>I don&#39;t know what to do about it besides stating \
that it how it is or relaxing the type checks in PyGRASS. Adding some info to the \
option like &quot;behaves as multiple=YES&quot; seem too complicated.<span \
class="HOEnZb"><font color="#888888"><br><br></font></span></div><span \
class="HOEnZb"><font color="#888888"><div>Vaclav<br></div></font></span><span \
class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> <p \
dir="ltr">Regards,<br> Huidae</p><div><div>
<div class="gmail_quote">On Sep 26, 2014 5:48 AM, &quot;Markus Neteler&quot; &lt;<a \
href="mailto:neteler@osgeo.org" target="_blank">neteler@osgeo.org</a>&gt; wrote:<br \
type="attribution"><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Huidae,<br> <br>
On Thu, Sep 25, 2014 at 6:20 PM, Huidae Cho &lt;<a href="mailto:grass4u@gmail.com" \
target="_blank">grass4u@gmail.com</a>&gt; wrote:<br> &gt; Markus,<br>
&gt;<br>
&gt; Currently, g.remove supports &quot;g.remove vect pattern=map1,map2&quot;. \
Pattern can<br> &gt; take multiple map names separated by a comma.<br>
<br>
ok, good. Perhaps I got just confused because the help text does not<br>
show this yet:<br>
<br>
current:<br>
  g.remove [-refb] type=datatype[,datatype,...] pattern=string<br>
  ...<br>
<br>
expected:<br>
  g.remove [-refb] type=datatype[,datatype,...] pattern=string[,string,...]<br>
...<br>
<br>
It would be multiple = YES for pattern to have that but I don&#39;t know<br>
if any other changes might be required then.<br>
<br>
Best<br>
Markus<br>
</blockquote></div>
</div></div></blockquote></span></div><br></div></div>
</blockquote></div><br></div>



_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic