Re: [GRASS-dev] Python Unit-test On "r.basins.fill"

2018-03-24 Thread Luca Delucchi
On 24 March 2018 at 03:33, Sunveer Singh  wrote:
> Hi,
>

Hi Sunveer,

> Thanks for the feedback, I have attached the complete working test, run on
> nc_basic_spm_grass7

thanks a lot, submitted in r72546.
https://trac.osgeo.org/grass/changeset/72546

>
> Thank You
> Sunveer
> https://sunveersingh.github.io/
>


-- 
ciao
Luca

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

Re: [GRASS-dev] Python Unit-test On "r.basins.fill"

2018-03-24 Thread Sunveer Singh
Thanks a lot.

Now on which module should I write test?

Thank You
Sunveer
https://sunveersingh.github.io

On Sat, 24 Mar 2018, 14:37 Luca Delucchi,  wrote:

> On 24 March 2018 at 03:33, Sunveer Singh  wrote:
> > Hi,
> >
>
> Hi Sunveer,
>
> > Thanks for the feedback, I have attached the complete working test, run
> on
> > nc_basic_spm_grass7
>
> thanks a lot, submitted in r72546.
> https://trac.osgeo.org/grass/changeset/72546
>
> >
> > Thank You
> > Sunveer
> > https://sunveersingh.github.io/
> >
>
>
> --
> ciao
> Luca
>
> www.lucadelu.org
>
___
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev

Re: [GRASS-dev] [GRASS GIS] #3385: Typo in the i.vi man page

2018-03-24 Thread GRASS GIS
#3385: Typo in the i.vi man page
--+--
  Reporter:  micha|  Owner:  grass-dev@…
  Type:  task | Status:  new
  Priority:  normal   |  Milestone:  7.2.3
 Component:  Docs |Version:  7.2.0
Resolution:   |   Keywords:  Vegetation Index
   CPU:  Unspecified  |   Platform:  All
--+--

Comment (by veroandreo):

 In [changeset:"72549" 72549]:
 {{{
 #!CommitTicketReference repository="" revision="72549"
 i.vi: corrected MSAVI2 equation according to
 https://doi.org/10.1016/0034-4257(94)90134-1, see #3385
 }}}

-- 
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] #3385: Typo in the i.vi man page

2018-03-24 Thread GRASS GIS
#3385: Typo in the i.vi man page
--+--
  Reporter:  micha|  Owner:  grass-dev@…
  Type:  task | Status:  new
  Priority:  normal   |  Milestone:  7.2.3
 Component:  Docs |Version:  7.2.0
Resolution:   |   Keywords:  Vegetation Index
   CPU:  Unspecified  |   Platform:  All
--+--

Comment (by veroandreo):

 In [changeset:"72552" 72552]:
 {{{
 #!CommitTicketReference repository="" revision="72552"
 i.vi: corrected MSAVI2 equation according to
 https://doi.org/10.1016/0034-4257(94)90134-1, see #3385 (trunk, r72549)
 }}}

-- 
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] #3385: Typo in the i.vi man page

2018-03-24 Thread GRASS GIS
#3385: Typo in the i.vi man page
--+--
  Reporter:  micha|  Owner:  grass-dev@…
  Type:  task | Status:  closed
  Priority:  normal   |  Milestone:  7.2.3
 Component:  Docs |Version:  7.2.0
Resolution:  fixed|   Keywords:  Vegetation Index
   CPU:  Unspecified  |   Platform:  All
--+--
Changes (by veroandreo):

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


Comment:

 In [changeset:"72554" 72554]:
 {{{
 #!CommitTicketReference repository="" revision="72554"
 i.vi: corrected MSAVI2 equation according to
 https://doi.org/10.1016/0034-4257(94)90134-1, fix #3385 (trunk, r72549)
 }}}

-- 
Ticket URL: 
GRASS GIS 

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

Re: [GRASS-dev] Python Unit-test On "r.basins.fill"

2018-03-24 Thread Veronica Andreo
Hi Sunveer,

It's great to have you back!! Thanks much for your contributions and
enthusiasm!

Here are some modules that are lacking tests:
* v.to.db
* v.to.rast
* v.support
* r.what
* several r.out.* modules
* i.pca

Cheers from the code sprint in Bonn :)
Vero


2018-03-24 10:08 GMT+01:00 Sunveer Singh :

