Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

set_options is applied on init, not enter

Aperta
#300 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
python
Ambito
data

Direzione di ricerca

Start in cf_xarray/options.py, linked from the issue, and inspect the set_options context-manager lifecycle. Add a test matching the ds_1 and ds_2 example, then run the relevant test suite; done means each dataset uses its corresponding options only while its context manager is active.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Really nice stuff! I'm not impacted by this, but I noticed a bug. In the following example, I would expect corresponding options to be applied to operations on their corresponding datasets. Currently, as I understand set_options, ds_2_options will be used for both ds_1 calls, and neither context manager will be used for the ds_2 call.

ds_1_options = set_options(...)
ds_2_options = set_options(...)

ds_1_cf.<something>

with ds_1_options:
    ds_1.cf.<something>
    
with ds_2_options:
    ds_2.cf.<something>

I believe the fix would involve writing a test like the above example and moving the init code into enter.

Lingua principale
Python
Stelle
181
Fork
51
Merge medio
3h 41m
PR unite (30g)
2

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di xarray-contrib/cf-xarray

Tutte le issue di xarray-contrib/cf-xarray

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.