-
Notifications
You must be signed in to change notification settings - Fork 183
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
Upgrade samples #3267
Upgrade samples #3267
Conversation
Remove unused imports/variables/functions, fix mistakes, simplify expressions, replace some magic numbers by expressions, replace sys.stdout() by print(), remove commented code.
Codecov Report
@@ Coverage Diff @@
## python #3267 +/- ##
======================================
Coverage 85% 85%
======================================
Files 534 534
Lines 25526 25526
======================================
Hits 21950 21950
Misses 3576 3576
Continue to review full report at Codecov.
|
samples/lj_liquid.py
Outdated
@@ -133,22 +136,16 @@ | |||
|
|||
# Warmup Integration Loop | |||
i = 0 | |||
while (i < warm_n_times and act_min_dist < min_dist): | |||
while i < warm_n_times and act_min_dist < min_dist: |
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.
maybe we should minimize_energy
here
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.
If we should, we should system.integrator.set_steepest_descent()
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.
Done in 23d39c7 for all samples.
More cleanup and apply code review feedback: remove max_num_cells, revert espressomd.System and box_l changes, use str.format().
Replace all occurrences of custom force_cap-based warmup code by the steepest descent algorithm. Initialize the thermostat after steepest descent. Don't print LJ interaction parameters again after minimization.
Remove code writing out (sometimes incomplete) Tcl files. Write out observables in tab-separated values files suitable for np.loadtxt() and xmgrace plotting. Remove clutter from print() statements.
End links with a double underscore to make anonymous references and avoid overshadowing explicit references (here the title reference).
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.
Content-wise nice clean-up. Lgtm, now that the points raised by @KaiSzuttor have been addressed.
I only found a few more or (being a bit pedantic) less important ortho/typographical issues.
Reviewer unavailable and comments addressed.
bors r+ |
3267: Upgrade samples r=RudolfWeeber a=jngrad Fixes #2089 Description of changes: - remove unused variables/imports/functions and some of the commented out code - remove Tcl-specific code, replace manual warmup by steepest descent - use `argparse` to process user input and document the parameters, stop printing features - improve docstrings and use them to generate an always up-to-date sample list in the docs Co-authored-by: Jean-Noël Grad <[email protected]> Co-authored-by: RudolfWeeber <[email protected]>
Fixes #2089
Description of changes:
argparse
to process user input and document the parameters, stop printing features