Rehome `_numpy_allclose` so it can be decorated
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 150
- Fork
- 23
- Merge medio
- 1g 11h
- PR unite (30g)
- 2
Descrizione
I would like to decorate the function _numpy_allclose() with _manage_log_level_via_verbosity as a standard & consistent way to manage the output of the log messages there with overriding by the verbose kwarg.
But as-is this cannot be done because _numpy_isclose() lives in the functions module & importing the decorator would lead to a circular dependency on imports, as per the comment I added there:
https://github.com/NCAS-CMS/cf-python/blob/7fed0abf184093024eb35d17036a08dc812c8f47/cf/functions.py#L1067-L1070
We tentatively agreed we should move the function to another module. It is internal so the location is not user-facing but we should try to collect it into the most sensible module as a new home.
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 in functions.py, intorno al commento collegato alle righe 1067–1070, e segui _numpy_allclose(), _numpy_isclose() e _manage_log_level_via_verbosity. Individua un modulo che eviti l’importazione circolare, sposta lì la funzione interna e verifica che il decoratore possa essere applicato senza compromettere gli import o il comportamento esistente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- backend
- Tipo di issue
- Refactoring
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100