def main(): usage = "%prog <name>" description = "Delete a tonal space analysis set" parser = OptionParser(usage=usage, description=description) options, arguments = parser.parse_args() name = arguments[0] tsset = TonalSpaceAnalysisSet.load(name) tsset.delete()
def run(self, args, state): from jazzparser.data.tonalspace import TonalSpaceAnalysisSet if len(args) != 1: raise ShellError, "Please give the name of a tonal space analysis "\ "set. Available sets are: %s" % \ ", ".join(TonalSpaceAnalysisSet.list()) try: # Try loading the named set songset = TonalSpaceAnalysisSet.load(args[0]) except Exception, err: raise ShellError, "Error loading tonal space analysis set: %s" % \ err
moptstr = ":".join(moptstr) else: moptstr = "" mopts = ModuleOption.process_option_string(moptstr) # Instantiate the metric with these options metric = metric_cls(options=mopts) if len(arguments) < 2: print >>sys.stderr, "Specify a song corpus name and one or more files to read results from" sys.exit(1) # First argument is an TonalSpaceAnalysisSet corpus_name = arguments[0] # Load the corpus file corpus = TonalSpaceAnalysisSet.load(corpus_name) # The rest of the args are result files to analyze res_files = arguments[1:] # Work out how many results to print out if options.print_results == -1: print_up_to = None else: print_up_to = options.print_results ranks = [] num_ranked = 0 for filename in res_files: # Load the parse results pres = ParseResults.from_file(filename)
sys.exit(0) moptstr = ":".join(moptstr) else: moptstr = "" mopts = ModuleOption.process_option_string(moptstr) # Instantiate the metric with these options metric = metric_cls(options=mopts) if len(arguments) < 2: print >> sys.stderr, "Specify a song corpus name and one or more files to read results from" sys.exit(1) # First argument is an TonalSpaceAnalysisSet corpus_name = arguments[0] # Load the corpus file corpus = TonalSpaceAnalysisSet.load(corpus_name) # The rest of the args are result files to analyze res_files = arguments[1:] # Work out how many results to print out if options.print_results == -1: print_up_to = None else: print_up_to = options.print_results ranks = [] num_ranked = 0 for filename in res_files: # Load the parse results pres = ParseResults.from_file(filename)