[GRASS-stats] Some refactoring and fixing

Rainer M Krug Rainer at krugs.de
Thu Jan 29 01:44:11 PST 2015


Roger Bivand <Roger.Bivand at nhh.no> writes:

> On Wed, 28 Jan 2015, Rainer M Krug wrote:
>
>> OK - the problem seems to be a name conflict. The build system status
>> report [1] states:
>>
>> ,----
>> | - Package name conflicts:
>> | ...
>> | [7] "rspatial: spgrass6"     "spgrass: spgrass6"
>> `----
>
> Right, spgrass6 is still hosted as part of rspatial (it was originally
> there). I'll try to resolve this by removing it from that project.

Thanks Roger - spgrass6 is now available to be installed via

--8<---------------cut here---------------start------------->8---

install.packages("spgrass6", repos="http://R-Forge.R-project.org")

--8<---------------cut here---------------end--------------->8---

for windows (source and compiled), linux (source) and Mac (source).

Is there any possibility to remove the spgrass package (which has been
renamed to spgrass7) from the R Packages listing [1] to avoid confusion?

> The file oChangeLog is the frozen ChangeLog from its original project,
> so when releasing, we need to run:
>
> cd spgrass6 # or 7
> svn up
> sh svn2cl.sh # must be on PATH
> # if formatted too narrowly
> # fmt < ChangeLog > tmp
> # mv tmp ChangeLog
> cat oChangeLog >> ChangeLog
> cp ChangeLog inst
> svn commit -m tidy
> svn up
> cd ..
>
> to build a ChangeLog including all past history.

Concerning changes before release:

1) I would suggest to create for all functions which have a 6 at the end
(e.g. redRAST6) an alias without the 6 (e.g. readRAST). By using these
names without the 6 the switch between GRASS (and related spgrassX)
versions will require mainly a switch of the library used. For further
versions of spgrassX I would suggest to drop the numbers completely as,
even when spgrass6 and spgrass7 are loaded at the same time, specific
versions can be accessed by using the :: (i.e. spgrass6::readRAST).

2) I will go through the code and remove references (and version checks)
to GRASS GIS 7 to simplify the code. These checks are not needed anymore as
the check for the GRASS GIS version is done upon loading (only loads
when started outside grass session or inside grass 6.x session) and on
initGRASS() (aborts if gisBase points to grass 6.x installation)

Otherwise I can't thinkl of any other points before release.

Thanks,

Rainer

>
> Roger
>
>>
>> So the easiest to install at the moment seems to be to checkout the
>> sources via
>>
>> ,----
>> | svn checkout svn://r-forge.r-project.org/svnroot/spgrass/
>> `----
>>
>> and then install from the sources.
>>
>> Cheers,
>>
>> Rainer
>>
>> Rainer M Krug <Rainer at krugs.de> writes:
>>
>>> Hi Roger
>>>
>>> it seems that there is something not as it should be with the builds of
>>> spgrass6 and spgrass7 - there are at the moment GRASS, spgrass and
>>> spgrass7 but no spgrass6 - I don't have much experience with r-forge,
>>> could you please check what is going on?
>>>
>>> Thanks,
>>>
>>> Rainer
>>>
>>> Rainer M Krug <r.m.krug at gmail.com> writes:
>>>
>>>> Envoyé de mon iPhone
>>>>
>>>>> Le 28 janv. 2015 à 15:55, Thomas Adams <tea3rd at gmail.com> a écrit :
>>>>>
>>>>> Rainer,
>>>>>
>>>>> Where can I get the new spgrass6 and spgrass7 to do some testing?
>>>>
>>>> The repository is on https://r-forge.r-project.org/projects/spgrass/   .
>>>>
>>>> It doesn't seem to be build yet so you have to install it from the svn
>>>> repo or wait a few hours - then you shoud be able to install it via
>>>>
>>>>  	R install command: install.packages("spgrass6", repos="http://R-Forge.R-project.org")
>>>>
>>>>  	Cheers,
>>>>
>>>> Rainer
>>>>> Thank you,
>>>>> Tom
>>>>>
>>>>>> On Wed, Jan 28, 2015 at 7:23 AM, Rainer M Krug <Rainer at krugs.de> wrote:
>>>>>> Rainer M Krug <Rainer at krugs.de> writes:
>>>>>>
>>>>>>> Roger Bivand <Roger.Bivand-aX1nC9UfZf8 at public.gmane.org> writes:
>>>>>>>
>>>>>>>> On Tue, 27 Jan 2015, Rainer M Krug wrote:
>>>>>>>>
>>>>>>>>> Hi
>>>>>>>>>
>>>>>>>>> I just committed a few of commits which refactor the code of readRAST,
>>>>>>>>> writeRAST, readVECT & writeVECT by creating internal fi=unctions for
>>>>>>>>> reading / writing for plugin / non-plugin and moving the default values
>>>>>>>>> (get...Options()) into the function definitions.
>>>>>>>>
>>>>>>>> Good, thanks; I've updated the default values in the help files. It's
>>>>>>>> easy to check for discrepancies in spgrass/pkg:
>>>>>>>>
>>>>>>>> R CMD build spgrass7
>>>>>>>> R CMD check spgrass7_0.1-0.tar.gz
>>>>>>>
>>>>>>> Thanks - haven't thought about about the check - will do the next time.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>
>>>>>>>> Maybe we could quieten the progress bar in the output from checking?
>>>>>>>> As in:
>>>>>>>>
>>>>>>>> pkg/spgrass7.Rcheck/spgrass7.Rout
>>>>>>>>
>>>>>>>> (local file, not added to repository, created by R CMD check if run in
>>>>>>>> spgrass/pkg).
>>>>>>>>
>>>>>>>>>
>>>>>>>>> Also, I added tryCatch blocks to close open connections and to reset
>>>>>>>>> echoCmdOption. I ran the examples before each commit and I did not see
>>>>>>>>> any errors or changed behavior.
>>>>>>>>>
>>>>>>>>> Apologies for the typos in the commit messages - I only saw them later.
>>>>>>>>>
>>>>>>>>> To stick with consistency, I would recommend to rename the package to
>>>>>>>>> spgrass7 and to look into the possibility to create a meta-package which
>>>>>>>>> uses spgrass6 or spgrass7 (I don't know about the GRASS 5 interface -
>>>>>>>>> haven't used it) depending on the GRASS GIS version set / loaded.
>>>>>>>>>
>>>>>>>>
>>>>>>>> I've renamed spgrass as spgrass7 - when you update, the change will
>>>>>>>> propagate.
>>>>>>>
>>>>>>> Thanks - got it.
>>>>>>>
>>>>>>>> I'm unsure about a metapackage, maybe block version 7 in
>>>>>>>> spgrass6 (following the parameter and flag name harmonisation).
>>>>>>>
>>>>>>> Yes - spgrass6 for 6.x, spgrass7 for 7.x.
>>>>>>>
>>>>>>> Will respnd in more detail tomorrow.
>>>>>>
>>>>>> OK - I just committed a blocking mechanism which for spgrass6 and
>>>>>> spgrass7 so that they
>>>>>>
>>>>>> a) when R is started in GRASS, the package can not be loaded if the
>>>>>> versions are not compatible and
>>>>>> b) initGRASS raises an error if the GRASS GIS version in gisBase is not
>>>>>> compatible with the package version
>>>>>>
>>>>>> If you think this is the right approach, the help files still need to be
>>>>>> amended to reflect this change.
>>>>>>
>>>>>> I was thinking if it would make sense to introduce an overwrite
>>>>>> mechanism for these checks to enable "non-standard" use or testing?
>>>>>>
>>>>>> I haven't looked at references for GRASS 7.0 in spgrass6 yet.
>>>>>>
>>>>>> Cheers,
>>>>>>
>>>>>> Rainer
>>>>>>
>>>>>>>
>>>>>>> Thanks,
>>>>>>>
>>>>>>> Rainer
>>>>>>>
>>>>>>>
>>>>>>>>
>>>>>>>> Best wishes,
>>>>>>>>
>>>>>>>> Roger
>>>>>>>>
>>>>>>>>> Cheers,
>>>>>>>>>
>>>>>>>>> Rainer
>>>>>>>>>
>>>>>>>>>
>>>>>>
>>>>>> --
>>>>>> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany)
>>>>>>
>>>>>> Centre of Excellence for Invasion Biology
>>>>>> Stellenbosch University
>>>>>> South Africa
>>>>>>
>>>>>> Tel :       +33 - (0)9 53 10 27 44
>>>>>> Cell:       +33 - (0)6 85 62 59 98
>>>>>> Fax :       +33 - (0)9 58 10 27 44
>>>>>>
>>>>>> Fax (D):    +49 - (0)3 21 21 25 22 44
>>>>>>
>>>>>> email:      Rainer at krugs.de
>>>>>>
>>>>>> Skype:      RMkrug
>>>>>>
>>>>>> PGP: 0x0F52F982
>>>>>>
>>>>>> _______________________________________________
>>>>>> grass-stats mailing list
>>>>>> grass-stats at lists.osgeo.org
>>>>>> http://lists.osgeo.org/mailman/listinfo/grass-stats
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>
>>
>> Footnotes:
>> [1]  http://download.r-forge.r-project.org/STATUS
>>
>>


Footnotes: 
[1]  https://r-forge.r-project.org/R/?group_id=2020

-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax :       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      Rainer at krugs.de

Skype:      RMkrug

PGP: 0x0F52F982
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 494 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-stats/attachments/20150129/9aa2e761/attachment.pgp>


More information about the grass-stats mailing list