|
1 | 1 | #!/usr/bin/env python |
2 | | -# |
3 | | -# Entry junction |
4 | | -# Author: Evgeny Blokhin |
5 | 2 | ''' |
6 | | -Tilde is general-purpose materials informatics framework |
7 | | -for intelligent organizers of the scientific modeling data. |
| 3 | +Entry junction |
| 4 | +
|
| 5 | +Tilde is a general-purpose materials informatics framework |
| 6 | +for intelligent organizers of the first-principles modeling data. |
8 | 7 | More info: https://tilde.pro |
| 8 | +
|
| 9 | +Author: Evgeny Blokhin |
9 | 10 | ''' |
10 | | -from __future__ import print_function |
11 | 11 | import os, sys |
12 | 12 | import time |
13 | 13 | import logging |
14 | | - |
15 | 14 | import argparse |
| 15 | + |
16 | 16 | from numpy import array |
17 | 17 | from numpy.linalg import det |
18 | 18 |
|
19 | 19 | import chk_tilde_install |
20 | 20 |
|
21 | | -from tilde.core.settings import settings, connect_database, DATA_DIR, DB_SCHEMA_VERSION |
| 21 | +from tilde.core.settings import settings, connect_database, DATA_DIR, SETTINGS_PATH, DB_SCHEMA_VERSION |
22 | 22 | from tilde.core.common import write_cif, num2name |
23 | 23 | from tilde.core.symmetry import SymmetryFinder |
24 | 24 | from tilde.core.api import API |
|
32 | 32 | parser = argparse.ArgumentParser( |
33 | 33 | prog="[this_script]", |
34 | 34 | usage="%(prog)s [positional / optional arguments]", |
35 | | - epilog="API v%s, DB schema v%s (%s backend)" % (API.version, DB_SCHEMA_VERSION, settings['db']['engine']), |
| 35 | + epilog="API v%s, DB schema v%s (%s backend), settings from %s" % (API.version, DB_SCHEMA_VERSION, settings['db']['engine'], SETTINGS_PATH), |
36 | 36 | argument_default=argparse.SUPPRESS |
37 | 37 | ) |
38 | | -parser.add_argument("path", action="store", help="Scan file(s) / folder(s) / matching-filename(s), divide by space", metavar="PATH(S)/FILE(S)", nargs='*', default=False) |
39 | | -parser.add_argument("-y", dest="symprec", action="store", help="symmetry detecting tolerance (default %.01e)" % SymmetryFinder.accuracy, type=float, metavar="float", nargs='?', const=None, default=None) |
40 | | -parser.add_argument("-r", dest="recursive", action="store", help="scan recursively", type=bool, metavar="", nargs='?', const=True, default=False) |
41 | | -parser.add_argument("-t", dest="terse", action="store", help="terse print during scan", type=bool, metavar="", nargs='?', const=True, default=False) |
42 | | -parser.add_argument("-a", dest="add", action="store", help="add results to the database", type=str, metavar="N if sqlite", nargs='?', const=settings['db']['default_sqlite_db'], default=False) |
43 | | -parser.add_argument("-v", dest="convergence", action="store", help="print calculation convergence", type=bool, metavar="", nargs='?', const=True, default=False) |
44 | | -parser.add_argument("-f", dest="freqs", action="store", help="print phonons", type=bool, metavar="", nargs='?', const=True, default=False) |
45 | | -parser.add_argument("-i", dest="info", action="store", help="print tags", type=bool, metavar="", nargs='?', const=True, default=False) |
46 | | -parser.add_argument("-m", dest="module", action="store", help="invoke a module from the list", nargs='?', const=True, default=False, choices=list(Tilde.Apps.keys())) |
47 | | -parser.add_argument("-s", dest="structures", action="store", help="print the final lattice and the final atomic structure", type=bool, metavar="", nargs='?', const=True, default=False) |
48 | | -parser.add_argument("-c", dest="cif", action="store", help="save i-th CIF structure in \"data\" folder", type=int, metavar="i", nargs='?', const=-1, default=False) |
49 | | -parser.add_argument("-x", dest="service", action="store", help="print total number of items (use to create schema)", type=bool, metavar="", nargs='?', const=True, default=False) |
50 | | -parser.add_argument("-l", dest="targetlist", action="store", help="file with scan targets", type=str, metavar="file", nargs='?', const=None, default=None) |
| 38 | +parser.add_argument("path", action="store", help="Scan file(s) / folder(s) / matching-filename(s), divide by space", metavar="PATH(S)/FILE(S)", nargs='*', default=False) |
| 39 | +parser.add_argument("-y", dest="symprec", action="store", help="symmetry detecting tolerance (default %.01e)" % SymmetryFinder.accuracy, type=float, metavar="float", nargs='?', const=None, default=None) |
| 40 | +parser.add_argument("-r", dest="recursive", action="store", help="scan recursively", type=bool, metavar="", nargs='?', const=True, default=False) |
| 41 | +parser.add_argument("-t", dest="terse", action="store", help="terse print during scan", type=bool, metavar="", nargs='?', const=True, default=False) |
| 42 | +parser.add_argument("-a", dest="add", action="store", help="add results to the database", type=str, metavar="N if sqlite", nargs='?', const=settings['db']['default_sqlite_db'], default=False) |
| 43 | +parser.add_argument("-v", dest="convergence", action="store", help="print calculation convergence", type=bool, metavar="", nargs='?', const=True, default=False) |
| 44 | +parser.add_argument("-f", dest="freqs", action="store", help="print phonons", type=bool, metavar="", nargs='?', const=True, default=False) |
| 45 | +parser.add_argument("-i", dest="info", action="store", help="print tags", type=bool, metavar="", nargs='?', const=True, default=False) |
| 46 | +parser.add_argument("-m", dest="module", action="store", help="invoke a module from the list", nargs='?', const=True, default=False, choices=list(Tilde.Apps.keys())) |
| 47 | +parser.add_argument("-s", dest="structures", action="store", help="print the final lattice and the final atomic structure", type=bool, metavar="", nargs='?', const=True, default=False) |
| 48 | +parser.add_argument("-c", dest="cif", action="store", help="save i-th CIF structure in \"data\" folder", type=int, metavar="i", nargs='?', const=-1, default=False) |
| 49 | +parser.add_argument("-x", dest="service", action="store", help="print total number of items (use to create schema)", type=bool, metavar="", nargs='?', const=True, default=False) |
| 50 | +parser.add_argument("-l", dest="targetlist", action="store", help="file with scan targets", type=str, metavar="file", nargs='?', const=None, default=None) |
51 | 51 | args = parser.parse_args() |
52 | 52 |
|
53 | 53 | session = None |
|
0 commit comments