Exemple #1
0
    def test_setters(self):
        new_potential = ParametricPotential()
        new_potential.name = "SettingName"
        new_potential.set_expression(
            independent_variables=sympy.symbols({'r'}),
            expression='r*sigma*epsilon',
            parameters={
                'sigma': 1 * u.nm,
                'epsilon': 10 * u.Unit('kcal / mol')
            }
        )

        assert new_potential.name == "SettingName"
        assert new_potential.independent_variables == {sympy.symbols('r')}
        assert new_potential.parameters == {
            'sigma': 1 * u.nm,
            'epsilon': 10 * u.Unit('kcal / mol')
        }
        assert new_potential.expression == sympy.sympify('r * sigma * epsilon')
Exemple #2
0
    def test_setters(self):
        new_potential = ParametricPotential()
        new_potential.name = "SettingName"
        new_potential.set_expression(
            independent_variables=sympy.symbols({"r"}),
            expression="r*sigma*epsilon",
            parameters={
                "sigma": 1 * u.nm,
                "epsilon": 10 * u.Unit("kcal / mol"),
            },
        )

        assert new_potential.name == "SettingName"
        assert new_potential.independent_variables == {sympy.symbols("r")}
        assert new_potential.parameters == {
            "sigma": 1 * u.nm,
            "epsilon": 10 * u.Unit("kcal / mol"),
        }
        assert new_potential.expression == sympy.sympify("r * sigma * epsilon")