-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New crystalform and assemblies documentation
- Loading branch information
1 parent
dc3636b
commit 33962a7
Showing
3 changed files
with
52 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import argparse | ||
|
||
from xchemalign import utils | ||
from xchemalign.collator import Collator | ||
|
||
|
||
def main(): | ||
parser = argparse.ArgumentParser(description="collator") | ||
|
||
parser.add_argument("-c", "--config-file", default="config.yaml", help="Configuration file") | ||
parser.add_argument("-l", "--log-file", help="File to write logs to") | ||
parser.add_argument("--log-level", type=int, default=0, help="Logging level") | ||
parser.add_argument("-v", "--validate", action="store_true", help="Only perform validation") | ||
|
||
args = parser.parse_args() | ||
logger = utils.Logger(logfile=args.log_file, level=args.log_level) | ||
logger.info("collator: ", args) | ||
|
||
c = Collator(args.config_file, logger=logger) | ||
|
||
meta, num_errors, num_warnings = c.validate() | ||
|
||
if not args.validate: | ||
if meta is None or num_errors: | ||
print("There are errors, cannot continue") | ||
exit(1) | ||
else: | ||
c.run(meta) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters