Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

init: Add --tmp-mapset option #313

Merged
merged 1 commit into from
Feb 4, 2020

Conversation

wenzeslaus
Copy link
Member

This adds --tmp-mapset to the main executable which creates a temporary mapset
in the location specified in the command line. Intended to be used with --exec
and documented that way, but not explicitly checked, so --tmp-mapset without
--exec is possible for experimental purposes (same as --tmp-location).

It handles error states related to common mistakes (and gives suggestions
to user what might be wrong if that info is available).
It also handles errors caused by interaction with -c and --tmp-location.

Documentation (HTML and --help) follows what was already done for --tmp-location
and modifies doc for --tmp-location to make the differences clear, although
providing a set of specific use cases for each might help further.

Test (a first automated test in lib/init) does not fully conform to the current
GRASS GIS standard. It is using the plain Python unittest and not the GRASS GIS extension
of it (grass.gunittest). For this test, the differences in code are minimal,
but the test does not need functions from grass.gunittest nor its setup of
temporary mapset (meant for modules). As a result of using plain unittest,
this test runs outside of the GRASS GIS session. However, it still needs
to know about the tested executable which, if not already available, needs to be put
on PATH as grass (given what is hardcoded in the test now).

A smaller rewrite of some of the code for checking and setting up mapset
was necessary in order to accommodate the new code, specifically the
initial splitting of provided path and diagnostic of invalid location path.
However, adding notes to the code to facilitate further rewrite which is due.

This adds --tmp-mapset to the main executable which creates a temporary mapset
in the location specified in the command line. Intended to be used with --exec
and documented that way, but not explicitelly checked, so --tmp-mapset without
--exec is possible for experimental purposes (same as --tmp-location).

It handles error states related to common mistakes (and gives suggestions
to user what might be wrong if that info is available).
It also handles errors caused by interaction with -c and --tmp-location.

Documentation (HTML and --help) follows what was already done for --tmp-location
and modifies doc for --tmp-location to make the differeces clear, although
providing a set of specific use cases for each might help further.

Test (a first automated test in lib/init) does not fully conform to the current
GRASS GIS standard. It is using the plain Python unittest and not the GRASS GIS extension
of it (grass.gunittest). For this test, the differences in code are minimal,
but the test does not need functions from grass.gunittest nor its setup of
temporary mapset (meant for modules). As a result of using plain unittest,
this test runs outside of the GRASS GIS session. However, it still needs
to know about the tested executable which, if not already available, needs to be put
on PATH as grass (given what is hardcoded in the test now).

A smaller rewrite of some of the code for checking and setting up mapset
was necessary in order to accomodate the new code, specifically the
initial splitting of provided path and diagnistic of invalid location path.
However, adding notes to the code to facilitate further rewrite which is due.
@wenzeslaus wenzeslaus self-assigned this Jan 29, 2020
@wenzeslaus wenzeslaus merged commit 9da94b7 into OSGeo:master Feb 4, 2020
@wenzeslaus wenzeslaus deleted the add-tmp-mapset-option branch February 4, 2020 19:43
@neteler
Copy link
Member

neteler commented Feb 17, 2020

@wenzeslaus backport desired? I can do but I cannot judge here...

petrasovaa pushed a commit to petrasovaa/grass that referenced this pull request Feb 18, 2020
This adds --tmp-mapset to the main executable which creates a temporary mapset
in the location specified in the command line. Intended to be used with --exec
and documented that way, but not explicitly checked, so --tmp-mapset without
--exec is possible for experimental purposes (same as --tmp-location).

It handles error states related to common mistakes (and gives suggestions
to user what might be wrong if that info is available).
It also handles errors caused by interaction with -c and --tmp-location.

Documentation (HTML and --help) follows what was already done for --tmp-location
and modifies doc for --tmp-location to make the differences clear, although
providing a set of specific use cases for each might help further.

Test (a first automated test in lib/init) does not fully conform to the current
GRASS GIS standard. It is using the plain Python unittest and not the GRASS GIS extension
of it (grass.gunittest). For this test, the differences in code are minimal,
but the test does not need functions from grass.gunittest nor its setup of
temporary mapset (meant for modules). As a result of using plain unittest,
this test runs outside of the GRASS GIS session. However, it still needs
to know about the tested executable which, if not already available, needs to be put
on PATH as grass (given what is hardcoded in the test now).

A smaller rewrite of some of the code for checking and setting up mapset
was necessary in order to accommodate the new code, specifically the
initial splitting of provided path and diagnostic of invalid location path.
However, adding notes to the code to facilitate further rewrite which is due.
@wenzeslaus
Copy link
Member Author

I don't think features should be backported, so no to backport here from me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants