Skip to content

Commit

Permalink
Merge branch 'release/v0.1.9'
Browse files Browse the repository at this point in the history
  • Loading branch information
wpk committed Feb 15, 2023
2 parents 53148f7 + 4ce88bb commit 89a05fb
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 20 deletions.
14 changes: 10 additions & 4 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@ include CONTRIBUTING.rst
include HISTORY.rst
include LICENSE
include README.rst
include Makefile

recursive-include tests *
recursive-exclude * __pycache__
recursive-exclude * *.py[co]
recursive-include tests *.py

recursive-include docs *.rst conf.py Makefile make.bat *.jpg *.png *.gif
global-exclude *.py[co]
prune */*.egg-info
prune */*mypy_cache
prune */*ipynb_checkpoints
prune */__pycache__

prune docs
prune notebooks
15 changes: 12 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,18 @@
# the built documents.
#
# The short X.Y version.
version = thermoextrap.__version__
# The full version, including alpha/beta/rc tags.
release = thermoextrap.__version__
# versioning with scm with editable install has issues.
# instead, try to use scm if available.
try:
from setuptools_scm import get_version

version = get_version(root="..", relative_to=__file__)
release = version
except ImportError:
version = thermoextrap.__version__
# The full version, including alpha/beta/rc tags.
release = thermoextrap.__version__


# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
1 change: 1 addition & 0 deletions environment-tools.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# packages for development
dependencies:
- matplotlib
# linting
# - black
# - blackdoc
Expand Down
3 changes: 1 addition & 2 deletions environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ channels:
dependencies:
- python>=3.8
- sympy
- matplotlib
- numpy
- scipy
- xarray
# - openmm
- cmomy
- cmomy>=0.1.9
- custom-inherit
- attrs
- pymbar<4.0
Expand Down
8 changes: 5 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ classifiers =
Programming Language :: Python :: 3.10
Topic :: Scientific/Engineering


# TODO: fix optional dependcies.
# For now, matplotlib is a strong dependency.
# Also not sure about dask and bottleneck.
[options]
package_dir=
=src
Expand All @@ -32,11 +34,11 @@ zip_safe = True # if using mypy, must be False
include_package_data = True
python_requires = >=3.8
install_requires =
numpy >= 1.19
numpy >= 1.20
xarray >= 0.16
sympy
scipy
cmomy >= 0.1.7
cmomy >= 0.1.9
custom-inherit
attrs

Expand Down
4 changes: 3 additions & 1 deletion src/thermoextrap/gpr_active/active_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import time

import gpflow
import matplotlib.pyplot as plt
import numpy as np
import sympy as sp

Expand Down Expand Up @@ -1046,6 +1045,9 @@ def do_plotting(self, x, y, err, alpha_list):
Plots output used to select new update point.
err is expected to be length 2 list with upper and lower confidence intervals
"""

import matplotlib.pyplot as plt

fig, ax = plt.subplots()
if self.compare_func is not None:
compare_y = self.compare_func(x[:, None])
Expand Down
21 changes: 17 additions & 4 deletions src/thermoextrap/recursive_interp.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,21 @@

try:
import matplotlib.pyplot as plt

_HAS_PLT = True
except ImportError:
print(
"Could not find matplotlib - plotting will fail, so ensure that all"
" doPlot options are set to False, which is the default."
)
_HAS_PLT = False
# print(
# "Could not find matplotlib - plotting will fail, so ensure that all"
# " doPlot options are set to False, which is the default."
# )


def _has_plt():
if _HAS_PLT:
pass
else:
raise ImportError("install matplotlib for this functionality")


class RecursiveInterp:
Expand Down Expand Up @@ -160,6 +170,7 @@ def recursiveTrain(

# Do some plotting just as a visual for how things are going, if desired
if doPlot:
_has_plt()
if "val" in predictVals.dims:
toplot = predictVals.isel(val=0)
else:
Expand Down Expand Up @@ -388,6 +399,7 @@ def checkPolynomialConsistency(self, doPlot=False):

# Before loop, set up plot if wanted
if doPlot:
_has_plt()
pColors = plt.cm.cividis(np.linspace(0.0, 1.0, len(edgeSets)))
pFig, pAx = plt.subplots()
plotYmin = 1e10
Expand Down Expand Up @@ -450,6 +462,7 @@ def checkPolynomialConsistency(self, doPlot=False):
plotYmax = np.max(allPlotY)

if doPlot:
_has_plt()
for edge in self.edgeB:
pAx.plot([edge] * 2, [plotYmin, plotYmax], "k-")
pAx.set_xlabel(r"$\beta$")
Expand Down
13 changes: 10 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -175,16 +175,23 @@ conda_deps =
{[base]conda_deps_test}
conda-remote: {[base]package_name}
conda-local: {posargs}
conda: pymbar<4.0


deps =
pypi-remote: {[base]package_name}
pypi-local: {posargs}
pypi-remote: {[base]package_name}[mbar,gpr]
pypi-local: {posargs}[mbar,gpr]
conda: tensorflow
conda: tensorflow-probability
conda: gpflow


allowlist_externals =
{[base]allowlist_externals}
commands =
{[base]commands_test_check}
pytest {toxinidir}
local: pytest {toxinidir}
remote: pytest {posargs} {toxinidir}

# [testenv]
# usedevelop =
Expand Down

0 comments on commit 89a05fb

Please sign in to comment.