> Thanks a lot.
>
> Now on which module should I write test?
>
> Thank You
> Sunveer
> https://sunveersingh.github.io
>
> On Sat, 24 Mar 2018, 14:37 Luca Delucchi,  wrote:
>
>> On 24 March 2018 at 03:33, Sunveer Singh 
>> wrote:
>> > Hi,
>> >
>>
>> Hi Sunveer,
>>
>> > Thanks for the feedback, I have attached the complete working test, run
>> on
>> > nc_basic_spm_grass7
>>
>> thanks a lot, submitted in r72546.
>> https://trac.osgeo.org/grass/changeset/72546
>>
>> >
>> > Thank You
>> > Sunveer
>> > https://sunveersingh.github.io/
>> >
>>
>>
>> --
>> ciao
>> Luca
>>
>> www.lucadelu.org
>>
>
> ___
> 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] #3482: i.atcorr: Add Sentinel-2B

2018-03-24 Thread GRASS GIS
#3482: i.atcorr: Add Sentinel-2B
--+---
  Reporter:  sbl  |  Owner:  sbl
  Type:  enhancement  | Status:  closed
  Priority:  normal   |  Milestone:  7.6.0
 Component:  Imagery  |Version:  svn-trunk
Resolution:  fixed|   Keywords:  i.atcorr
   CPU:  All  |   Platform:  All
--+---

Comment (by neteler):

 Replying to [comment:12 mmetz]:
 > Sentinel-2B has been added to i.atcorr in trunk r72127,8.

 For the record: it includes the update of the Sentinel-2A curves as well.

-- 
Ticket URL: 
GRASS GIS 

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

Re: [GRASS-dev] Python Unit-test On "r.basins.fill"

2018-03-24 Thread Sunveer Singh
Hi,

Let's, start with v.to.db, I attached the test for it.

if any improvements are needed, please let me know.


Thank You
Sunveer
https://sunveersingh.github.io/

On Sat, Mar 24, 2018 at 5:19 PM, Veronica Andreo 
wrote:

> Hi Sunveer,
>
> It's great to have you back!! Thanks much for your contributions and
> enthusiasm!
>
> Here are some modules that are lacking tests:
> * v.to.db
> * v.to.rast
> * v.support
> * r.what
> * several r.out.* modules
> * i.pca
>
> Cheers from the code sprint in Bonn :)
> Vero
>
>
> 2018-03-24 10:08 GMT+01:00 Sunveer Singh :
>
>> Thanks a lot.
>>
>> Now on which module should I write test?
>>
>> Thank You
>> Sunveer
>> https://sunveersingh.github.io
>>
>> On Sat, 24 Mar 2018, 14:37 Luca Delucchi,  wrote:
>>
>>> On 24 March 2018 at 03:33, Sunveer Singh 
>>> wrote:
>>> > Hi,
>>> >
>>>
>>> Hi Sunveer,
>>>
>>> > Thanks for the feedback, I have attached the complete working test,
>>> run on
>>> > nc_basic_spm_grass7
>>>
>>> thanks a lot, submitted in r72546.
>>> https://trac.osgeo.org/grass/changeset/72546
>>>
>>> >
>>> > Thank You
>>> > Sunveer
>>> > https://sunveersingh.github.io/
>>> >
>>>
>>>
>>> --
>>> ciao
>>> Luca
>>>
>>> www.lucadelu.org
>>>
>>
>> ___
>> grass-dev mailing list
>> grass-dev@lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/grass-dev
>>
>
>
"""
Name:   v.to.db
Purpose:Tests v.to.db and its flags/options.
	
Author: Sunveer Singh
Copyright:  (C) 2017 by Sunveer Singh and the GRASS Development Team
Licence:This program is free software under the GNU General Public
	License (>=v2). Read the file COPYING that comes with GRASS
	for details.
"""
from grass.gunittest.case import TestCase

class Testvtodb(TestCase):
map='geology'

@classmethod
def setUpClass(cls):
cls.use_temp_region()

@classmethod
def tearDownClass(cls):
cls.del_temp_region()


def testlength(self):
"""Testing option lenght and columns cat"""
self.assertModule('v.to.db', map=self.map, option="length", columns="CAT")
topology = dict(points=0)
	self.assertVectorFitsTopoInfo(self.map, topology)

def testarea(self):
"""Testing option area and columns ID"""
self.assertModule('v.to.db', map=self.map, option="area", columns="ID")
topology = dict(points=0)
	self.assertVectorFitsTopoInfo(self.map, topology)

def testperimeter(self):
"""Testing option perimeter and columns LABEL"""
self.assertModule('v.to.db', map=self.map, option="perimeter", columns="LABEL")
topology = dict(points=0)
	self.assertVectorFitsTopoInfo(self.map, topology)

def testcount(self):
"""Testing option count and columns LOCATION"""
self.assertModule('v.to.db', map=self.map, option="count", columns="LOCATION")
topology = dict(points=0)
	self.assertVectorFitsTopoInfo(self.map, topology)

def testslope(self):
"""Testing option slope and columns CITY"""
self.assertModule('v.to.db', map=self.map, option="slope", columns="CITY")
topology = dict(points=0)
	self.assertVectorFitsTopoInfo(self.map, topology)

