Summary
pysidt/sidt.py calls logging.basicConfig(level=logging.INFO) at module import time (line 28), and logs throughout via the root logger (logging.info(...), logging.warning(...), etc.). Both are discouraged for libraries: importing PySIDT silently reconfigures logging for any program that imports it (directly or transitively).
Why this is a problem
A library shouldn't configure the root logger — that's the application's responsibility. The Python "Logging HOWTO" → Configuring Logging for a Library recommends a library add at most a NullHandler and leave configuration to the app.
The current behavior has two side effects on consumers:
basicConfig(level=logging.INFO) at import forces the root logger to INFO and attaches a stderr handler for the entire process. Any program that imports PySIDT (or imports something that imports it) inherits this.
- Logging through the root logger (rather than a module-level named logger) means PySIDT's messages aren't namespaced, so consumers can't selectively adjust PySIDT's verbosity without affecting their whole application.
How we hit it
We import PySIDT transitively in RMG-Py (via rmgpy.data.thermo). A tool that emitted INFO logs suddenly started writing them to stderr — purely because importing PySIDT had switched the root logger to INFO + stderr. We worked around it with logging.basicConfig(level=logging.WARNING, force=True), but the root cause is upstream.
Suggested fix
Standard library-logging hygiene:
# pysidt/sidt.py
import logging
logger = logging.getLogger(__name__) # module-level named logger
# (remove the logging.basicConfig(level=logging.INFO) call)
AI use
Issue drafted with help from Claude
Summary
pysidt/sidt.pycallslogging.basicConfig(level=logging.INFO)at module import time (line 28), and logs throughout via the root logger (logging.info(...),logging.warning(...), etc.). Both are discouraged for libraries: importing PySIDT silently reconfigures logging for any program that imports it (directly or transitively).Why this is a problem
A library shouldn't configure the root logger — that's the application's responsibility. The Python "Logging HOWTO" → Configuring Logging for a Library recommends a library add at most a
NullHandlerand leave configuration to the app.The current behavior has two side effects on consumers:
basicConfig(level=logging.INFO)at import forces the root logger to INFO and attaches a stderr handler for the entire process. Any program that imports PySIDT (or imports something that imports it) inherits this.How we hit it
We import PySIDT transitively in RMG-Py (via
rmgpy.data.thermo). A tool that emittedINFOlogs suddenly started writing them to stderr — purely because importing PySIDT had switched the root logger to INFO + stderr. We worked around it withlogging.basicConfig(level=logging.WARNING, force=True), but the root cause is upstream.Suggested fix
Standard library-logging hygiene:
AI use
Issue drafted with help from Claude