From ffc4dea698768e330a61007acb62904a3fc79444 Mon Sep 17 00:00:00 2001 From: Nathan Baker Date: Tue, 15 Jun 2021 14:41:49 -0700 Subject: [PATCH] Add temperature to finite_difference. --- .../input_file/calculate/finite_difference.py | 20 ++++++++++++++++++- docs/using/input/old/generic/temp.rst | 7 ++++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/apbs/input_file/calculate/finite_difference.py b/apbs/input_file/calculate/finite_difference.py index 8250d7c..97f0808 100644 --- a/apbs/input_file/calculate/finite_difference.py +++ b/apbs/input_file/calculate/finite_difference.py @@ -716,6 +716,7 @@ class FiniteDifference(InputFile): * ``solvent radius``: see :func:`solvent_radius` * ``surface method``: see :func:`surface_method` * ``surface spline window``: see :func:`surface_spline_window` + * ``temperature``: see :func:`temperature` .. todo:: finish this """ @@ -736,11 +737,28 @@ class FiniteDifference(InputFile): self._solvent_radius = None self._surface_method = None self._surface_spline_window = None + self._temperature = None super().__init__(dict_=dict_, yaml=yaml, json=json) + @property + def temperature(self) -> float: + """Temperature for the calculation in Kelvin. + + :raises ValueError: if not a positive number (no violations of the + 3rd Law!) + """ + return self._temperature + + @temperature.setter + def temperature(self, value): + if check.is_positive_definite(value): + self._temperature = value + else: + raise ValueError(f"{value} is not a positive number.") + @property def surface_spline_window(self) -> float: - """Window for spline-based surface definitions. + """Window for spline-based surface definitions (not needed otherwise). This is the distance (in Å) over which the spline transitions from the solvent dielectric value to the solute dielectric value. A typical diff --git a/docs/using/input/old/generic/temp.rst b/docs/using/input/old/generic/temp.rst index 24d8d8e..16700eb 100644 --- a/docs/using/input/old/generic/temp.rst +++ b/docs/using/input/old/generic/temp.rst @@ -7,11 +7,12 @@ temp Some versions of this command have been ported to the *new APBS syntax* (see :ref:`new_input_format`): + .. currentmodule:: apbs.input_file.calculate - * Nonpolar calculations: - .. currentmodule:: apbs.input_file.calculate.nonpolar + * Finite difference calculations: See :func:`finite_difference.FiniteDifference.temperature`. + * Nonpolar calculations: See :func:`nonpolar.Nonpolar.temperature`. - See :func:`Nonpolar.temperature` for more information. + .. todo:: add other uses to new syntax This keyword specifies the temperature for the calculation. The syntax is: