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

fix: evaluator unit bug #277

Merged
merged 2 commits into from
Feb 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions src/evaluator_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,6 @@ def _parameter_value_from_gradient_key(self, gradient_key):
bool
Returns True if the parameter is a cosmetic one.
"""
try:
import openmm.unit as simtk_unit
except ImportError:
import simtk.unit as simtk_unit

parameter_handler = self.FF.openff_forcefield.get_parameter_handler(
gradient_key.tag
Expand Down Expand Up @@ -350,10 +346,7 @@ def _parameter_value_from_gradient_key(self, gradient_key):
):
is_cosmetic = True

if not isinstance(parameter_value, simtk_unit.Quantity):
parameter_value = parameter_value * simtk_unit.dimensionless

return openmm_quantity_to_pint(parameter_value), is_cosmetic
return parameter_value, is_cosmetic

def _extract_physical_parameter_values(self):
"""Extracts an array of the values of the physical parameters
Expand Down
2 changes: 1 addition & 1 deletion src/smirnoffio.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def smirnoff_analyze_parameter_coverage(forcefield, tgt_opts):
logger.info('%4i %-100s : %10d\n' % (i, p, parameter_counter[smirks]))
if parameter_counter[smirks] > 0:
n_covered += 1
logger.info("SNIRNOFF Parameter Coverage Analysis result: %d/%d parameters are covered.\n" % (n_covered, len(forcefield.plist)))
logger.info("SMIRNOFF Parameter Coverage Analysis result: %d/%d parameters are covered.\n" % (n_covered, len(forcefield.plist)))
logger.info("-"*118 + '\n')

class SMIRNOFF_Reader(BaseReader):
Expand Down
2 changes: 1 addition & 1 deletion studies/022_opt_geo_target/optimize.out
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ Force field assignment data written to /home2/qyd/projects/forcebalance-dev/stud
24 vdW/Atom/rmin_half/[#6X4:1] : 2
25 vdW/Atom/epsilon/[#8X2H0+0:1] : 2
26 vdW/Atom/rmin_half/[#8X2H0+0:1] : 2
SNIRNOFF Parameter Coverage Analysis result: 27/27 parameters are covered.
SMIRNOFF Parameter Coverage Analysis result: 27/27 parameters are covered.
----------------------------------------------------------------------------------------------------------------------
Using parabolic regularization (Gaussian prior) with strength 1.0e+00 (+), 0.0e+00 (x)
#========================================================#
Expand Down
2 changes: 1 addition & 1 deletion studies/023_torsion_relaxed/optimize.out
Original file line number Diff line number Diff line change
Expand Up @@ -1621,7 +1621,7 @@ Force field assignment data written to /home/leeping/src/forcebalance/studies/02
501 ProperTorsions/Proper/k1/[*:1]-[*:2]#[*:3]-[*:4] : 0
502 ProperTorsions/Proper/k1/[*:1]~[*:2]-[*:3]#[*:4] : 0
503 ProperTorsions/Proper/k1/[*:1]~[*:2]=[#6,#7,#16,#15;X2:3]=[*:4] : 0
SNIRNOFF Parameter Coverage Analysis result: 19/504 parameters are covered.
SMIRNOFF Parameter Coverage Analysis result: 19/504 parameters are covered.
----------------------------------------------------------------------------------------------------------------------
Using parabolic regularization (Gaussian prior) with strength 1.0e+00 (+), 0.0e+00 (x)
#========================================================#
Expand Down
2 changes: 1 addition & 1 deletion studies/024_openff_evaluator/output_ref/optimize.out
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ Force field assignment data written to XXX/smirnoff_parameter_assignments.json
7 vdW/Atom/rmin_half/[#6X4:1] : 0
8 vdW/Atom/epsilon/[#8X2H1+0:1] : 0
9 vdW/Atom/rmin_half/[#8X2H1+0:1] : 0
SNIRNOFF Parameter Coverage Analysis result: 0/10 parameters are covered.
SMIRNOFF Parameter Coverage Analysis result: 0/10 parameters are covered.
----------------------------------------------------------------------------------------------------------------------
Using parabolic regularization (Gaussian prior) with strength 1.0e+00 (+), 0.0e+00 (x)

Expand Down
2 changes: 1 addition & 1 deletion studies/025_openff_recharge/output_ref/optimize.out
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Force field assignment data written to /Users/boothros/PyCharmProjects/forcebala
idx Parameter Count
----------------------------------------------------------------------------------------------------------------------
0 ChargeIncrementModel/ChargeIncrement/charge_increment1/[#6X4:1]-[#1:2] : 0
SNIRNOFF Parameter Coverage Analysis result: 0/1 parameters are covered.
SMIRNOFF Parameter Coverage Analysis result: 0/1 parameters are covered.
----------------------------------------------------------------------------------------------------------------------
Using parabolic regularization (Gaussian prior) with strength 1.0e+00 (+), 0.0e+00 (x)
#========================================================#
Expand Down
2 changes: 1 addition & 1 deletion studies/026_smirnoff_14_scale/optimize.out
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Force field assignment data written to /Users/boothros/PyCharmProjects/forcebala
idx Parameter Count
----------------------------------------------------------------------------------------------------------------------
0 /vdW/scale14 : 0
SNIRNOFF Parameter Coverage Analysis result: 0/1 parameters are covered.
SMIRNOFF Parameter Coverage Analysis result: 0/1 parameters are covered.
----------------------------------------------------------------------------------------------------------------------
Using parabolic regularization (Gaussian prior) with strength 1.0e+00 (+), 0.0e+00 (x)
#========================================================#
Expand Down
2 changes: 1 addition & 1 deletion studies/027_openff_hessian_target/optimize.out
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ Force field assignment data written to /Users/hyesu/Project/git-repo/fb-factorie
24 vdW/Atom/epsilon/[#6X4:1] : 0
25 vdW/Atom/rmin_half/[#8X2H0+0:1] : 0
26 vdW/Atom/epsilon/[#8X2H0+0:1] : 0
SNIRNOFF Parameter Coverage Analysis result: 6/27 parameters are covered.
SMIRNOFF Parameter Coverage Analysis result: 6/27 parameters are covered.
----------------------------------------------------------------------------------------------------------------------
Using parabolic regularization (Gaussian prior) with strength 1.0e+00 (+), 0.0e+00 (x)
#========================================================#
Expand Down