Re: [GRASS-dev] pygrass: How to allow Ctrl-C to stop all subprocesses of GridModule

2018-03-08 Thread Nikos Alexandris

* Moritz Lennert  [2018-03-08 15:05:46 +0100]:


And another question on GridModule:

For the same module using GridModule to split the task of edge 
detection in a raster map into many parallel tasks, when I want to 
stop the module run using Ctrl-C I get tons of


Process PoolWorker-315:
Traceback (most recent call last):
Traceback (most recent call last):
 File "/usr/lib/python2.7/multiprocessing/process.py", line 267, in 
_bootstrap
 File "/usr/lib/python2.7/multiprocessing/process.py", line 267, in 
_bootstrap

   self.run()
   self.run()
 File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
 File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
   self._target(*self._args, **self._kwargs)
   self._target(*self._args, **self._kwargs)
 File "/usr/lib/python2.7/multiprocessing/pool.py", line 102, in worker
 File "/usr/lib/python2.7/multiprocessing/pool.py", line 102, in worker
   task = get()
 File "/usr/lib/python2.7/multiprocessing/queues.py", line 374, in get
   task = get()
 File "/usr/lib/python2.7/multiprocessing/queues.py", line 374, in get
   racquire()
   racquire()
KeyboardInterrupt


and cannot stop the module, even when flooding the input with Ctrl-Cs.

Any hint how to allow Ctrl-C to stop all subprocesses ?

Moritz


Moritz, could it be a case related to the ones mentioned in

https://stackoverflow.com/a/1635084/1172302
https://stackoverflow.com/a/11816038/1172302

?

Nikos




signature.asc
Description: PGP signature
___
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev

[GRASS-dev] [release planning] GRASS GIS 7.2.3

2018-03-08 Thread Markus Neteler
Hi devs,

as discussed in the general release thread on this list, it is now
time to package RC1 of GRASS GIS 7.2.3:

https://trac.osgeo.org/grass/milestone/7.2.3

Except for a small r.grow.distance backport I don't see any other
business needed here:
https://trac.osgeo.org/grass/wiki/Grass7Planning#a7.2.3tobebackported

Please quickly check the draft release page in trac:
https://trac.osgeo.org/grass/wiki/Release/7.2.3-News

If there are no objections, I'll package 7.2.3RC1 tonight or tomorrow.

thanks,
Markus
___
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev

Re: [GRASS-dev] [GRASS GIS] #3511: [patch] v.buffer: allow squared buffers around points

2018-03-08 Thread GRASS GIS
#3511: [patch] v.buffer: allow squared buffers around points
--+-
  Reporter:  mlennert |  Owner:  grass-dev@…
  Type:  enhancement  | Status:  new
  Priority:  normal   |  Milestone:  7.4.1
 Component:  Vector   |Version:  svn-trunk
Resolution:   |   Keywords:  v.buffer squared buffer
   CPU:  Unspecified  |   Platform:  Unspecified
--+-

Comment (by mlennert):

 Replying to [comment:2 mmetz]:
 > Replying to [comment:1 mlennert]:
 > > Replying to [ticket:3511 mlennert]:
 > > > The attached patch implements squared buffers around points.
 > >
 > > Forgot to explain: with the patch, v.buffer should create square
 buffers around points if the -s flag is set.
 >
 > Currently v.buffer always uses Vect_point_buffer2() for points, but the
 Vect_*_buffer*() functions might disappear at some stage because they are
 not working properly (apart from point buffering). Therefore it might be
 safer to add this functionality to v.buffer directly.

 Please check the attached new patch.

-- 
Ticket URL: 
GRASS GIS 

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

Re: [GRASS-dev] [GRASS GIS] #3511: [patch] v.buffer: allow squared buffers around points

2018-03-08 Thread GRASS GIS
#3511: [patch] v.buffer: allow squared buffers around points
--+-
  Reporter:  mlennert |  Owner:  grass-dev@…
  Type:  enhancement  | Status:  new
  Priority:  normal   |  Milestone:  7.4.1
 Component:  Vector   |Version:  svn-trunk
Resolution:   |   Keywords:  v.buffer squared buffer
   CPU:  Unspecified  |   Platform:  Unspecified
--+-
Changes (by mlennert):

 * Attachment "squared_buffer_around_points_directly_in_vbuffer.diff"
 added.

 second version of a patch, this time directly in main.c of v.buffer

-- 
Ticket URL: 
GRASS GIS 

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

Re: [GRASS-dev] pygrass: how to use GridModule with a module that has a 'width' parameter

2018-03-08 Thread Moritz Lennert

On 08/03/18 15:18, Vaclav Petras wrote:



On Tue, Mar 6, 2018 at 8:59 AM, Moritz Lennert 
> wrote:


Hi,

I'm trying to run the i.zc module in parallel on several tiles. I
use this syntax

     if options['tile_width']:
         parallel = True
         width = int(options['tile_width'])
         height = int(options['tile_height'])
         overlap = int(options['overlap'])

     processes = int(options['processes'])



kwargs = {'input' : inputraster,
           'output' : temp_edge_map,
           'width' : int(options['zc_width']),
           'threshold' : float(options['zc_threshold']),
           'quiet' : True}

if parallel:
    grd = GridModule('i.zc',
                     width=width,
                     height=height,
                     overlap=overlap,
                     processes=processes,
                     split=False,
                     **kwargs)


However, this fails (understandably) with

TypeError: type object got multiple values for keyword argument 'width'

Is there a way to work around this name conflict ? Do I have to
define my own class derived from GridModule to change the parameter
names ?


Try `width_` instead of `width` for the module parameter. This is how 
grass.script works (mostly to avoid conflicts with Python keywords 
namely lambda), but without checking the code, I don't know if PyGRASS 
has this implemented.


It doesn't. I tried width_ for both the i.zc parameter and the 
GridModule parameter. Neither were accepted as valid parameters.


Moritz
___
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev

Re: [GRASS-dev] pygrass: how to use GridModule with a module that has a 'width' parameter

2018-03-08 Thread Vaclav Petras
On Tue, Mar 6, 2018 at 8:59 AM, Moritz Lennert  wrote:

> Hi,
>
> I'm trying to run the i.zc module in parallel on several tiles. I use this
> syntax
>
> if options['tile_width']:
> parallel = True
> width = int(options['tile_width'])
> height = int(options['tile_height'])
> overlap = int(options['overlap'])
>
> processes = int(options['processes'])
>
>
>
> kwargs = {'input' : inputraster,
>   'output' : temp_edge_map,
>   'width' : int(options['zc_width']),
>   'threshold' : float(options['zc_threshold']),
>   'quiet' : True}
>
> if parallel:
>grd = GridModule('i.zc',
> width=width,
> height=height,
> overlap=overlap,
> processes=processes,
> split=False,
> **kwargs)
>
>
> However, this fails (understandably) with
>
> TypeError: type object got multiple values for keyword argument 'width'
>
> Is there a way to work around this name conflict ? Do I have to define my
> own class derived from GridModule to change the parameter names ?
>

Try `width_` instead of `width` for the module parameter. This is how
grass.script works (mostly to avoid conflicts with Python keywords namely
lambda), but without checking the code, I don't know if PyGRASS has this
implemented.

Vaclav
___
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev

[GRASS-dev] pygrass: How to allow Ctrl-C to stop all subprocesses of GridModule

2018-03-08 Thread Moritz Lennert

And another question on GridModule:

For the same module using GridModule to split the task of edge detection 
in a raster map into many parallel tasks, when I want to stop the module 
run using Ctrl-C I get tons of


Process PoolWorker-315:
Traceback (most recent call last):
Traceback (most recent call last):
  File "/usr/lib/python2.7/multiprocessing/process.py", line 267, in 
_bootstrap
  File "/usr/lib/python2.7/multiprocessing/process.py", line 267, in 
_bootstrap

self.run()
self.run()
  File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
  File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
self._target(*self._args, **self._kwargs)
self._target(*self._args, **self._kwargs)
  File "/usr/lib/python2.7/multiprocessing/pool.py", line 102, in worker
  File "/usr/lib/python2.7/multiprocessing/pool.py", line 102, in worker
task = get()
  File "/usr/lib/python2.7/multiprocessing/queues.py", line 374, in get
task = get()
  File "/usr/lib/python2.7/multiprocessing/queues.py", line 374, in get
racquire()
racquire()
KeyboardInterrupt


and cannot stop the module, even when flooding the input with Ctrl-Cs.

Any hint how to allow Ctrl-C to stop all subprocesses ?

Moritz
___
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev

Re: [GRASS-dev] pygrass: how to use GridModule with a module that has a 'width' parameter

2018-03-08 Thread Moritz Lennert

No one for an answer to this one ?

On 06/03/18 14:59, Moritz Lennert wrote:

Hi,

I'm trying to run the i.zc module in parallel on several tiles. I use
this syntax

  if options['tile_width']:
  parallel = True
  width = int(options['tile_width'])
  height = int(options['tile_height'])
  overlap = int(options['overlap'])

  processes = int(options['processes'])



kwargs = {'input' : inputraster,
'output' : temp_edge_map,
'width' : int(options['zc_width']),
'threshold' : float(options['zc_threshold']),
'quiet' : True}

if parallel:
 grd = GridModule('i.zc',
  width=width,
  height=height,
  overlap=overlap,
  processes=processes,
  split=False,
  **kwargs)


However, this fails (understandably) with

TypeError: type object got multiple values for keyword argument 'width'

Is there a way to work around this name conflict ? Do I have to define
my own class derived from GridModule to change the parameter names ?

Moritz
___
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev




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

Re: [GRASS-dev] [GRASS GIS] #3506: 3D view mode not available: Reason: name '__int64' is not defined

2018-03-08 Thread GRASS GIS
#3506: 3D view mode not available: Reason: name '__int64' is not defined
--+-
  Reporter:  hellik   |  Owner:  grass-dev@…
  Type:  defect   | Status:  closed
  Priority:  major|  Milestone:  7.6.0
 Component:  wxGUI|Version:  svn-trunk
Resolution:  fixed|   Keywords:
   CPU:  Unspecified  |   Platform:  MSWindows 8
--+-
Changes (by mmetz):

 * status:  new => closed
 * resolution:   => fixed


Comment:

 Replying to [comment:5 hellik]:
 > Replying to [comment:4 martinl]:
 > > Feel free to close the issue...
 >
 > not sure if anything more is needed; maybe mmetz can answer this.

 Nothing else needed, closing as fixed.

-- 
Ticket URL: 
GRASS GIS 

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

Re: [GRASS-dev] [GRASS GIS] #3506: 3D view mode not available: Reason: name '__int64' is not defined

2018-03-08 Thread GRASS GIS
#3506: 3D view mode not available: Reason: name '__int64' is not defined
--+-
  Reporter:  hellik   |  Owner:  grass-dev@…
  Type:  defect   | Status:  new
  Priority:  major|  Milestone:  7.6.0
 Component:  wxGUI|Version:  svn-trunk
Resolution:   |   Keywords:
   CPU:  Unspecified  |   Platform:  MSWindows 8
--+-

Comment (by hellik):

 Replying to [comment:4 martinl]:
 > Feel free to close the issue...

 not sure if anything more is needed; maybe mmetz can answer this.

-- 
Ticket URL: 
GRASS GIS 

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

Re: [GRASS-dev] [GRASS GIS] #3506: 3D view mode not available: Reason: name '__int64' is not defined

2018-03-08 Thread GRASS GIS
#3506: 3D view mode not available: Reason: name '__int64' is not defined
--+-
  Reporter:  hellik   |  Owner:  grass-dev@…
  Type:  defect   | Status:  new
  Priority:  major|  Milestone:  7.6.0
 Component:  wxGUI|Version:  svn-trunk
Resolution:   |   Keywords:
   CPU:  Unspecified  |   Platform:  MSWindows 8
--+-

Comment (by martinl):

 Feel free to close the issue...

-- 
Ticket URL: 
GRASS GIS 

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

Re: [GRASS-dev] [GRASS GIS] #3506: 3D view mode not available: Reason: name '__int64' is not defined

2018-03-08 Thread GRASS GIS
#3506: 3D view mode not available: Reason: name '__int64' is not defined
--+-
  Reporter:  hellik   |  Owner:  grass-dev@…
  Type:  defect   | Status:  new
  Priority:  major|  Milestone:  7.6.0
 Component:  wxGUI|Version:  svn-trunk
Resolution:   |   Keywords:
   CPU:  Unspecified  |   Platform:  MSWindows 8
--+-

Comment (by hellik):

 Replying to [comment:2 mmetz]:
 > Replying to [comment:1 mmetz]:
 > > Applies to trunk only. It seems to be a ctypes problem with the new 64
 integer type.
 >
 > The problem is apparently in
 
[https://trac.osgeo.org/grass/browser/grass/trunk/lib/python/ctypes/ctypesgencore/ctypedescs.py#L26
 ctypedescs.py]: the `ctypes_type_map` does not include `__int64` if
 `sys.platform == 'win32'`

 tested now with

 {{{
 System Info
 GRASS version: 7.5.svn
 GRASS SVN revision: r72331
 Build date: 2018-03-07
 Build platform: x86_64-w64-mingw32
 GDAL: 2.2.3
 PROJ.4: 4.9.3
 GEOS: 3.5.0
 SQLite: 3.17.0
 Python: 2.7.5
 wxPython: 2.8.12.1
 Platform: Windows-8-6.2.9200 (OSGeo4W)
 }}}

 {{{
 Starting 3D view mode...
 Loading raster map ...
 Loading raster map ...
 Translating colors from raster map ...
 Switching back to 2D view mode...
 Raster map  unloaded successfully
 }}}

 r72328 seems to fix this issue.

-- 
Ticket URL: 
GRASS GIS 

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