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

ENH: #448 print flush #527

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

ENH: #448 print flush #527

wants to merge 8 commits into from

Conversation

himkwtn
Copy link
Collaborator

@himkwtn himkwtn commented Jul 9, 2024

#448 add flush options to model.print

Copy link

codecov bot commented Jul 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.05%. Comparing base (3503c15) to head (872d178).
Report is 12 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #527      +/-   ##
==========================================
- Coverage   94.05%   94.05%   -0.01%     
==========================================
  Files          38       38              
  Lines        4157     4156       -1     
==========================================
- Hits         3910     3909       -1     
  Misses        247      247              

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

Copy link
Collaborator

@Jacob-Stevens-Haas Jacob-Stevens-Haas left a comment

Choose a reason for hiding this comment

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

Good job improving the tests and the conditional! In the issue, I recommended to lookup what other kwargs print might accept, too. Do you think sep, end, or file are useful?

IDK if they are, but it it wouldn't be hard to implement them all. Are there any reasons not to use **kwargs?

def print(self, lhs=None, precision=3, **kwargs):

And just passing the kwargs to the builtin print with

print(f"{names} = {eqn}", **kwargs)

pysindy/pysindy.py Outdated Show resolved Hide resolved
pysindy/pysindy.py Outdated Show resolved Hide resolved
test/test_pysindy.py Outdated Show resolved Hide resolved
test/test_pysindy.py Outdated Show resolved Hide resolved
test/test_pysindy.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@Jacob-Stevens-Haas Jacob-Stevens-Haas left a comment

Choose a reason for hiding this comment

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

Thanks, Watcharin, just a few deletions and we're good to go

pysindy/pysindy.py Outdated Show resolved Hide resolved
test/test_pysindy.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@Jacob-Stevens-Haas Jacob-Stevens-Haas left a comment

Choose a reason for hiding this comment

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

Hey, BTW, I meant delete the whole test test_print_discrete_time_multiple_trajectories, rather than just a single line. Could you do that please?

@@ -518,7 +518,6 @@ def test_print_discrete_time_multiple_trajectories(

out, _ = capsys.readouterr()
assert len(out) > 0
assert "(x0)[k+1] = " in out
Copy link
Collaborator

Choose a reason for hiding this comment

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

I meant delete the whole test test_print_discrete_time_multiple_trajectories, rather than just a single line. Could you do that please?

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.

None yet

2 participants