Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanch authored and stefanch committed Feb 4, 2021
1 parent 4a3e836 commit 41c2ea4
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 33 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
# Python egg metadata, regenerated from source files by setuptools.
/*.egg-info
/*.egg
sgdml/_bmark_cache.npz
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ For more details visit: [http://sgdml.org/](http://sgdml.org/)
Documentation can be found here: [http://sgdml.org/doc/](http://sgdml.org/doc/)

#### Requirements:
- Python 2.7/3.7+
- Python 3.7+
- NumPy (>=1.19)
- SciPy (>=1.1)

#### Optional:
- PyTorch (for GPU acceleration)
- ASE (to run atomistic simulations)
- ASE (>=3.16.2) (to run atomistic simulations)

## Getting started

Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ def get_property(property, package):
'License :: OSI Approved :: MIT License',
'Operating System :: MacOS :: MacOS X',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.7',
'Topic :: Scientific/Engineering :: Chemistry',
'Topic :: Scientific/Engineering :: Physics',
Expand Down
2 changes: 1 addition & 1 deletion sgdml/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

__version__ = '0.4.10.dev2'
__version__ = '0.4.10'

MAX_PRINT_WIDTH = 100
LOG_LEVELNAME_WIDTH = 7 # do not modify
Expand Down
36 changes: 8 additions & 28 deletions sgdml/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1833,34 +1833,7 @@ def _add_argument_dir_with_file_type(parser, type, or_file=False):
help='user-defined model output file name',
)

for subparser in [parser_all, parser_create]:
group = subparser.add_mutually_exclusive_group()
group.add_argument(
'--cg',
dest='use_cg',
action='store_true',
help='use iterative solver (conjugate gradient) with Nystroem preconditioner',
# help=argparse.SUPPRESS
)
subparser.add_argument(
'--ip',
dest='n_inducing_pts_init',
metavar='<n_inducing_pts_init>',
type=io.is_strict_pos_int,
help='initial number of inducing points (<= n_train) to use for preconditioner matrix (default: 25, larger value: fewer iterations, but higher per-iteration memory and processing cost)',
nargs='?',
default=25,
)
subparser.add_argument(
'--coff',
dest='interact_cut_off',
metavar='<interact_cut_off>',
type=io.is_strict_pos_int,
help='decay pairwise interactions to zero from a given distance (localizes the model)',
nargs='?',
default=None,
)


# train
_add_argument_dir_with_file_type(parser_train, 'task', or_file=True)

Expand Down Expand Up @@ -1935,6 +1908,13 @@ def _add_argument_dir_with_file_type(parser, type, or_file=False):
args['solver'] = 'cg'
args.pop('use_cg', None)


# TODO: remove dummy variables once iterative solver ships
missing_keys = ['n_inducing_pts_init', 'interact_cut_off', 'use_cg']
for missing_key in missing_keys:
if missing_key not in args:
args[missing_key] = None

try:
getattr(sys.modules[__name__], args['command'])(**args)
except AssistantError as err:
Expand Down
8 changes: 7 additions & 1 deletion sgdml/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,13 @@

from . import __version__, DONE, NOT_DONE
from .solvers.analytic import Analytic
from .solvers.iterative import Iterative

# TODO: remove exception handling once iterative solver ships
try:
from .solvers.iterative import Iterative
except ImportError:
pass

from .predict import GDMLPredict
from .utils.desc import Desc
from .utils import io, perm, ui
Expand Down

0 comments on commit 41c2ea4

Please sign in to comment.