-
Notifications
You must be signed in to change notification settings - Fork 80
revert: restore line printing in tracer #1304
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
Conversation
Hi! Was this a bug introduced recently? I'd love to add a failing test for this. If you could point me out at how to reproduce the error and the expected behaviour, I could help with the test. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I understood now: printing/logging has nothing to do in the computation log, which is just a log accumulator —like a writer monad transformer, sort of.
In test_runner.py
, you could either:
- Get the log buffer and log it to stdout there.
- Pass down a function to the tracer with how you want to print/log the log buffer.
Something like this should give you what you want (just an idea):
# task_runner.py
@staticmethod
def print_computation_log(tracer, aggregate, max_depth) -> None:
buffer = tracer.computation_log.lines(aggregate, max_depth)
for line in buffer:
print(line)
Also, using print
is making the linter fail in CI, you have to use a logger for that:
https://docs.python.org/3/library/logging.html
Hope it helps :)
BTW, I have no idea how to test test_runner.py
, so I won't be picky with that.
(Also, if this wasn't working before, I'd do a minor bump and label it as a new feature. It it was working before, then you can just safely ignore this comment and keep it as a patch.)
Thanks @bonjourmauko , I don't have much time to follow up. To me, this is a regression and I need this fix to work locally. |
@guillett If you give me the command you normally use I can propose you a stacked PR with the proposed fix. Concerning |
Oh nevermind, I see the regression was introduced here 2f8072f#diff-fc2477fbba8037857fb9287895920ee5a1015c5eda4edb50832af14232fdd10b |
@guillett : I modified the changlog so the linter passes but we still have a problem with a conda build. |
Well, the error in Conda complains about Numpy : If using `np.array(obj, copy=False)` replace it with `np.asarray(obj)` to allow a copy when needed (no behavior change in NumPy 1.x). Because despite the
|
There is definitely a problem with the conda's config. |
poke @sylvainipp it looks like the problem you were having could come from inadvertently using a numpy > 2.2 version, that could be unrelated to your proposed changes in #1319 |
Co-authored-by: Mauko Quiroga-Alvarado <[email protected]>
Fixes #1310
Depends on #1321
Technical changes
computation_log
.