|
1 | 1 | """ |
2 | | -DatabankLib package. |
| 2 | +DatabankLib package for NMRlipids Databank project. |
3 | 3 |
|
4 | 4 | Here we define the main package variables and constants used throughout the NMRlipids |
5 | 5 | Databank project. |
|
8 | 8 |
|
9 | 9 | import os |
10 | 10 |
|
11 | | -from ._version import __version__ # noqa: F401 |
| 11 | +from ._version import __version__ |
12 | 12 |
|
13 | 13 | # Package Information |
14 | 14 |
|
15 | | -__author__ = "NMRlipids open collaboration" |
| 15 | +__author__ = "NMRlipids Open Collaboration" |
16 | 16 |
|
17 | 17 | __author_email__ = "samuli.ollila@helsinki.fi" |
18 | 18 |
|
|
22 | 22 | "the NMRlipids Databank." |
23 | 23 | ) |
24 | 24 |
|
| 25 | +__license__ = "GPL-v3" |
| 26 | + |
25 | 27 | __url__ = "https://github.com/NMRlipids/Databank" |
26 | 28 |
|
27 | 29 | # Global Paths |
28 | 30 |
|
29 | | -NMLDB_ROOT_PATH: str = os.environ.get( |
30 | | - "NMLDB_ROOT_PATH", |
31 | | - os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))), |
32 | | -) |
33 | | -""" Path to the project root """ |
34 | | - |
35 | 31 | NMLDB_DATA_PATH: str = os.environ.get( |
36 | 32 | "NMLDB_DATA_PATH", |
37 | | - os.path.join(NMLDB_ROOT_PATH, "Data"), |
| 33 | + os.path.join(os.getcwd(), "BilayerData"), |
38 | 34 | ) |
39 | | -""" Path to the project data folder """ |
| 35 | +""" Path to the Databank Data folder """ |
40 | 36 |
|
41 | 37 | NMLDB_SIMU_PATH: str = os.environ.get( |
42 | 38 | "NMLDB_SIMU_PATH", |
|
50 | 46 | NMLDB_EXP_PATH: str = os.path.join(NMLDB_DATA_PATH, "experiments") |
51 | 47 | """ Path to the project experiments folder """ |
52 | 48 |
|
53 | | -if not os.path.isdir(NMLDB_DATA_PATH): |
54 | | - raise RuntimeError( |
55 | | - "Seems that you installed package in a non-debug mode. " |
56 | | - "In this case you *must* set NMLDB_ROOT_PATH explicitly " |
57 | | - "to git-clonned `Databank` folder.", |
58 | | - ) |
59 | | - |
60 | 49 | # Universal return codes |
61 | 50 |
|
62 | 51 | RCODE_SKIPPED: int = 0 |
|
67 | 56 |
|
68 | 57 | RCODE_ERROR: int = 2 |
69 | 58 | """ Success code 2: calculation failed """ |
| 59 | + |
| 60 | +print( |
| 61 | + f"DatabankLib {__version__} by {__author__} - {__license__}", |
| 62 | +) |
| 63 | + |
| 64 | +if os.path.isdir(NMLDB_DATA_PATH): |
| 65 | + from DatabankLib.settings import molecules |
| 66 | + |
| 67 | + _ = len(molecules.lipids_set) |
| 68 | + print( |
| 69 | + f"NMRlipids Databank is initialized from the folder: {NMLDB_DATA_PATH}\n" |
| 70 | + "---------------------------------------------------------------", |
| 71 | + ) |
| 72 | +else: |
| 73 | + msg = f""" |
| 74 | +Error: no data folder {NMLDB_DATA_PATH}. |
| 75 | +If Data folder was not created, please create it by using |
| 76 | + $ nml_initialize_data.py toy |
| 77 | + OR |
| 78 | + $ nml_initialize_data.py stable |
| 79 | +and then specify by NMLDB_DATA_PATH environment variable.""" |
| 80 | + raise RuntimeError(msg) |
0 commit comments