Feature request for a method which allows one to subspace something which has a structure
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 150
- Forks
- 23
- Ø Merge
- 1 T. 11 Std.
- Gemergte PRs (30 T.)
- 2
Beschreibung
Feature request for a cf.Field.group() method like subspace, but which allows one to subspace something which has a structure:
E.g., Subsetting data only for the extended winter (ONDJFM) from 2018-2020:
>>> ondjfm = a.subspace(T=cf.seasons(2, 10)[0] & cf.wi(cf.dt('2018-10-1'), cf.dt('2020-03-1')))
>>> print(ondjfm.coordinate("long_name=time").dtarray)
[cftime.DatetimeGregorian(2018, 10, 1, 0, 0, 0, 0, has_year_zero=False)
cftime.DatetimeGregorian(2018, 11, 1, 0, 0, 0, 0, has_year_zero=False)
cftime.DatetimeGregorian(2018, 12, 1, 0, 0, 0, 0, has_year_zero=False)
cftime.DatetimeGregorian(2019, 1, 1, 0, 0, 0, 0, has_year_zero=False)
cftime.DatetimeGregorian(2019, 2, 1, 0, 0, 0, 0, has_year_zero=False)
cftime.DatetimeGregorian(2019, 3, 1, 0, 0, 0, 0, has_year_zero=False)
cftime.DatetimeGregorian(2019, 10, 1, 0, 0, 0, 0, has_year_zero=False)
cftime.DatetimeGregorian(2019, 11, 1, 0, 0, 0, 0, has_year_zero=False)
cftime.DatetimeGregorian(2019, 12, 1, 0, 0, 0, 0, has_year_zero=False)
cftime.DatetimeGregorian(2020, 1, 1, 0, 0, 0, 0, has_year_zero=False)
cftime.DatetimeGregorian(2020, 2, 1, 0, 0, 0, 0, has_year_zero=False)
cftime.DatetimeGregorian(2020, 3, 1, 0, 0, 0, 0, has_year_zero=False)]
It would also take parameters like group_span (to include groups whose actual span is not equal to a given value) and group_contiguous (to include non-contiguous groups, or any contiguous group containing overlapping cells). A similar functionality is embedded in collapse but it works only when one has to collapse axes of the field.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, die vorhandenen subspace- und collapse-Einstiegspunkte auf cf.Field zu lesen, da die Anfrage die neue Methode cf.Field.group() als mit beiden verwandt beschreibt. Vergleiche die saisonale Auswahl und die Auswahl von Datumsbereichen im Beispiel mit den angeforderten Parametern group_span und group_contiguous. Erledigt bedeutet, dass eine dokumentierte Methode strukturierte, nicht zusammenhängende oder überlappende Gruppen wie beschrieben auswählen kann.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- data
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100