[GRASS-git] [OSGeo/grass] adf4d3: grass.jupyter: Support pathlib.Path in TimeSeriesM...

Vaclav Petras noreply at github.com
Wed Feb 15 12:13:16 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/OSGeo/grass
  Commit: adf4d3eacd4dbb456e2fe3d193155305a5cd170e
      https://github.com/OSGeo/grass/commit/adf4d3eacd4dbb456e2fe3d193155305a5cd170e
  Author: Vaclav Petras <wenzeslaus at gmail.com>
  Date:   2023-02-15 (Wed, 15 Feb 2023)

  Changed paths:
    M python/grass/jupyter/tests/timeseriesmap_test.py
    M python/grass/jupyter/timeseriesmap.py

  Log Message:
  -----------
  grass.jupyter: Support pathlib.Path in TimeSeriesMap.save (#2453)

When the save method receives a path, ensure the path is pathlib.Path, then use its functions to detect file suffix (extension) instead of manipulating strings. PIL.Image supports Path for 8 years, so we can support that and get the string support by conversion to Path.

In tests, use tmp_path, not current dir. Files generated by the tests should use tmp_path (or other pytest tmp dir ways), not the current directory.




More information about the grass-commit mailing list