Bug Fixes on Simfiles Directory and Config File
This commit is contained in:
@@ -1,18 +1,15 @@
|
|||||||
from crystalpol.polarization import Polarization
|
from crystalpol.polarization import Polarization
|
||||||
from crystalpol.shared.config import Config
|
from crystalpol.shared.config import Config
|
||||||
|
from crystalpol.shared.utils.log import Log
|
||||||
|
|
||||||
from yaml.loader import SafeLoader
|
from yaml.loader import SafeLoader
|
||||||
import yaml
|
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import setproctitle
|
import setproctitle
|
||||||
import argparse
|
import argparse
|
||||||
import logging
|
import logging
|
||||||
import sys
|
import yaml
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from crystalpol.shared.utils import weekday_date_time
|
|
||||||
from crystalpol.shared.utils.log import Log
|
|
||||||
|
|
||||||
__VERSION = "v0.0.1"
|
__VERSION = "v0.0.1"
|
||||||
os.nice(+19)
|
os.nice(+19)
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class Gaussian:
|
|||||||
def run(self, cycle: int, crystal: Crystal) -> List[float]:
|
def run(self, cycle: int, crystal: Crystal) -> List[float]:
|
||||||
|
|
||||||
file = Path(
|
file = Path(
|
||||||
"simfiles",
|
self.config.simulation_dir,
|
||||||
f"crystal-{str(cycle).zfill(2)}",
|
f"crystal-{str(cycle).zfill(2)}",
|
||||||
f"crystal-{str(cycle).zfill(2)}.gjf"
|
f"crystal-{str(cycle).zfill(2)}.gjf"
|
||||||
)
|
)
|
||||||
@@ -151,4 +151,9 @@ class Gaussian:
|
|||||||
|
|
||||||
lines = lines[3:] # Consume 3 more lines
|
lines = lines[3:] # Consume 3 more lines
|
||||||
|
|
||||||
return list(map(lambda x: float(x.split()[2]), lines[:number_of_charges]))
|
return list(
|
||||||
|
map(
|
||||||
|
lambda x: float(x.split()[2]),
|
||||||
|
lines[:number_of_charges]
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import os
|
|
||||||
|
|
||||||
from crystalpol.shared.system.molecule import Molecule
|
from crystalpol.shared.system.molecule import Molecule
|
||||||
from crystalpol.shared.system.crystal import Crystal
|
from crystalpol.shared.system.crystal import Crystal
|
||||||
from crystalpol.shared.system.atom import Atom
|
from crystalpol.shared.system.atom import Atom
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ class Config:
|
|||||||
|
|
||||||
n_procs: int = 1
|
n_procs: int = 1
|
||||||
pop: str = "chelpg"
|
pop: str = "chelpg"
|
||||||
charge_tolerance = 0.02
|
|
||||||
comment: str = "crystalpol"
|
comment: str = "crystalpol"
|
||||||
simulation_dir = "simfiles"
|
charge_tolerance: float = 0.02
|
||||||
|
simulation_dir: str = "simfiles"
|
||||||
mult: list = \
|
mult: list = \
|
||||||
field(default_factory=lambda: [0, 1])
|
field(default_factory=lambda: [0, 1])
|
||||||
|
|
||||||
|
|||||||
@@ -53,3 +53,12 @@ class TestConfig(unittest.TestCase):
|
|||||||
level="b3lyp/aug-cc-pVDZ",
|
level="b3lyp/aug-cc-pVDZ",
|
||||||
n_atoms=0
|
n_atoms=0
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def test_set_charge_tolerance(self):
|
||||||
|
config = Config(
|
||||||
|
mem=1,
|
||||||
|
level="b3lyp/aug-cc-pVDZ",
|
||||||
|
n_atoms=10,
|
||||||
|
charge_tolerance=0.001
|
||||||
|
)
|
||||||
|
self.assertEqual(config.charge_tolerance, 0.001)
|
||||||
|
|||||||
Reference in New Issue
Block a user