Feature request for a method which allows one to subspace something which has a structure
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 150
- Fork
- 23
- Merge medio
- 1g 11h
- PR unite (30g)
- 2
Descrizione
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.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia leggendo i punti di ingresso esistenti subspace e collapse su cf.Field, poiché la richiesta descrive il nuovo metodo cf.Field.group() come correlato a entrambi. Confronta la selezione stagionale e per intervallo di date dell’esempio con i parametri richiesti group_span e group_contiguous. Il lavoro è completo quando un metodo documentato può selezionare gruppi strutturati, non contigui o sovrapposti come descritto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- data
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100