[GRASS-dev] What is the status of g.list, g.remove, g.mlist and g.mremove?

Hi,

there was an effort to replace g.list by g.mlist and the same for g.remove/g.mremove?

What is the status now and how would the API change?

We can also have one as a script with different defaults if this would help to keep compatibility (then we would be able to make the changes any time later).

If there is some ticket for it, please update the ticket and make it a blocker for 7.0.0.

Vaclav

Hi,

I don’t think there is any ticket for it. Was it a blocker for 7.0.0? I created a new ticket for this (http://trac.osgeo.org/grass/ticket/2414).

There are two major changes:

  1. By default, g.mlist prints machine friendly outputs without -p while g.mlist -p mimics g.list outputs using a pager.
  2. g.mremove consolidated multiple options into the type= option.

If merging these modules was planned for 7.0.0 and there are no objections, I can replace them.

Regards,
Huidae

···

On Fri, Sep 12, 2014 at 9:05 PM, Vaclav Petras <wenzeslaus@gmail.com> wrote:

Hi,

there was an effort to replace g.list by g.mlist and the same for g.remove/g.mremove?

What is the status now and how would the API change?

We can also have one as a script with different defaults if this would help to keep compatibility (then we would be able to make the changes any time later).

If there is some ticket for it, please update the ticket and make it a blocker for 7.0.0.

Vaclav

On Sep 13, 2014 3:54 AM, “Huidae Cho” <grass4u@gmail.com> wrote:

There are two major changes:

2. g.mremove consolidated multiple options into the type= option.

I tested this just today and I am not convinced at all of this choice.
It looks dangerous to me.

I would prefer to see type as single option and pattern as multi option to remain as close as possible to what it used to be, allowing for e.g.

g.remove vect pattern=map1,map2

It rarely happens that you have maps with identical name but different type which you want to remove at the same time but rather that you have different map names of the same type you want to remove…
At the same time pattern allows to select something more complicated. But likely I don’t want to invent a regex for deleting three maps out of many.

Best
Markus

On Fri, Sep 12, 2014 at 9:05 PM, Vaclav Petras <wenzeslaus@gmail.com> wrote:

Hi,

there was an effort to replace g.list by g.mlist and the same for g.remove/g.mremove?

What is the status now and how would the API change?

We can also have one as a script with different defaults if this would help to keep compatibility (then we would be able to make the changes any time later).

If there is some ticket for it, please update the ticket and make it a blocker for 7.0.0.

Vaclav


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

Markus,

Currently, g.remove supports “g.remove vect pattern=map1,map2”. Pattern can take multiple map names separated by a comma. You don’t have to invent a wildcard or regex pattern for deleting a couple maps. g.mremove wouldn’t have replaced g.remove without this feature.

Regarding the type option, in some case, we may want to remove temporary raster and vector maps at once for example:

g.remove rast,vect pattern=“tmp*”

I don’t think this usage is particularly dangerous because the user must specify data types explicitly and it’s actually less dangerous than the old g.remove, IMO. g.remove also has the -f flag.

Regards,
Huidae

···

On Thu, Sep 25, 2014 at 12:01 PM, Markus Neteler <neteler@osgeo.org> wrote:

On Sep 13, 2014 3:54 AM, “Huidae Cho” <grass4u@gmail.com> wrote:

There are two major changes:

2. g.mremove consolidated multiple options into the type= option.

I tested this just today and I am not convinced at all of this choice.
It looks dangerous to me.

I would prefer to see type as single option and pattern as multi option to remain as close as possible to what it used to be, allowing for e.g.

g.remove vect pattern=map1,map2

It rarely happens that you have maps with identical name but different type which you want to remove at the same time but rather that you have different map names of the same type you want to remove…
At the same time pattern allows to select something more complicated. But likely I don’t want to invent a regex for deleting three maps out of many.

Best
Markus

On Fri, Sep 12, 2014 at 9:05 PM, Vaclav Petras <wenzeslaus@gmail.com> wrote:

Hi,

there was an effort to replace g.list by g.mlist and the same for g.remove/g.mremove?

What is the status now and how would the API change?

We can also have one as a script with different defaults if this would help to keep compatibility (then we would be able to make the changes any time later).

If there is some ticket for it, please update the ticket and make it a blocker for 7.0.0.

Vaclav


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

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

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}.

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

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

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?

···

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 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

Hi all,

I lost a bit of track here - what is the current state? My real
question regards the needed backport to relbranch7 in order to be able
to prepare the next beta (the first RC should come with the definite
API).

thanks,
Markus

Markus,

These modules work fine in command line, but GUI has some issues (ticket #2437). I’ll backport to rel7 once GUI gets fixed.

Thank you.
Huidae

···

On Wed, Oct 8, 2014 at 12:03 PM, Markus Neteler <neteler@osgeo.org> wrote:

Hi all,

I lost a bit of track here - what is the current state? My real
question regards the needed backport to relbranch7 in order to be able
to prepare the next beta (the first RC should come with the definite
API).

thanks,
Markus