logging levels not set comprehensively (still get INFO messages with WARNING set)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
Riproduci il report con binomial-rng.stan e bug.py, iniziando dalla configurazione di logging.getLogger('cmdstanpy') e dalla chiamata a CmdStanModel.sample. Traccia i nomi dei logger utilizzati per i messaggi segnalati e verifica che l'impostazione di WARNING sopprima l'output INFO senza influire sull'esecuzione del modello.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary:
I set the logger level to WARNING before compiling and running a model, but I still see INFO level warning messages.
Description:
Here's a simple reproducible example consisting of a Stan program and a Python script that can go in the same directory and run as shown below.
binomial-rng.stan:
data {
int<lower=0> N;
real<lower=0, upper=1> theta;
}
generated quantities {
int<lower=0, upper=N> y = binomial_rng(N, theta);
}
bug.py
import cmdstanpy
import logging
logging.getLogger('cmdstanpy').setLevel(logging.WARNING)
N = 100
theta = 0.3
data = {'N': N, 'theta': theta}
model = cmdstanpy.CmdStanModel(stan_file = 'binomial-rng.stan')
sample = model.sample(data = data, seed=123,
iter_sampling = 10, iter_warmup = 0, chains = 1,
show_progress = False, show_console = False)
~/temp2$ python3 bug.py
14:43:39 - cmdstanpy - INFO - CmdStan start processing
14:43:39 - cmdstanpy - INFO - Chain [1] start processing
14:43:39 - cmdstanpy - INFO - Chain [1] done processing
14:43:39 - cmdstanpy - INFO - deleting tmpfiles dir: /var/folders/b3/6h4t41094vz281j7nn48ws900001jv/T/tmpojw6vov9
14:43:39 - cmdstanpy - INFO - done
The same error arises if you set logging.ERROR instead of logging.WARNING.
@WardBrian suggested the problem might be that there are several loggers being used by CmdStanPy, but only some of them are getting their level set.
Context
I would like to silence all the DEBUG and INFO level messages in the context of constructing a quarto tutorial.
Current Version:
>>> import cmdstanpy
>>> cmdstanpy.show_versions()
INSTALLED VERSIONS
---------------------
python: 3.9.4 (default, Apr 5 2021, 01:47:16)
[Clang 11.0.0 (clang-1100.0.33.17)]
python-bits: 64
OS: Darwin
OS-release: 22.3.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: ('en_US', 'UTF-8')
cmdstan_folder: /Users/bcarpenter/.cmdstan/cmdstan-2.31.0
cmdstan: (2, 31)
cmdstanpy: 1.0.4
pandas: 1.4.3
xarray: 2023.1.0
tdqm: None
numpy: 1.24.1
ujson: 5.4.0
' '
- Lingua principale
- Python
- Stelle
- 198
- Fork
- 81
- Merge medio
- 6g 5h
- PR unite (30g)
- 1
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.
Altre issue di stan-dev/cmdstanpy
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Release 2.0 Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
-
feature
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 55/100
-
feature method outputs
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
Tutte le issue di stan-dev/cmdstanpy
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
stephrobert/dsoxlab#238 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
sublimehq/package_control#1780 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
nwg-piotr/nwg-displays#145 ·