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

Modern arguments #1216

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
142 changes: 71 additions & 71 deletions src/dr/app/beast/BeastMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -355,80 +355,80 @@ public static void main(String[] args) throws java.io.IOException {
Arguments arguments = new Arguments(
new Arguments.Option[]{

new Arguments.Option("verbose", "Give verbose XML parsing messages"),
new Arguments.Option("warnings", "Show warning messages about BEAST XML file"),
new Arguments.Option("strict", "Fail on non-conforming BEAST XML file"),
new Arguments.Option("window", "Provide a console window"),
new Arguments.Option("options", "Display an options dialog"),
new Arguments.Option("working", "Change working directory to input file's directory"),
new Arguments.LongOption("seed", "Specify a random number generator seed"),
new Arguments.StringOption("prefix", "PREFIX", "Specify a prefix for all output log filenames"),
new Arguments.Option("overwrite", "Allow overwriting of log files"),
new Arguments.IntegerOption("errors", "Specify maximum number of numerical errors before stopping"),
new Arguments.IntegerOption("threads", "The maximum number of computational threads to use (default auto)"),
new Arguments.Option("fail_threads", "Exit with error on uncaught exception in thread"),
new Arguments.Option("ignore_versions", "Ignore mismatches between XML and BEAST versions"),
new Arguments.Option("java", "Use Java only, no native implementations"),
new Arguments.LongOption("tests", "The number of full evaluation tests to perform (default 1000)"),
new Arguments.RealOption("threshold", 0.0, Double.MAX_VALUE, "Full evaluation test threshold (default 0.1)"),
new Arguments.Option(OperatorSchedule.SHOW_OPERATORS, "Print transition kernel performance to file"),

new Arguments.Option("adaptation_off", "Don't adapt operator sizes"),
new Arguments.RealOption("adaptation_target", 0.0, 1.0, "Target acceptance rate for adaptive operators (default 0.234)"),

new Arguments.StringOption("pattern_compression", new String[]{"off", "unique", "ambiguous_constant", "ambiguous_all"},
new Arguments.Option("verbose","vb","Give verbose XML parsing messages"),
new Arguments.Option("warnings", null, "Show warning messages about BEAST XML file"),
new Arguments.Option("strict", "s", "Fail on non-conforming BEAST XML file"),
new Arguments.Option("window", "w", "Provide a console window"),
new Arguments.Option("options", "o", "Display an options dialog"),
new Arguments.Option("working", "wd", "Change working directory to input file's directory"),
new Arguments.LongOption("seed", "s", "Specify a random number generator seed"),
new Arguments.StringOption("prefix","p", "PREFIX", "Specify a prefix for all output log filenames"),
new Arguments.Option("overwrite", "ow", "Allow overwriting of log files"),
new Arguments.IntegerOption("errors", "e", "Specify maximum number of numerical errors before stopping"),
new Arguments.IntegerOption("threads", "nt", "The maximum number of computational threads to use (default auto)"),
new Arguments.Option("fail_threads", "ft", "Exit with error on uncaught exception in thread"),
new Arguments.Option("ignore_versions", "i", "Ignore mismatches between XML and BEAST versions"),
new Arguments.Option("java", null, "Use Java only, no native implementations"),
new Arguments.LongOption("tests", null, "The number of full evaluation tests to perform (default 1000)"),
new Arguments.RealOption("threshold", null, 0.0, Double.MAX_VALUE, "Full evaluation test threshold (default 0.1)"),
new Arguments.Option(OperatorSchedule.SHOW_OPERATORS, "op", "Print transition kernel performance to file"),

new Arguments.Option("adaptation_off", null, "Don't adapt operator sizes"),
new Arguments.RealOption("adaptation_target", null, 0.0, 1.0, "Target acceptance rate for adaptive operators (default 0.234)"),

new Arguments.StringOption("pattern_compression", "pc", new String[]{"off", "unique", "ambiguous_constant", "ambiguous_all"},
false, "Site pattern compression mode - unique | ambiguous_constant | ambiguous_all (default unique)"),
new Arguments.RealOption("ambiguous_threshold", 0.0, 1.0, "Maximum proportion of ambiguous characters to allow compression (default 0.25)"),

new Arguments.Option("beagle", "Use BEAGLE library if available (default on)"),
new Arguments.Option("beagle_info", "BEAGLE: show information on available resources"),
new Arguments.Option("beagle_auto", "BEAGLE: automatically select fastest resource for analysis"),
new Arguments.StringOption("beagle_order", "order", "BEAGLE: set order of resource use"),
new Arguments.IntegerOption("beagle_instances", "BEAGLE: divide site patterns amongst instances"),
new Arguments.StringOption("beagle_multipartition", new String[]{"auto", "on", "off"},
new Arguments.RealOption("ambiguous_threshold", "at", 0.0, 1.0, "Maximum proportion of ambiguous characters to allow compression (default 0.25)"),

new Arguments.Option("beagle", "b", "Use BEAGLE library if available (default on)"),
new Arguments.Option("beagle_info", "bi", "BEAGLE: show information on available resources"),
new Arguments.Option("beagle_auto", "ba", "BEAGLE: automatically select fastest resource for analysis"),
new Arguments.StringOption("beagle_order", "bo", "order", "BEAGLE: set order of resource use"),
new Arguments.IntegerOption("beagle_instances", "bi", "BEAGLE: divide site patterns amongst instances"),
new Arguments.StringOption("beagle_multipartition", "bm", new String[]{"auto", "on", "off"},
false, "BEAGLE: use multipartition extensions if available (default auto)"),
new Arguments.Option("beagle_CPU", "BEAGLE: use CPU instance"),
new Arguments.Option("beagle_GPU", "BEAGLE: use GPU instance if available"),
new Arguments.Option("beagle_SSE", "BEAGLE: use SSE extensions if available"),
new Arguments.Option("beagle_SSE_off", "BEAGLE: turn off use of SSE extensions"),
new Arguments.Option("beagle_threading_off", "BEAGLE: turn off multi-threading for a CPU instance"),
new Arguments.IntegerOption("beagle_threads", 0, Integer.MAX_VALUE, "BEAGLE: manually set number of threads per CPU instance (default auto)"),
new Arguments.Option("beagle_cuda", "BEAGLE: use CUDA parallization if available"),
new Arguments.Option("beagle_opencl", "BEAGLE: use OpenCL parallization if available"),
new Arguments.Option("beagle_single", "BEAGLE: use single precision if available"),
new Arguments.Option("beagle_double", "BEAGLE: use double precision if available"),
new Arguments.Option("beagle_async", "BEAGLE: use asynchronous kernels if available"),
new Arguments.Option("beagle_low_memory", "BEAGLE: use lower memory pre-order traversal kernels"),
new Arguments.StringOption("beagle_extra_buffer_count", "buffer_count", "BEAGLE: reserve extra transition matrix buffers for convolutions"),
new Arguments.StringOption("beagle_scaling", new String[]{"default", "dynamic", "delayed", "always", "none"},
new Arguments.Option("beagle_CPU", "bc", "BEAGLE: use CPU instance"),
new Arguments.Option("beagle_GPU", "bg", "BEAGLE: use GPU instance if available"),
new Arguments.Option("beagle_SSE", null, "BEAGLE: use SSE extensions if available"),
new Arguments.Option("beagle_SSE_off", null, "BEAGLE: turn off use of SSE extensions"),
new Arguments.Option("beagle_threading_off", null, "BEAGLE: turn off multi-threading for a CPU instance"),
new Arguments.IntegerOption("beagle_threads", "bt", 0, Integer.MAX_VALUE, "BEAGLE: manually set number of threads per CPU instance (default auto)"),
new Arguments.Option("beagle_cuda", null, "BEAGLE: use CUDA parallization if available"),
new Arguments.Option("beagle_opencl", null, "BEAGLE: use OpenCL parallization if available"),
new Arguments.Option("beagle_single", null, "BEAGLE: use single precision if available"),
new Arguments.Option("beagle_double", null, "BEAGLE: use double precision if available"),
new Arguments.Option("beagle_async", null, "BEAGLE: use asynchronous kernels if available"),
new Arguments.Option("beagle_low_memory", null, "BEAGLE: use lower memory pre-order traversal kernels"),
new Arguments.StringOption("beagle_extra_buffer_count", null, "buffer_count", "BEAGLE: reserve extra transition matrix buffers for convolutions"),
new Arguments.StringOption("beagle_scaling", "bs", new String[]{"default", "dynamic", "delayed", "always", "none"},
false, "BEAGLE: specify scaling scheme to use"),
new Arguments.Option("beagle_delay_scaling_off", "BEAGLE: don't wait until underflow for scaling option"),
new Arguments.LongOption("beagle_rescale", "BEAGLE: frequency of rescaling (dynamic scaling only)"),
new Arguments.Option("mpi", "Use MPI rank to label output"),

new Arguments.StringOption("particles", "FOLDER", "Specify a folder of particle start states"),

new Arguments.IntegerOption("mc3_chains", 1, Integer.MAX_VALUE, "number of chains"),
new Arguments.RealOption("mc3_delta", 0.0, Double.MAX_VALUE, "temperature increment parameter"),
new Arguments.RealArrayOption("mc3_temperatures", -1, "a comma-separated list of the hot chain temperatures"),
new Arguments.IntegerOption("mc3_swap", 1, Integer.MAX_VALUE, "frequency at which chains temperatures will be swapped"),
new Arguments.StringOption("mc3_scheme", "NAME", "Specify parallel tempering swap scheme"),

new Arguments.StringOption("load_state", "FILENAME", "Specify a filename to load a saved state from"),
new Arguments.StringOption("save_stem", "FILENAME", "Specify a stem for the filenames to save states to"),
new Arguments.LongOption("save_at", "Specify a state at which to save a state file"),
new Arguments.StringOption("save_time", "HH:mm:ss", "Specify a length of time after which to save a state file"),
new Arguments.LongOption("save_every", "Specify a frequency to save the state file"),
new Arguments.StringOption("save_state", "FILENAME", "Specify a filename to save state to"),
new Arguments.Option("full_checkpoint_precision", "Use hex-encoded doubles in checkpoint files"),
new Arguments.Option("force_resume", "Force resuming from a saved state"),

new Arguments.StringOption("citations_file", "FILENAME", "Specify a filename to write a citation list to"),
new Arguments.Option("citations_off", "Turn off writing citations to file"),
new Arguments.StringOption("plugins_dir", "FILENAME", "Specify a directory to load plugins from, multiple can be separated with ':' "),

new Arguments.Option("version", "Print the version and credits and stop"),
new Arguments.Option("help", "Print this information and stop"),
new Arguments.Option("beagle_delay_scaling_off", null, "BEAGLE: don't wait until underflow for scaling option"),
new Arguments.LongOption("beagle_rescale", null, "BEAGLE: frequency of rescaling (dynamic scaling only)"),
new Arguments.Option("mpi", null, "Use MPI rank to label output"),

new Arguments.StringOption("particles", null, "FOLDER", "Specify a folder of particle start states"),

new Arguments.IntegerOption("mc3_chains", null, 1, Integer.MAX_VALUE, "number of chains"),
new Arguments.RealOption("mc3_delta", null, 0.0, Double.MAX_VALUE, "temperature increment parameter"),
new Arguments.RealArrayOption("mc3_temperatures", null, -1, "a comma-separated list of the hot chain temperatures"),
new Arguments.IntegerOption("mc3_swap", null, 1, Integer.MAX_VALUE, "frequency at which chains temperatures will be swapped"),
new Arguments.StringOption("mc3_scheme", null, "NAME", "Specify parallel tempering swap scheme"),

new Arguments.StringOption("load_state", null, "FILENAME", "Specify a filename to load a saved state from"),
new Arguments.StringOption("save_stem", null, "FILENAME", "Specify a stem for the filenames to save states to"),
new Arguments.LongOption("save_at", null, "Specify a state at which to save a state file"),
new Arguments.StringOption("save_time", null, "HH:mm:ss", "Specify a length of time after which to save a state file"),
new Arguments.LongOption("save_every", null, "Specify a frequency to save the state file"),
new Arguments.StringOption("save_state", null, "FILENAME", "Specify a filename to save state to"),
new Arguments.Option("full_checkpoint_precision", null, "Use hex-encoded doubles in checkpoint files"),
new Arguments.Option("force_resume", null, "Force resuming from a saved state"),

new Arguments.StringOption("citations_file", null, "FILENAME", "Specify a filename to write a citation list to"),
new Arguments.Option("citations_off", null, "Turn off writing citations to file"),
new Arguments.StringOption("plugins_dir",null, "FILENAME", "Specify a directory to load plugins from, multiple can be separated with ':' "),

new Arguments.Option("version", "v", "Print the version and credits and stop"),
new Arguments.Option("help", "h", "Print this information and stop"),
});

int argumentCount = 0;
Expand Down
12 changes: 6 additions & 6 deletions src/dr/app/beast/BeastRemote.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ public static void main(String[] oldArgs) throws java.io.IOException {

Arguments arguments = new Arguments(
new Arguments.Option[]{
new Arguments.Option("verbose", "verbose XML parsing messages"),
new Arguments.Option("warnings", "Show warning messages about BEAST XML file"),
new Arguments.Option("window", "provide a console window"),
new Arguments.Option("working", "change working directory to input file's directory"),
new Arguments.LongOption("seed", "specify a random number generator seed"),
new Arguments.Option("help", "option to print this message")
new Arguments.Option("verbose", "vb", "verbose XML parsing messages"),
new Arguments.Option("warnings", null, "Show warning messages about BEAST XML file"),
new Arguments.Option("window", "w", "provide a console window"),
new Arguments.Option("working", "wd", "change working directory to input file's directory"),
new Arguments.LongOption("seed", null, "specify a random number generator seed"),
new Arguments.Option("help", "h", "option to print this message")
});

try {
Expand Down
20 changes: 10 additions & 10 deletions src/dr/app/beastgen/BEASTGen.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,16 @@ public static void main(String[] args) {

Arguments arguments = new Arguments(
new Arguments.Option[]{
new Arguments.IntegerOption("date_order", "The order of the date field (negative numbers from last)"),
new Arguments.StringOption("date_prefix", "prefix", "A string that is the prefix to the date field"),
new Arguments.StringOption("date_regex", "regex", "A string that gives the regular expression to match the date"),
new Arguments.StringOption("date_format", "format", "A string that gives the date format for parsing"),
new Arguments.Option("date_precision", "Specifies the date is a variable precision yyyy-MM-dd format"),
new Arguments.StringOption("tree", "tree-file-name", "Read a tree from a file"),
new Arguments.StringOption("traits", "trait-file-name", "Assign traits to each taxon from a tsv file with headers."),
new Arguments.StringOption("D", "\"key=value,key=value...\"", "Properties for exchange in templates"),
new Arguments.Option("version", "Print the version and credits and stop"),
new Arguments.Option("help", "Print this information and stop"),
new Arguments.IntegerOption("date_order", "do", "The order of the date field (negative numbers from last)"),
new Arguments.StringOption("date_prefix", "dp", "prefix", "A string that is the prefix to the date field"),
new Arguments.StringOption("date_regex", "dr", "regex", "A string that gives the regular expression to match the date"),
new Arguments.StringOption("date_format", "f", "format", "A string that gives the date format for parsing"),
new Arguments.Option("date_precision", "p", "Specifies the date is a variable precision yyyy-MM-dd format"),
new Arguments.StringOption("tree", "tf", "tree-file-name", "Read a tree from a file"),
new Arguments.StringOption("traits", "t", "trait-file-name", "Assign traits to each taxon from a tsv file with headers."),
new Arguments.StringOption("D", "D","\"key=value,key=value...\"", "Properties for exchange in templates"),
new Arguments.Option("version", "v", "Print the version and credits and stop"),
new Arguments.Option("help", "h", "Print this information and stop"),
});


Expand Down
Loading
Loading