Skip to content
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

Features/746 print0 print toggle #816

Merged
merged 20 commits into from
Jan 24, 2022
Merged

Conversation

coquelin77
Copy link
Member

Description

Adds a toggle function to switch between local printing and global printing for easier usability and debugging.

Issue/s resolved: #746

Changes proposed:

  • added local and global printing options
  • added a print0 function to both the heat namespace and the builtins

Type of change

  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
    • this would only be a breaking change if another function relies on global printing and that is not set explicitly

Due Diligence

  • All split configurations tested
  • Multiple dtypes tested in relevant functions
  • Documentation updated (if needed)
  • Updated changelog.md under the title "Pending Additions"

Does this change modify the behaviour of other functions? If so, which?

yes -> the built in print statement will change depending on which mode is selected

@codecov
Copy link

codecov bot commented Jun 22, 2021

Codecov Report

Merging #816 (e542860) into master (2867fe9) will increase coverage by 0.00%.
The diff coverage is 95.83%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #816   +/-   ##
=======================================
  Coverage   95.52%   95.52%           
=======================================
  Files          64       64           
  Lines        9617     9640   +23     
=======================================
+ Hits         9187     9209   +22     
- Misses        430      431    +1     
Flag Coverage Δ
gpu 94.65% <91.66%> (-0.01%) ⬇️
unit 91.12% <95.83%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
heat/core/printing.py 96.51% <95.83%> (-0.32%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2867fe9...e542860. Read the comment docs.

@coquelin77
Copy link
Member Author

this might fail on coverage but im not sure how to test print0. any ideas for how to test this @Markus-Goetz ?

@coquelin77
Copy link
Member Author

rerun tests

@coquelin77 coquelin77 requested a review from mtar July 28, 2021 08:15
Copy link
Collaborator

@mtar mtar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about printing the local metadata too? Similar to DNDarray. LNDarray([], dtype, device, split) or something like that. It can be useful for debugging.

heat/core/printing.py Outdated Show resolved Hide resolved
heat/core/printing.py Outdated Show resolved Hide resolved
heat/core/tests/test_printing.py Outdated Show resolved Hide resolved
@ClaudiaComito ClaudiaComito added this to the 1.2.x milestone Oct 27, 2021
@coquelin77 coquelin77 merged commit 35f39d1 into master Jan 24, 2022
@coquelin77 coquelin77 deleted the features/746-print0-print-toggle branch January 24, 2022 16:51
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.

Print toggle for local tensor printing
3 participants