Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Improve UC distribution and add new UCS + UC generator" #62

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
32 changes: 0 additions & 32 deletions .pre-commit-config.yaml

This file was deleted.

8 changes: 2 additions & 6 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
include README.rst
include docs/*.txt

recursive-include package/ClayCode/data/data *
recursive-include package/ClayCode/data/user_data *
recursive-include package/ClayCode/data *
recursive-include package/ClayCode/builder/config *
recursive-include package/ClayCode/builder/tests/ *
recursive-include package/ClayCode/builder/data *
recursive-include package/ClayCode/siminp/config *
recursive-include package/ClayCode/siminp/scripts *
recursive-include package/ClayCode/addmols/config *
recursive-include package/tests/builder *
recursive-include package/tests *

5 changes: 0 additions & 5 deletions package/ClayCode/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
AnyDir,
AnyFile,
FileNameMatchSelector,
NumOrListDictOf,
NumOrListOf,
PathOrStr,
PathType,
StrNum,
Expand Down Expand Up @@ -110,9 +108,6 @@
"ArgsFactory",
"DirFactory",
"FileFactory",
"PathListFactory",
"NumOrListOf",
"NumOrListDictOf",
]
logging.setLoggerClass(ClayCodeLogger)
# from Bio import BiopythonDeprecationWarning
150 changes: 70 additions & 80 deletions package/ClayCode/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,97 +17,87 @@
logger: ClayCodeLogger = logging.getLogger(__name__)


def run_builder(args: BuildArgs):
from ClayCode.builder import Builder
def run():
args = parser.parse_args(sys.argv[1:])
# logger.setLevel(args.DEBUG)
args_factory = ArgsFactory()
args = args_factory.init_subclass(args)
# file_handler = logging.FileHandler(filename=args.)
# logger.addHandler(file_handler)
if isinstance(args, SiminpArgs):
args.write_runs()
if isinstance(args, DataArgs):
uc_writer = UCWriter(args.ingro, args.uc_type, args.outpath)
uc_writer.write_new_uc(args.uc_name)
elif isinstance(args, BuildArgs):
from ClayCode.builder import Builder

extra_il_space = {True: 1.5, False: 1}
clay_builder = Builder(args)
clay_builder.get_solvated_il()
# clay_builder.write_sheet_crds(backup=clay_builder.args.backup)
# clay_builder.solvate_il = lambda: clay_builder.construct_solvent(
# solvate=args.il_solv,
# ion_charge=args.match_charge["tot"],
# solvate_add_func=clay_builder.solvate_clay_sheets,
# ion_add_func=clay_builder.add_il_ions,
# solvent_remove_func=clay_builder.remove_il_solv,
# solvent_rename_func=clay_builder.rename_il_solv,
# backup=clay_builder.args.backup,
# )
logger.finfo(f"Wrote interlayer sheet to {clay_builder.il_solv.name!r}")
completed = False
while completed is False:
extra_il_space = {True: 1.5, False: 1}
clay_builder = Builder(args)
clay_builder.write_sheet_crds(backup=clay_builder.args.backup)
clay_builder.construct_solvent(
solvate=args.il_solv,
ion_charge=args.match_charge["tot"],
solvate_add_func=clay_builder.solvate_clay_sheets,
ion_add_func=clay_builder.add_il_ions,
solvent_remove_func=clay_builder.remove_il_solv,
solvent_rename_func=clay_builder.rename_il_solv,
backup=clay_builder.args.backup,
)
logger.finfo(
f"Wrote interlayer sheet to {clay_builder.il_solv.name!r}"
)
clay_builder.stack_sheets(
extra=extra_il_space[args.il_solv], backup=clay_builder.args.backup
)
clay_builder.extend_box(backup=clay_builder.args.backup)
if clay_builder.extended_box:
clay_builder.construct_solvent(
solvate=args.bulk_solv,
ion_charge=args.bulk_ion_conc,
solvate_add_func=clay_builder.solvate_box,
ion_add_func=clay_builder.add_bulk_ions,
solvent_remove_func=clay_builder.remove_SOL,
backup=clay_builder.args.backup,
)
completed = clay_builder.run_em(backup=clay_builder.args.backup)
if completed is None:
if clay_builder.extended_box and (
args.bulk_solv or args.bulk_ion_conc != 0.0
):
completed = select_input_option(
instance_or_manual_setup=True,
query="Repeat bulk setup? [y]es/[n]o\n",
options=["y", "n"],
result=None,
result_map={"y": False, "n": None},
completed = False
while completed is False:
if clay_builder.extended_box:
clay_builder.construct_solvent(
solvate=args.bulk_solv,
ion_charge=args.bulk_ion_conc,
solvate_add_func=clay_builder.solvate_box,
ion_add_func=clay_builder.add_bulk_ions,
solvent_remove_func=clay_builder.remove_SOL,
backup=clay_builder.args.backup,
)
# if repeat == "y":
# completed = False
# logger.finfo(get_subheader("Repeating solvation"))
if completed is False:
logger.finfo("Repeating bulk setup.\n", initial_linebreak=True)
completed = clay_builder.run_em(backup=clay_builder.args.backup)
if completed is None:
if clay_builder.extended_box and (
args.bulk_solv or args.bulk_ion_conc != 0.0
):
completed = select_input_option(
instance_or_manual_setup=True,
query="Repeat bulk setup? [y]es/[n]o\n",
options=["y", "n"],
result=None,
result_map={"y": False, "n": None},
)
# if repeat == "y":
# completed = False
# logger.finfo(get_subheader("Repeating solvation"))
if completed is False:
logger.finfo(
"Repeating bulk setup.\n", initial_linebreak=True
)
else:
logger.finfo(
"Finishing setup without energy minimisation.\n",
initial_linebreak=True,
)
else:
logger.finfo(
"Finishing setup without energy minimisation.\n",
completed,
initial_linebreak=True,
fix_sentence_endings=False,
expand_tabs=False,
replace_whitespace=False,
)
else:
logger.finfo(
completed,
initial_linebreak=True,
fix_sentence_endings=False,
expand_tabs=False,
replace_whitespace=False,
)
logger.debug("\nFinished setup!")
clay_builder.conclude()
if isinstance(args, SiminpArgs):
print("siminp")
return 0


def run():
"""Run ClayCode."""
args = parser.parse_args(sys.argv[1:])
args_factory = ArgsFactory()
args = args_factory.init_subclass(args)
if isinstance(args, SiminpArgs):
args.write_runs()
if isinstance(args, DataArgs):
uc_writer = UCWriter(
args.ingro,
args.uc_type,
args.outpath,
default_solv=args.default_solv,
substitutions=args.substitutions,
)
uc_writer.write_new_uc(args.uc_name)
uc_writer.add_single_substitutions()
uc_writer.add_double_substitutions()
uc_writer.add_triple_substitutions()
elif isinstance(args, BuildArgs):
run_builder(args)
logger.debug("\nFinished setup!")
clay_builder.conclude()
if isinstance(args, SiminpArgs):
print("siminp")
return 0


Expand Down
Empty file.
Empty file.
Empty file.
14 changes: 0 additions & 14 deletions package/ClayCode/addmols/consts.py

This file was deleted.

Empty file.
Empty file removed package/ClayCode/addmols/lib.py
Empty file.
Loading