Skip to content

1324 Direclty print output from print_table in python #1325

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

HenrZu
Copy link
Contributor

@HenrZu HenrZu commented Jul 24, 2025

Changes and Information

Please briefly list the changes (main added features, changed items, or corrected bugs) made:

  • When calling print_table from python, the output is now direclty printed in the console per default. (Now consistent with cpp code)
  • When adding True as first arg, we also can still return the output as a string.

If need be, add additional information and what the reviewer should look out for in particular:

Merge Request - Guideline Checklist

Please check our git workflow. Use the draft feature if the Pull Request is not yet ready to review.

Checks by code author

  • Every addressed issue is linked (use the "Closes #ISSUE" keyword below)
  • New code adheres to coding guidelines
  • No large data files have been added (files should in sum not exceed 100 KB, avoid PDFs, Word docs, etc.)
  • Tests are added for new functionality and a local test run was successful (with and without OpenMP)
  • Appropriate documentation for new functionality has been added (Doxygen in the code and explanations in the online documentation)
  • Proper attention to licenses, especially no new third-party software with conflicting license has been added
  • (For ABM development) Checked benchmark results and ran and posted a local test above from before and after development to ensure performance is monitored.

Checks by code reviewer(s)

  • Corresponding issue(s) is/are linked and addressed
  • Code is clean of development artifacts (no deactivated or commented code lines, no debugging printouts, etc.)
  • Appropriate unit tests have been added, CI passes, code coverage and performance is acceptable (did not decrease)
  • No large data files added in the whole history of commits(files should in sum not exceed 100 KB, avoid PDFs, Word docs, etc.)
  • On merge, add 2-5 lines with the changes (main added features, changed items, or corrected bugs) to the merge-commit-message. This can be taken from the briefly-list-the-changes above (best case) or the separate commit messages (worst case).

@HenrZu HenrZu linked an issue Jul 24, 2025 that may be closed by this pull request
2 tasks
Copy link

codecov bot commented Jul 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.40%. Comparing base (2defe8b) to head (4facc9d).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1325      +/-   ##
==========================================
+ Coverage   97.37%   97.40%   +0.02%     
==========================================
  Files         174      174              
  Lines       15024    15154     +130     
==========================================
+ Hits        14630    14760     +130     
  Misses        394      394              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@HenrZu HenrZu requested a review from MaxBetzDLR July 24, 2025 09:34
Copy link
Member

@MaxBetzDLR MaxBetzDLR left a comment

Choose a reason for hiding this comment

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

print to string needs to be adjusted

@HenrZu HenrZu requested a review from MaxBetzDLR August 5, 2025 13:50
Copy link
Member

@MaxBetzDLR MaxBetzDLR left a comment

Choose a reason for hiding this comment

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

Final changes in example, else ready to merge

@@ -70,8 +70,8 @@ def run_ode_seir_flows_simulation():
# Run flow simulation
(result, flows) = simulate_flows(0, days, dt, model)

print(result.print_table(["S", "E", "I", "R"], 16, 5))
print(flows.print_table(["S->E", "E->I", "I->R"], 16, 5))
result.print_table(["S", "E", "I", "R"], 16, 5)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
result.print_table(["S", "E", "I", "R"], 16, 5)
result.print_table(False, ["S", "E", "I", "R"], 16, 5)

print(result.print_table(["S", "E", "I", "R"], 16, 5))
print(flows.print_table(["S->E", "E->I", "I->R"], 16, 5))
result.print_table(["S", "E", "I", "R"], 16, 5)
flows.print_table(["S->E", "E->I", "I->R"], 16, 5)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
flows.print_table(["S->E", "E->I", "I->R"], 16, 5)
flows.print_table(False, ["S->E", "E->I", "I->R"], 16, 5)

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_table does not directly return output in python
2 participants