Skip to content

Comments

grass.temporal: allow change of mapset in a single script#5735

Merged
echoix merged 2 commits intoOSGeo:mainfrom
lrntct:tgis-mapset-change
May 24, 2025
Merged

grass.temporal: allow change of mapset in a single script#5735
echoix merged 2 commits intoOSGeo:mainfrom
lrntct:tgis-mapset-change

Conversation

@lrntct
Copy link
Contributor

@lrntct lrntct commented May 21, 2025

Description

This introduces the possibility of using the temporal framework and switching mapset within the same session.

Motivation and context

This should address issue #629.

How has this been tested?

I created a specific test for this feature, and ran the other tgis tests locally.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing
    functionality to not work as before)

Checklist

  • PR title provides summary of the changes and starts with one of the
    pre-defined prefixes

  • My code follows the code style
    of this project.

  • My change requires a change to the documentation.

  • I have updated the documentation accordingly.

  • I have added tests to cover my changes.

@lrntct lrntct changed the title Temporal framework allow changes of mapset Temporal framework: allow change of mapset in a single script May 21, 2025
@github-actions github-actions bot added Python Related code is in Python libraries tests Related to Test Suite labels May 22, 2025
@lrntct
Copy link
Contributor Author

lrntct commented May 22, 2025

It seems that on CI (MacOS and Ubuntu), the first call to tgis.init() creates the DB if it does not exists, but the second call to init() after the switch of mapset does not create the DB.
Running the individual test on my machine works. Even running all the temporal tests with pytest, this new test passes.
Any clue about why is that? How could I make sure that this test is not run in parallel in CI?

@echoix
Copy link
Member

echoix commented May 22, 2025

The gunittest and where it fails on macOS is not run in parallel. There's only one part, of pytest only tests, that are run in parallel (and not on the Ubuntu gunittest jobs)

@lrntct lrntct force-pushed the tgis-mapset-change branch from a9fc979 to 5cbf675 Compare May 22, 2025 16:58
@lrntct lrntct changed the title Temporal framework: allow change of mapset in a single script tgis: allow change of mapset in a single script May 22, 2025
@lrntct
Copy link
Contributor Author

lrntct commented May 23, 2025

I believe the new PR title should be compliant. Hopefully after a manual re-run of the failing title test, we should be all green 🙂

@echoix
Copy link
Member

echoix commented May 23, 2025

@wenzeslaus after removing tgis, should this be temporal or lib?

@echoix
Copy link
Member

echoix commented May 23, 2025

Use grass.temporal

@lrntct lrntct changed the title tgis: allow change of mapset in a single script grass.temporal: allow change of mapset in a single script May 23, 2025
@echoix echoix merged commit b3dc52d into OSGeo:main May 24, 2025
24 of 27 checks passed
@github-actions github-actions bot added this to the 8.5.0 milestone May 24, 2025
cyliang368 pushed a commit to cyliang368/grass that referenced this pull request May 24, 2025
This introduces the possibility of using the temporal framework and switching mapset within the same session.

This should address issue OSGeo#629.


* call g.mapsets instead of direct calls to C funcs

* query current mapset name explicitly
@lrntct lrntct deleted the tgis-mapset-change branch August 5, 2025 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

libraries Python Related code is in Python tests Related to Test Suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants