-
-
Notifications
You must be signed in to change notification settings - Fork 307
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 separate function for setting location description #3431
Conversation
This adds a separate function for setting location (aka title) stored in MYNAME file. It includes tests of this function.
What is not 100% clear to me is whether the function should be public or protected. I made it protected, but it could be public in grass.script or in grass.grassdb. _create_location_xy looks like a candidate for being public as well. |
I'm not sure if it's totally related, but with the previous PR that changed the grass script env loading, what I observed in my debugging in the last two-three months, is that the namespace is pretty big, and it imports absolutely everything. So one of my wishes, is that one day we could
I didn't figure out how it could be non-breaking, since I don't know how the mega poluted namespaces (grass.script for example) is used. Internally, we could adapt to use exactly what we need, and use another dot where to find the functons we need. All this to say, if you have to have something that is only for a specific use, it be good to place it where it should, and be imported on a needed basis, and not necessarily eagerly added to an |
@echoix I generally agree. The major clean up needs to happen only for v9, but we can restructure any time if we spend the extra time ensuring backwards compatibility. I'm happy to have an extended discussion elsewhere. |
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.
Unrelated, but it probably shouldn't use os.linesep.
From https://docs.python.org/3.12/library/os.html#os.linesep os.linesep¶ Is |
Both os.linesep and codecs can be likely replaced by much simpler code in Python 3, but I'm leaving that for a different PR. |
This adds a separate function for setting location (aka title) stored in MYNAME file. It includes tests of this function.