-
-
Notifications
You must be signed in to change notification settings - Fork 326
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
grass.script: add create_project() with same functionality as create_location() #3513
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a nice addition! Works as expected, at least in the tests I did :)
I approve the concept, read through it, but I'm leaving reviewing the fine details for someone else. I'm not confident enough in the implications, or if there is something missing with in regards to the transition to "project". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ultimately, we need to have something like resolve_mapset_path but oriented towards project, specifically. However, at this point, this is the best implementation.
Given the need to support the two different API, a test would be helpful here to check that the different combinations of parameters work. It also seems that a test for existing project is missing.
I added two more tests, one that tests providing the full path (i.e. |
As we begin renaming location to project, it would be nice to have a
create_project()
function that works the same ascreate_location
.This is particularly nice in notebooks because these function work without an active GRASS session so users can use a work flow that I think is very intuitive:
import grass.script
andgrass.jupyter
create_project()
to make a new projectgj.init()
to start the session in the new projectThis PR also includes additional path support. For example, all the following lines will create a new project: