[Feat] grass.temporal: share one id helper between maps and space-time datasets

オープン
#8,166 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
リファクタリング
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python
領域
data

調査の方向性

Start by reading AbstractMapDataset.build_id() and split_name(), then locate the 17 duplicated id expressions across the nine grass.temporal and t.* files mentioned in the issue. Move the helpers to grass.temporal.utils, retain the map class methods as wrappers, and update the copies. The issue leaves open whether _parse_id() belongs there, so clarify that design choice before considering the refactor complete.

索引モデルが issue の本文から書いたものです。

説明

Is your feature request related to a problem? Please describe.

@ninsbl suggested on #7739 a public helper for STDS ids, maybe in a temporal utils module. Looking into it, x if x.find("@") >= 0 else x + "@" + mapset is copied 17 times across 9 files in grass.temporal and the t.* tools. AbstractMapDataset.build_id(x, mapset) already does the same thing (I checked it gives the same id for name, name@mapset, name.label and name:layer), but it sits on the map class, and 14 of the 17 copies are for space-time datasets.

Describe the solution you'd like

Move split_name() and build_id() to a new grass.temporal.utils as plain functions, keep the AbstractMapDataset methods as wrappers, and switch the copies over.

Describe alternatives you've considered

Calling AbstractMapDataset.build_id() from the space-time dataset code as it is. That works, it just reads a bit odd.

Additional context

Does this match what you had in mind? And should _parse_id() from open_stds.py go there too, or stay where it is because of the semantic labels?

主要言語
C
スター
1.2k
フォーク
447
平均マージ
2日 10時間
マージ済み PR(30日)
86

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

OSGeo/grass のほかの issue

OSGeo/grass の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。