Skip to content

Commit

Permalink
Merge pull request #17 from SCMusson/releasev2.0.4
Browse files Browse the repository at this point in the history
upgrading to v2.0.4 and modified handling of OpenMM or plugin not bei…
  • Loading branch information
degiacom authored Dec 4, 2023
2 parents d63161f + 3d4b2b2 commit 96bf989
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 20 deletions.
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
author = ' S. C. Musson, M. T. Degiacomi'

# The full version, including alpha/beta/rc tags
release = '2.0.1'
release = '2.0.4'


# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="molearn",
version="2.0.1",
version="2.0.4",
author="S. C. Musson",
long_description = long_description,
long_description_content_type="text/markdown",
Expand Down
2 changes: 1 addition & 1 deletion src/molearn/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


__author__ = "V. K. Ramaswamy, S. C. Musson, C. G. Willcocks, M. T. Degiacomi"
__version__ = '2.0.1'
__version__ = '2.0.4'
__date__ = '$Date: 2023-05-16 $'


Expand Down
4 changes: 0 additions & 4 deletions src/molearn/analysis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
# if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.


__author__ = "V. K. Ramaswamy, S. C. Musson, C. G. Willcocks, M. T. Degiacomi"
__version__ = '2.0.1'
__date__ = '$Date: 2023-05-16 $'

from .analyser import MolearnAnalysis, as_numpy
from .GUI import MolearnGUI
from .path import oversample, get_path, get_path_aggregate
18 changes: 7 additions & 11 deletions src/molearn/loss_functions/openmm_thread.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import os

try:
from openmm import Platform
from openmm.app import ForceField, PDBFile, Simulation
from openmm.app import element as elem
import openmm
from openmm.app.forcefield import _createResidueSignature
from openmm.app.internal import compiled
from torchexposedintegratorplugin import TorchExposedIntegrator
except ImportError as e:
import warnings
warnings.warn(f'{e}. Will not be able to use openmm.')
from openmm import Platform
from openmm.app import ForceField, PDBFile, Simulation
from openmm.app import element as elem
import openmm
from openmm.app.forcefield import _createResidueSignature
from openmm.app.internal import compiled
from torchexposedintegratorplugin import TorchExposedIntegrator

import torch
import numpy as np
Expand Down
19 changes: 17 additions & 2 deletions src/molearn/trainers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,20 @@

from .trainer import *
from .torch_physics_trainer import *
from .openmm_physics_trainer import *
from .sinkhorn_trainer import *



class RaiseErrorOnInit:
module = 'unknown module is creating an ImportError'
def __init__(self,*args, **kwargs):
raise ImportError(f'{self.module}. Therefore {self.__class__.__name__} can not be used')
try:
from .openmm_physics_trainer import *
except ImportError as e:
import warnings
warnings.warn(f"{e}. OpenMM or openmmtorchplugin are not installed. If this is needed please install with `mamba install -c conda-forge openmmtorchplugin=1.1.3 openmm`")
try:
from .sinkhorn_trainer import *
except ImportError as e:
warnings.warn(f"{e}. sinkhorn is not installed. If this is needed please install with `pip install geomloss`")

0 comments on commit 96bf989

Please sign in to comment.