Skip to content
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
10 changes: 8 additions & 2 deletions openmmtools/multistate/multistatereporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@
except ImportError: # OpenMM < 7.6
from simtk import unit


try:
from yaml import CLoader as Loader, CDumper as Dumper
except ImportError:
from yaml import Loader, Dumper

import openmmtools
from openmmtools.utils import deserialize, with_timer, serialize, quantity_from_string
from openmmtools import states
Expand Down Expand Up @@ -1882,7 +1888,7 @@ def _write_dict(self, path, data, storage_name='analysis',
# MODULE INTERNAL USAGE UTILITIES
# ==============================================================================

class _DictYamlLoader(yaml.CLoader):
class _DictYamlLoader(yaml.Loader):
"""PyYAML Loader that reads !Quantity tags."""
def __init__(self, *args, **kwargs):
super(_DictYamlLoader, self).__init__(*args, **kwargs)
Expand All @@ -1908,7 +1914,7 @@ def ndarray_constructor(loader, node):
return data


class _DictYamlDumper(yaml.CDumper):
class _DictYamlDumper(yaml.Dumper):
"""PyYAML Dumper that handle openmm Quantities through !Quantity tags."""

def __init__(self, *args, **kwargs):
Expand Down
4 changes: 2 additions & 2 deletions openmmtools/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,8 @@ def math_eval(expression, variables=None, functions=None):
functions = extra_functions

def _math_eval(node):
if isinstance(node, ast.Num):
return node.n
if isinstance(node, ast.Constant):
return node.value
elif isinstance(node, ast.UnaryOp):
return operators[type(node.op)](_math_eval(node.operand))
elif isinstance(node, ast.BinOp):
Expand Down
16 changes: 11 additions & 5 deletions readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
version: 2

conda:
environment: devtools/conda-envs/test_env.yaml

build:
os: ubuntu-22.04
os: "ubuntu-24.04"
tools:
python: mambaforge-4.10
python: "miniconda3-3.12-24.9"

sphinx:
configuration: docs/conf.py
fail_on_warning: false

conda:
environment: devtools/conda-envs/test_env.yaml

python:
# Install our python package before building the docs
install:
- method: pip
path: .
Loading