-
Notifications
You must be signed in to change notification settings - Fork 7
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
Adding smaller test data #55
Changes from 6 commits
8b4a44d
15917b5
476c50d
4e90b39
976615a
e0fef66
45e9866
dbea2a0
53f1336
cc80891
e435e0a
836e754
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
[run] | ||
omit = | ||
pyedr/pyedr/tests/data/* | ||
pyedr/pyedr/tests/* | ||
|
||
|
||
[report] | ||
exclude_lines = | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
pandas | ||
pyedr | ||
pbr | ||
tqdm | ||
BFedder marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,6 +47,7 @@ | |
import sys | ||
import itertools | ||
import time | ||
from tqdm import tqdm | ||
from typing import List, Tuple, Dict | ||
|
||
import numpy as np | ||
|
@@ -444,24 +445,26 @@ def read_edr(path: str, verbose: bool = False) -> read_edr_return_type: | |
all_energies = [] | ||
all_names = [u'Time'] + [nm.name for nm in edr_file.nms] | ||
times = [] | ||
for ifr, frame in enumerate(edr_file): | ||
if verbose: | ||
if ((ifr < 20 or ifr % 10 == 0) and | ||
(ifr < 200 or ifr % 100 == 0) and | ||
(ifr < 2000 or ifr % 1000 == 0)): | ||
print('\rRead frame : {}, time : {} ps'.format(ifr, frame.t), | ||
end='', file=sys.stderr) | ||
if frame.ener: | ||
# Export only frames that contain energies | ||
times.append(frame.t) | ||
all_energies.append([frame.t] + [ener.e for ener in frame.ener]) | ||
if verbose: | ||
for ifr, frame in tqdm(enumerate(edr_file)): | ||
if frame.ener: | ||
# Export only frames that contain energies | ||
times.append(frame.t) | ||
all_energies.append([frame.t] + [ener.e for ener in frame.ener]) | ||
|
||
else: | ||
for ifr, frame in enumerate(edr_file): | ||
if frame.ener: | ||
# Export only frames that contain energies | ||
times.append(frame.t) | ||
all_energies.append([frame.t] + [ener.e for ener in frame.ener]) | ||
BFedder marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
end = time.time() | ||
if verbose: | ||
print('\rLast Frame read : {}, time : {} ps' | ||
.format(ifr, frame.t), | ||
end='', file=sys.stderr) | ||
print('\n{} frame read in {:.2f} seconds'.format(ifr, end - begin), | ||
print('\n{} frames read in {:.2f} seconds'.format(ifr, end - begin), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we just get rid of timing altogether? You get iterations per second out of the standard tqdm output, otherwise if we really want total time, we could do something like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think there isn't really a need for timing as a default or even verbose option. IMO TQDM has enough timing info. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess you'll still need the verbose flag to turn tqdm on/off? |
||
file=sys.stderr) | ||
return all_energies, all_names, times | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# This file was created Tue Aug 2 10:36:39 2022 | ||
# Created by: | ||
# :-) GROMACS - gmx energy, 2021.5 (-: | ||
# | ||
# Executable: /biggin/b149/mert4328/gromacs2021.5/bin/gmx | ||
# Data prefix: /biggin/b149/mert4328/gromacs2021.5 | ||
# Working dir: /biggin/b149/mert4328/Downloads/panedr/pyedr/pyedr/tests/data | ||
# Command line: | ||
# gmx energy -f cat.edr -o cat.xvg | ||
# gmx energy is part of G R O M A C S: | ||
# | ||
# Green Red Orange Magenta Azure Cyan Skyblue | ||
# | ||
@ title "GROMACS Energies" | ||
@ xaxis label "Time (ps)" | ||
@ yaxis label "(kJ/mol), (K), (bar), (), (nm), (nm^3), (kg/m^3), (bar nm), (nm/ps)" | ||
@TYPE xy | ||
@ view 0.15, 0.15, 0.75, 0.85 | ||
@ legend on | ||
@ legend box on | ||
@ legend loctype view | ||
@ legend 0.78, 0.8 | ||
@ legend length 2 | ||
@ s0 legend "Bond" | ||
@ s1 legend "Angle" | ||
@ s2 legend "Proper Dih." | ||
@ s3 legend "Ryckaert-Bell." | ||
@ s4 legend "LJ-14" | ||
@ s5 legend "Coulomb-14" | ||
@ s6 legend "LJ (SR)" | ||
@ s7 legend "Disper. corr." | ||
@ s8 legend "Coulomb (SR)" | ||
@ s9 legend "Coul. recip." | ||
@ s10 legend "Potential" | ||
@ s11 legend "Kinetic En." | ||
@ s12 legend "Total Energy" | ||
@ s13 legend "Conserved En." | ||
@ s14 legend "Temperature" | ||
@ s15 legend "Pres. DC" | ||
@ s16 legend "Pressure" | ||
@ s17 legend "Constr. rmsd" | ||
@ s18 legend "Box-X" | ||
@ s19 legend "Box-Y" | ||
@ s20 legend "Box-Z" | ||
@ s21 legend "Volume" | ||
@ s22 legend "Density" | ||
@ s23 legend "pV" | ||
@ s24 legend "Enthalpy" | ||
@ s25 legend "Vir-XX" | ||
@ s26 legend "Vir-XY" | ||
@ s27 legend "Vir-XZ" | ||
@ s28 legend "Vir-YX" | ||
@ s29 legend "Vir-YY" | ||
@ s30 legend "Vir-YZ" | ||
@ s31 legend "Vir-ZX" | ||
@ s32 legend "Vir-ZY" | ||
@ s33 legend "Vir-ZZ" | ||
@ s34 legend "Pres-XX" | ||
@ s35 legend "Pres-XY" | ||
@ s36 legend "Pres-XZ" | ||
@ s37 legend "Pres-YX" | ||
@ s38 legend "Pres-YY" | ||
@ s39 legend "Pres-YZ" | ||
@ s40 legend "Pres-ZX" | ||
@ s41 legend "Pres-ZY" | ||
@ s42 legend "Pres-ZZ" | ||
@ s43 legend "#Surf*SurfTen" | ||
@ s44 legend "Box-Vel-XX" | ||
@ s45 legend "Box-Vel-YY" | ||
@ s46 legend "Box-Vel-ZZ" | ||
@ s47 legend "T-Protein" | ||
@ s48 legend "T-non-Protein" | ||
@ s49 legend "Lamb-Protein" | ||
@ s50 legend "Lamb-non-Protein" | ||
0.000000 1374.823242 3764.527344 231.283890 1769.977173 2654.552490 7772.819824 93403.531250 -4571.847656 -634643.937500 3080.209717 -525164.062500 86616.812500 -438547.250000 -438527.062500 303.022461 -226.715179 120.662346 0.000003 6.946903 6.946903 6.946903 335.253754 1021.368042 20.189453 -438527.062500 26742.484375 -1014.244263 -428.990967 -1014.437500 27074.781250 -1649.407959 -428.967163 -1649.536377 29145.390625 204.548508 99.160240 16.660902 99.179382 215.034927 138.859970 16.658545 138.872696 -57.596401 -1857.519287 0.000000 0.000000 0.000000 305.216461 302.853333 1.000000 1.000000 | ||
0.020000 1426.225220 3752.830322 263.692535 1819.986816 2681.986084 7719.875977 93969.390625 -4571.750488 -634577.250000 2922.847168 -524592.125000 86058.304688 -438533.812500 -438520.187500 301.068573 -226.705521 127.012749 0.000003 6.946952 6.946952 6.946952 335.260864 1021.346375 20.189880 -438513.625000 29358.015625 404.244843 1123.673584 404.736359 24486.328125 -524.118896 1123.208862 -525.036743 28367.406250 -77.379997 -34.419483 -122.969460 -34.468178 436.573883 42.815838 -122.923424 42.906754 21.844366 -1095.899536 0.002461 0.002461 0.002461 302.409576 300.965179 1.000000 1.000000 | ||
0.040000 1482.009888 3731.591797 261.267670 1802.421021 2664.599365 7685.277344 94167.468750 -4571.551758 -634705.562500 3063.695312 -524418.812500 86040.515625 -438378.312500 -438527.031250 301.006317 -226.685791 172.537247 0.000003 6.947053 6.947053 6.947053 335.275482 1021.301880 20.190762 -438358.125000 26755.218750 -1644.403564 1042.608276 -1644.735718 24932.406250 -618.195557 1041.680420 -618.909668 29127.406250 216.510681 150.174057 -84.276016 150.206955 373.560364 47.772625 -84.184113 47.843361 -72.459267 -2553.005859 0.005053 0.005053 0.005053 299.224762 301.143646 1.000000 1.000000 | ||
0.060000 1470.337524 3683.409424 237.611053 1862.587646 2639.180664 7770.815430 93807.351562 -4571.210938 -634513.875000 2964.734863 -524649.062500 86426.179688 -438222.875000 -438543.031250 302.355530 -226.652084 40.944675 0.000003 6.947225 6.947225 6.947225 335.300385 1021.226013 20.192261 -438202.687500 27163.343750 -2570.930908 1478.509766 -2571.069824 30978.859375 -990.745056 1477.574463 -991.381042 27043.828125 160.203705 262.667664 -130.225845 262.681427 -189.501358 113.234261 -130.133194 113.297256 152.131683 1158.661621 0.008582 0.008582 0.008582 299.770569 302.554779 1.000000 1.000000 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
numpy>=1.19.0 | ||
pbr | ||
tqdm |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ python_requires = >= 3.6 | |
install_requires = | ||
numpy | ||
pbr | ||
tqdm | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Forgot to also say, can you add tqdm to the gh actions CI yaml file? |
||
|
||
[options.extras_require] | ||
test = | ||
|
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.
Just FYI here - @BFedder and I had a chat about this a week or so ago and I told him to go ahead with this, tqdm is a reasonably small dependency, and it will make life a lot easier imho.
@jbarnoud as the original code author, do you have any issues with this?