Skip to content

Remove global warning suppression, replace with targeted filters - #164

Draft
ch55secake with Copilot wants to merge 2 commits into
mainfrom
copilot/remove-global-warning-suppression
Draft

Remove global warning suppression, replace with targeted filters#164
ch55secake with Copilot wants to merge 2 commits into
mainfrom
copilot/remove-global-warning-suppression

Conversation

Copilot AI commented Apr 19, 2026

Copy link
Copy Markdown
Contributor

Description

warnings.filterwarnings("ignore") was applied globally in two modules, silently swallowing deprecation notices, convergence warnings, and data quality signals from pandas/numpy/sklearn — making failures harder to diagnose.

Changes in this pull request

  • src/main.py: Removed blanket warnings.filterwarnings("ignore") and the now-unused import warnings. The entry-point has no reason to suppress warnings globally.
  • src/optimise/optimizer.py: Replaced the blanket suppression with four targeted filters scoped to known-noisy-but-harmless library internals that would otherwise flood logs across thousands of Optuna trials:
warnings.filterwarnings("ignore", category=UserWarning, module="lightgbm")
warnings.filterwarnings("ignore", category=UserWarning, module="xgboost")
warnings.filterwarnings("ignore", category=FutureWarning, module="xgboost")
warnings.filterwarnings("ignore", category=optuna.exceptions.ExperimentalWarning)

All other warnings — convergence failures, deprecations, pandas PerformanceWarning, etc. — now surface as intended.

…uppressions

- src/main.py: remove blanket warning suppression (and unused import warnings)
- src/optimise/optimizer.py: replace blanket suppression with targeted filters
  for UserWarning/FutureWarning from xgboost and lightgbm, and
  optuna.exceptions.ExperimentalWarning, scoped to only the known-noisy
  warnings from those ML libraries

Agent-Logs-Url: https://github.com/ch55secake/hyperion/sessions/b5bb67ea-166b-45cb-9595-734ef3bf88eb

Co-authored-by: ch55secake <87881861+ch55secake@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove blanket suppression of all Python warnings Remove global warning suppression, replace with targeted filters Apr 19, 2026
Copilot AI requested a review from ch55secake April 19, 2026 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Performance: warnings.filterwarnings('ignore') suppresses all warnings globally

2 participants