if __name__ == '__main__':
from grass.gunittest.main import test
test()
___
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev

Re: [GRASS-dev] [GRASS GIS] #3482: i.atcorr: Add Sentinel-2B

2018-03-24 Thread GRASS GIS
#3482: i.atcorr: Add Sentinel-2B
--+---
  Reporter:  sbl  |  Owner:  sbl
  Type:  enhancement  | Status:  closed
  Priority:  normal   |  Milestone:  7.4.1
 Component:  Imagery  |Version:  svn-trunk
Resolution:  fixed|   Keywords:  i.atcorr
   CPU:  All  |   Platform:  All
--+---
Changes (by neteler):

 * milestone:  7.6.0 => 7.4.1


Comment:

 I made a full sync to trunk in relbranch74 (r72557) since otherwise
 i.atcorr could not be maintained any more (too many differences). Now all
 in sync again, will be available in 7.4.1.

-- 
Ticket URL: 
GRASS GIS 

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

[GRASS-dev] [GRASS GIS] #3537: Add functionalities –tmp-location and –no-clean

2018-03-24 Thread GRASS GIS
#3537: Add functionalities –tmp-location and –no-clean
--+-
 Reporter:  radeknovotny94|  Owner:  grass-dev@…
 Type:  enhancement   | Status:  new
 Priority:  normal|  Milestone:  8.0.0
Component:  Startup   |Version:  svn-trunk
 Keywords:  tmp-location, no-clean, exec  |CPU:  All
 Platform:  All   |
--+-
 Implementation of –-tmp-location, which extends functionality –exec.
 Creates new temporary location, where takes place the computation from
 –exect and after that is location deleted.

 Second functionality –no-clean arranges that after computation location
 and temporary files are not deleted.

 See [https://trac.osgeo.org/grass/wiki/GSoC/2018#Neweasy-to-
 useCLIandAPIforGRASSGIS]

 attachment:grass-tmp-loc.diff

-- 
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] #3537: Add functionalities –tmp-location and –no-clean

2018-03-24 Thread GRASS GIS
#3537: Add functionalities –tmp-location and –no-clean
-+--
  Reporter:  radeknovotny94  |  Owner:  grass-dev@…
  Type:  enhancement | Status:  new
  Priority:  normal  |  Milestone:  8.0.0
 Component:  Startup |Version:  svn-trunk
Resolution:  |   Keywords:  tmp-location, no-clean, exec
   CPU:  All |   Platform:  All
-+--
Changes (by radeknovotny94):

 * Attachment "grass-tmp-loc.diff" added.


-- 
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] #3537: Add functionalities –tmp-location and –no-clean

2018-03-24 Thread GRASS GIS
#3537: Add functionalities –tmp-location and –no-clean
-+--
  Reporter:  radeknovotny94  |  Owner:  grass-dev@…
  Type:  enhancement | Status:  new
  Priority:  normal  |  Milestone:  8.0.0
 Component:  Startup |Version:  svn-trunk
Resolution:  |   Keywords:  tmp-location, no-clean, exec
   CPU:  All |   Platform:  All
-+--

Comment (by wenzeslaus):

 Thumbs up for creating a `find_tmp()` function, but you replaced:

 {{{
 #!python
 for ttmp in ("/tmp", "/var/tmp", "/usr/tmp"):
 tmp = ttmp
 tmpdir = os.path.join(tmp, "grass7-%(user)s-%(lock)s" % {
   'user': user, 'lock': gis_lock})
 try:
 os.mkdir(tmpdir, 0o700)
 except:
 tmp = None
 if tmp:
 break
 }}}

 by:

 {{{
 #!python
 def find_tmp():
 ...
 for ttmp in ("/tmp", "/var/tmp", "/usr/tmp"):
 tmp = ttmp
 ...
 tmp = find_tmp()
 tmpdir = os.path.join(tmp, "grass7-%(user)s-%(lock)s" % {'user': user,
  'lock':
 gis_lock})
 try:
 os.mkdir(tmpdir, 0o700)
 ...
 }}}

 Note esp. the for loop and the test using try.

-- 
Ticket URL: 
GRASS GIS 

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

Re: [GRASS-dev] d.linegraph: secondary_width parameter defined as integer but default value is a float

2018-03-24 Thread Vaclav Petras
On Fri, Mar 23, 2018 at 7:54 PM, Markus Neteler  wrote:

