You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The logger filters out immediate repetitions, but when 2 different warnings are hit in a loop, it can quickly get pretty noisy.
The class reponsible for handling colorbar norms (NormHandler) emits warnings when it receives a new constraint that forces dropping of previously set ones (this is by design and still desired). Now, this warning assumes all previous constraint were either set by the user or inherited from a previous rendering of the plot, but there's one place where this rule is violated and we set norm constraint internally ahead of rendering:
yt : [WARNING ] 2023-06-12 17:38:17,408 Field ('gas', 'fake_density') was added without specifying units or dimensions, auto setting units to 'g/cm**3'
yt : [WARNING ] 2023-06-12 17:38:17,927 Dropping norm constraints (norm_type=<class 'matplotlib.colors.Normalize'>)
yt : [WARNING ] 2023-06-12 17:38:18,698 Field ('gas', 'fake_density') was added without specifying units or dimensions, auto setting units to 'g/cm**3'
yt : [WARNING ] 2023-06-12 17:38:18,871 Dropping norm constraints (norm_type=<class 'matplotlib.colors.Normalize'>)
yt : [WARNING ] 2023-06-12 17:38:19,472 Field ('gas', 'fake_density') was added without specifying units or dimensions, auto setting units to 'g/cm**3'
yt : [WARNING ] 2023-06-12 17:38:19,707 Dropping norm constraints (norm_type=<class 'matplotlib.colors.Normalize'>)
yt : [WARNING ] 2023-06-12 17:38:20,313 Field ('gas', 'fake_density') was added without specifying units or dimensions, auto setting units to 'g/cm**3'
yt : [WARNING ] 2023-06-12 17:38:20,482 Dropping norm constraints (norm_type=<class 'matplotlib.colors.Normalize'>)
yt : [WARNING ] 2023-06-12 17:38:21,079 Field ('gas', 'fake_density') was added without specifying units or dimensions, auto setting units to 'g/cm**3'
yt : [WARNING ] 2023-06-12 17:38:21,308 Dropping norm constraints (norm_type=<class 'matplotlib.colors.Normalize'>)
Expected outcome
The log should be limited to the first warning
yt : [WARNING ] 2023-06-12 17:38:17,408 Field ('gas', 'fake_density') was added without specifying units or dimensions, auto setting units to 'g/cm**3'
Version Information
Operating System: macOS
Python Version: 3.11.4
yt version: 4.2.0
Other Libraries (if applicable):
The text was updated successfully, but these errors were encountered:
Bug report
Bug summary
The logger filters out immediate repetitions, but when 2 different warnings are hit in a loop, it can quickly get pretty noisy.
The class reponsible for handling colorbar norms (
NormHandler
) emits warnings when it receives a new constraint that forces dropping of previously set ones (this is by design and still desired). Now, this warning assumes all previous constraint were either set by the user or inherited from a previous rendering of the plot, but there's one place where this rule is violated and we set norm constraint internally ahead of rendering:yt/yt/visualization/plot_window.py
Lines 258 to 264 in cfdf7ed
Within the right conditions, this combination of factors generates a lot of noisy and frankly useless warnings.
Code for reproduction
Actual outcome
Expected outcome
The log should be limited to the first warning
Version Information
The text was updated successfully, but these errors were encountered: