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

Upgrade samples #3267

Merged
merged 17 commits into from
Oct 31, 2019
Merged

Upgrade samples #3267

merged 17 commits into from
Oct 31, 2019

Conversation

jngrad
Copy link
Member

@jngrad jngrad commented Oct 20, 2019

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

Remove unused imports/variables/functions, fix mistakes, simplify
expressions, replace some magic numbers by expressions, replace
sys.stdout() by print(), remove commented code.
@codecov
Copy link

codecov bot commented Oct 20, 2019

Codecov Report

Merging #3267 into python will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           python   #3267   +/-   ##
======================================
  Coverage      85%     85%           
======================================
  Files         534     534           
  Lines       25526   25526           
======================================
  Hits        21950   21950           
  Misses       3576    3576
Impacted Files Coverage Δ
src/utils/include/utils/uniform.hpp 100% <ø> (ø) ⬆️

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 e900255...0dd8095. Read the comment docs.

samples/lj-demo.py Outdated Show resolved Hide resolved
samples/lj_liquid.py Show resolved Hide resolved
samples/lj_liquid.py Outdated Show resolved Hide resolved
@@ -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:
Copy link
Member

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

Copy link
Contributor

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()

Copy link
Member Author

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.

samples/lj_liquid_distribution.py Show resolved Hide resolved
samples/widom_insertion.py Outdated Show resolved Hide resolved
samples/drude_bmimpf6.py Outdated Show resolved Hide resolved
samples/ekboundaries.py Outdated Show resolved Hide resolved
samples/grand_canonical.py Outdated Show resolved Hide resolved
samples/lj-demo.py Show resolved Hide resolved
@RudolfWeeber RudolfWeeber assigned fweik and KaiSzuttor and unassigned fweik Oct 21, 2019
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.
doc/sphinx/io.rst Outdated Show resolved Hide resolved
End links with a double underscore to make anonymous references and
avoid overshadowing explicit references (here the title reference).
@jngrad jngrad mentioned this pull request Oct 28, 2019
Copy link
Contributor

@pkreissl pkreissl left a 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.

samples/drude_bmimpf6.py Outdated Show resolved Hide resolved
samples/electrophoresis.py Outdated Show resolved Hide resolved
samples/grand_canonical.py Outdated Show resolved Hide resolved
samples/lj_liquid.py Outdated Show resolved Hide resolved
samples/lj_liquid.py Outdated Show resolved Hide resolved
samples/reaction_ensemble.py Outdated Show resolved Hide resolved
samples/save_checkpoint.py Outdated Show resolved Hide resolved
samples/visualization_interactive.py Outdated Show resolved Hide resolved
samples/visualization_lbboundaries.py Show resolved Hide resolved
samples/visualization_poiseuille.py Show resolved Hide resolved
@RudolfWeeber RudolfWeeber dismissed KaiSzuttor’s stale review October 30, 2019 16:30

Reviewer unavailable and comments addressed.

@RudolfWeeber
Copy link
Contributor

bors r+

bors bot added a commit that referenced this pull request Oct 31, 2019
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]>
@jngrad jngrad merged commit 8aeb3c0 into espressomd:python Oct 31, 2019
@jngrad jngrad deleted the fix-2089 branch January 18, 2022 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

QA Day: Samples
5 participants