From f05e2baeefd645727211f66a27fba7e9d324dab8 Mon Sep 17 00:00:00 2001 From: Mark Driver <mdd31@alumni.cam.ac.uk> Date: Tue, 16 Jun 2020 19:14:58 +0100 Subject: [PATCH] update CLI to allow option of polarised or unpolarised solvent descriptions. --- phasecalculator/phasecalculatorcli.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/phasecalculator/phasecalculatorcli.py b/phasecalculator/phasecalculatorcli.py index 59921aa..259a0f8 100755 --- a/phasecalculator/phasecalculatorcli.py +++ b/phasecalculator/phasecalculatorcli.py @@ -135,7 +135,7 @@ def create_system_collection(args): SystemCollection. """ - phases = read_phasecsv(args.phases) + phases = read_phasecsv(args.phases, args.unpolarised_ssips) jar_path = args.jar scratch_dir = args.scratch output_dir = args.out_dir @@ -216,13 +216,15 @@ def read_calculator_xml(xml_filename): return sysproc.read_system_collection_file(xml_filename) -def read_phasecsv(csv_filename): +def read_phasecsv(csv_filename, unpolarised_ssips): """Read CSV file containing phase infomration and create Phases object. Parameters ---------- csv_filename : str phase information CSV file. + unpolarised_ssips : boolean + True if unpolarised SSIP descriptions are to be used. Returns ------- @@ -230,7 +232,7 @@ def read_phasecsv(csv_filename): Phases representation of information. """ - return csvconv.convert_csv_file_to_phases(csv_filename) + return csvconv.convert_csv_file_to_phases(csv_filename, unpolarised_ssips) def run_system_collection(system_collection, **kwargs): @@ -372,7 +374,12 @@ Where systemcollection.xml was generated with inpgen. For large phase sets you n "--filename", type=str, default="systemcollection.xml", help="filename for XML file.", ) - inpgen_argparser.set_defaults(func=process_inputgen) + ssip_desc = inpgen_argparser.add_mutually_exclusive_group(required=False) + ssip_desc.add_argument("--polarised", action="store_false", dest="unpolarised_ssips", + help="Use unpolarised SSIP descriptions in calculations") + ssip_desc.add_argument("--unpolarised", action="store_true", dest="unpolarised_ssips", + help="Use polarised SSIP descriptions in calculations") + inpgen_argparser.set_defaults(func=process_inputgen, unpolarised_ssips=False) solvname_description = """Display acceptable solvent molecule names for inclusion in a phases csv file.""" solvnames_epilog = "Solvent molecule names:\n" + get_acceptable_solvent_names() + "\n" solvent_nameparser = subparsers.add_parser( -- GitLab