> On Fri, Mar 23, 2018 at 11:54 PM, Pietro  wrote:
> > Dear dev,
> >
> > I've noticed that the module d.linegraph define the secondary_width
> > parameter as follow:
> >
> >
> > ```
> > /* theoretically for other things than points */
> > secondary_width_opt = G_define_option();
> > secondary_width_opt->key = "secondary_width";
> > secondary_width_opt->description = _("Width of point symbol lines");
> > secondary_width_opt->type = TYPE_INTEGER;
> > secondary_width_opt->required = NO;
> > secondary_width_opt->multiple = YES;
> > secondary_width_opt->answer = "0.1";
> > ```
> >
> > So the parameter type is supposed to be an integer, but the default
> value it
> > is a float?
> > Is it intentional and in case why?
>
> It came in through r69694. Probably simply an oversight?
>


secondary_width_opt is used to set symbol_line_width which is of type
double, the conversion is done with atof(), and symbol_line_width is used
for D_line_width() which takes double, so no, it is not intentional. Fixed
in r72558, backported to 7.4 in 72559.

https://trac.osgeo.org/grass/browser/grass/trunk/display/d.linegraph/main.c
https://trac.osgeo.org/grass/changeset/69694
https://grass.osgeo.org/programming7/draw2_8c.html#a7d7fc5729a6e6d14ad6403ed53466414
https://trac.osgeo.org/grass/changeset/72558
___
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev

Re: [GRASS-dev] Python Unit-test On "r.basins.fill"

2018-03-24 Thread Luca Delucchi
On 24 March 2018 at 16:48, Sunveer Singh  wrote:
> Hi,
>

Hi Sunveer,

> Let's, start with v.to.db, I attached the test for it.
>
> if any improvements are needed, please let me know.
>

I'm sorry but you should change something.
In setUpClass you should copy the geology map because I run the script
in user1 mapset and it failed.
In tearDownClass you should remove the created map.

>
> Thank You
> Sunveer
> https://sunveersingh.github.io/
>

-- 
ciao
Luca

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

Re: [GRASS-dev] Python Unit-test On "r.basins.fill"

2018-03-24 Thread Sunveer Singh
Hi,

Done, attached the working file!

Thank You
Sunveer
https://sunveersingh.github.io/

On Sun, Mar 25, 2018 at 5:59 AM, Luca Delucchi  wrote:

> On 24 March 2018 at 16:48, Sunveer Singh  wrote:
> > Hi,
> >
>
> Hi Sunveer,
>
> > Let's, start with v.to.db, I attached the test for it.
> >
> > if any improvements are needed, please let me know.
> >
>
> I'm sorry but you should change something.
> In setUpClass you should copy the geology map because I run the script
> in user1 mapset and it failed.
> In tearDownClass you should remove the created map.
>
> >
> > Thank You
> > Sunveer
> > https://sunveersingh.github.io/
> >
>
> --
> ciao
> Luca
>
> www.lucadelu.org
>
"""
Name:   v.to.db
Purpose:Tests v.to.db and its flags/options.
	
Author: Sunveer Singh
Copyright:  (C) 2017 by Sunveer Singh and the GRASS Development Team
Licence:This program is free software under the GNU General Public
	License (>=v2). Read the file COPYING that comes with GRASS
	for details.
"""

import os
from grass.gunittest.case import TestCase

class Testvtodb(TestCase):
map='geology'
mapold='geology'

@classmethod
def setUpClass(cls):
cls.use_temp_region()
cls.runModule('g.copy', vector=(cls.map, cls.mapold))   

@classmethod
def tearDownClass(cls):
cls.del_temp_region()
if os.path.isfile(cls.mapold):
	os.remove(cls.mapold)

def testlength(self):
"""Testing option lenght and columns cat"""
self.assertModule('v.to.db', map=self.map, option="length", columns="CAT")
topology = dict(points=0)
	self.assertVectorFitsTopoInfo(self.map, topology)

def testarea(self):
"""Testing option area and columns ID"""
self.assertModule('v.to.db', map=self.map, option="area", columns="ID")
topology = dict(points=0)
	self.assertVectorFitsTopoInfo(self.map, topology)

def testperimeter(self):
"""Testing option perimeter and columns LABEL"""
self.assertModule('v.to.db', map=self.map, option="perimeter", columns="LABEL")
topology = dict(points=0)
	self.assertVectorFitsTopoInfo(self.map, topology)

def testcount(self):
"""Testing option count and columns LOCATION"""
self.assertModule('v.to.db', map=self.map, option="count", columns="LOCATION")
topology = dict(points=0)
	self.assertVectorFitsTopoInfo(self.map, topology)

def testslope(self):
"""Testing option slope and columns CITY"""
self.assertModule('v.to.db', map=self.map, option="slope", columns="CITY")
topology = dict(points=0)
	self.assertVectorFitsTopoInfo(self.map, topology)

if __name__ == '__main__':
from grass.gunittest.main import test
test()
___
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev