File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44
55[project ]
66name = " mopactools"
7- version = " 0.1.0 "
7+ version = " 0.1.1 "
88authors = [
99 { name =" Jonathan Moussa" , email =" jemoussa@vt.edu" },
1010]
@@ -23,6 +23,7 @@ license = { text="Apache-2.0" }
2323dependencies = [
2424 " numpy" ,
2525 " scipy" ,
26+ " packaging" ,
2627]
2728
2829[project .urls ]
Original file line number Diff line number Diff line change 1919import ctypes
2020import numpy as np
2121import scipy
22+ from packaging .version import Version , InvalidVersion
2223from . import binding
2324
2425class MopacSystem :
@@ -646,4 +647,9 @@ def from_file(input_path):
646647binding .libmopac .get_mopac_version (buffer )
647648#: Semantic version number of the MOPAC shared library
648649VERSION = buffer .value .decode ('utf-8' )
649- # In the future, it might make sense to put a minimum version test here
650+ MIN_VERSION = "23.2"
651+ try :
652+ if Version (VERSION ) < Version (MIN_VERSION ):
653+ raise ValueError (f"MOPAC shared library version ({ VERSION } ) is older than the minimum required version ({ MIN_VERSION } )." )
654+ except InvalidVersion :
655+ print (f"WARNING: MOPAC shared library has a non-standard version ({ VERSION } ) and might not be compatible with mopactools." )
You can’t perform that action at this time.
0 commit comments