Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pycgtool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
James Graham
pycgtool
Commits
dd07c2ad
Commit
dd07c2ad
authored
8 years ago
by
James Graham
Browse files
Options
Downloads
Patches
Plain Diff
Added tqdm progress bar to Boltzmann Inversion
parent
bc82a05e
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
pycgtool/bondset.py
+20
-6
20 additions, 6 deletions
pycgtool/bondset.py
pycgtool/pycgtool.py
+1
-1
1 addition, 1 deletion
pycgtool/pycgtool.py
with
21 additions
and
7 deletions
pycgtool/bondset.py
+
20
−
6
View file @
dd07c2ad
...
@@ -8,7 +8,11 @@ import itertools
...
@@ -8,7 +8,11 @@ import itertools
import
numpy
as
np
import
numpy
as
np
import
math
import
math
import
random
try
:
from
tqdm
import
tqdm
except
ImportError
:
pass
from
.util
import
stat_moments
,
sliding
,
dist_with_pbc
,
transpose_and_sample
from
.util
import
stat_moments
,
sliding
,
dist_with_pbc
,
transpose_and_sample
from
.util
import
extend_graph_chain
,
cross
,
backup_file
from
.util
import
extend_graph_chain
,
cross
,
backup_file
...
@@ -351,12 +355,22 @@ class BondSet:
...
@@ -351,12 +355,22 @@ class BondSet:
# TypeError is raised when residues on end of chain calc bond to next
# TypeError is raised when residues on end of chain calc bond to next
pass
pass
def
boltzmann_invert
(
self
):
def
boltzmann_invert
(
self
,
progress
=
False
):
"""
"""
Perform Boltzmann Inversion of all bonds to calculate equilibrium value and force constant.
Perform Boltzmann Inversion of all bonds to calculate equilibrium value and force constant.
:param progress: Display a progress bar using tqdm if available
"""
"""
for
mol
in
self
.
_molecules
:
bond_iter
=
itertools
.
chain
(
*
self
.
_molecules
.
values
())
for
bond
in
self
.
_molecules
[
mol
]:
bond_iter_wrap
=
bond_iter
if
progress
:
try
:
total
=
sum
(
map
(
len
,
self
.
_molecules
.
values
()))
bond_iter_wrap
=
tqdm
(
bond_iter
,
total
=
total
)
except
NameError
:
pass
for
bond
in
bond_iter_wrap
:
bond
.
boltzmann_invert
(
temp
=
self
.
_temperature
,
bond
.
boltzmann_invert
(
temp
=
self
.
_temperature
,
angle_default_fc
=
self
.
_angle_default_fc
)
angle_default_fc
=
self
.
_angle_default_fc
)
...
...
This diff is collapsed.
Click to expand it.
pycgtool/pycgtool.py
+
1
−
1
View file @
dd07c2ad
...
@@ -56,7 +56,7 @@ def main(args, config):
...
@@ -56,7 +56,7 @@ def main(args, config):
if
args
.
bnd
:
if
args
.
bnd
:
if
args
.
map
:
if
args
.
map
:
logger
.
info
(
"
Beginning Boltzmann inversion
"
)
logger
.
info
(
"
Beginning Boltzmann inversion
"
)
bonds
.
boltzmann_invert
()
bonds
.
boltzmann_invert
(
progress
=
True
)
if
config
.
output_forcefield
:
if
config
.
output_forcefield
:
logger
.
info
(
"
Creating GROMACS forcefield directory
"
)
logger
.
info
(
"
Creating GROMACS forcefield directory
"
)
ff
=
ForceField
(
"
ff
"
+
config
.
output_name
+
"
.ff
"
)
ff
=
ForceField
(
"
ff
"
+
config
.
output_name
+
"
.ff
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment