Skip to content

Commit

Permalink
Rename coulomb14Scale and lj14Scale to more generic terms
Browse files Browse the repository at this point in the history
  • Loading branch information
umesh-timalsina committed Feb 13, 2020
1 parent 20af8c6 commit 30a4c4e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions topology/forcefield/ff_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ def validate(xml_path, schema=None):
def _parse_scaling_factors(meta_tag):
"""Parse the scaling factors from the schema"""
assert meta_tag.tag == 'FFMetaData', 'Can only parse metadata from FFMetaData tag'
scaling_factors = {'coulomb14Scale': meta_tag.get('coulomb14Scale', 1.0),
'lj14Scale': meta_tag.get('lj14Scale', 1.0)}
scaling_factors = {'electrostatics14Scale': meta_tag.get('electrostatics14Scale', 1.0),
'nonBonded14Scale': meta_tag.get('nonBonded14Scale', 1.0)}
for key in scaling_factors:
if type(scaling_factors[key]) != float:
scaling_factors[key] = float(scaling_factors[key])
Expand Down
4 changes: 2 additions & 2 deletions topology/forcefield/schema/ff-topology.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@
<xsd:sequence>
<xsd:element name="Units" type="Units" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
<xsd:attribute name="coulomb14Scale" type="xsd:float" use="optional"/>
<xsd:attribute name="lj14Scale" type="xsd:float" use="optional"/>
<xsd:attribute name="electrostatics14Scale" type="xsd:float" use="optional"/>
<xsd:attribute name="nonBonded14Scale" type="xsd:float" use="optional"/>
</xsd:complexType>

</xsd:element>
Expand Down
2 changes: 1 addition & 1 deletion topology/tests/files/ff-example0.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<ForceField version="0.4.1" name="ForceFieldOne">
<FFMetaData coulomb14Scale="0.5" lj14Scale="0.67">
<FFMetaData electrostatics14Scale="0.5" nonBonded14Scale="0.67">
<Units energy="kcal/mol" distance="nm" mass="amu" charge="coulomb"/>
</FFMetaData>
<AtomTypes expression="(A*exp(-B/r) - C/r**6)">
Expand Down
4 changes: 2 additions & 2 deletions topology/tests/test_forcefield_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ def test_ff_name_version_from_xml(self, ff):
assert ff.version == '0.4.1'

def test_scaling_factors_from_xml(self, ff):
assert ff.scaling_factors['lj14Scale'] == 0.67
assert ff.scaling_factors['coulomb14Scale'] == 0.5
assert ff.scaling_factors['nonBonded14Scale'] == 0.67
assert ff.scaling_factors['electrostatics14Scale'] == 0.5

@pytest.mark.parametrize('unit_name,unit_value', [('energy', u.kcal/u.mol),
('mass', u.gram/u.mol), ('temperature', u.K),
Expand Down

0 comments on commit 30a4c4e

Please sign in to comment.