-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
conda create
raises TqdmWarning: clamping frac to range [0, 1]
warning
#14082
Comments
Can you please share the full error message and tell us the exact command you ran when you encountered this? |
The command: conda create --name bug --file conda/conda-spec.txt The full error message is just in the title, it is being produced by
in tqdm's https://github.com/tqdm/tqdm/blob/master/tqdm/std.py#L155 The warning is printed while the installation screen runs, and it's easy to miss it because the installation screen will overwrite it quickly. The installation screen looks somewhat like the following (multiple similar lines)
That said, I modified the source code to print out the stack at that, and get the following
|
Thanks for giving us more information. I'm actually working on refactoring this part of conda right now, and I am curious how you were able to see that warning. I have never seen that warning on my computer. If I can recreate this, I would be happy to fix it. Even if I am unable to recreate it myself, it looks like we could at least add a quick check before calling |
From the traceback I can't see anything suspicious either. if total_content_length and 0 <= streamed_bytes <= content_length:
if progress_update_callback:
progress_update_callback(
(stat_result.st_size streamed_bytes) / total_content_length
) This is the first step that introduces floating point. self.pbar.update(fraction - self.pbar.n) Then inside tqdm source code: if n < 0:
self.last_print_n = n # for auto-refresh logic to work
self.n = n
→
frac = n / total
percentage = frac * 100
→
full_bar = Bar(frac,
max(1, ncols - disp_len(nobar)) if ncols else 10,
charset=Bar.ASCII if ascii is True else ascii or Bar.UTF,
colour=colour)
→
if not 0 <= frac <= 1:
warn("clamping frac to range [0, 1]", TqdmWarning, stacklevel=2)
frac = max(0, min(1, frac)) I think floating point error should at least guarantee if I guess I can try to attach pdb and debug it a bit in a few days. |
Checklist
What happened?
As in the title.
Expected value is no warning.
(side note, tqdm/tqdm#1118 suggests maybe the cause is floating point rounding error?)
Conda Info
Conda Config
No response
Conda list
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: