Skip to content

Commit

Permalink
fix #352 process command can set ACE executable
Browse files Browse the repository at this point in the history
  • Loading branch information
goodmami committed Oct 7, 2022
1 parent 3b1a1dd commit 91b5496
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@ and `delphin.codecs.dmrstikz` directly instead of as separate plugins.
necessary to install this as a plugin ([#344])
* `delphin.codecs.dmrstikz` for exporting DMRS with tikz-dependency;
it is no longer necessary to install this as a plugin ([#344])
* `executable` parameter to `delphin.commands.process()` ([#352])
* `--executable` option to `delphin process` command ([#352])

### Fixed

* The `mkprof` command no longer raises an error on an empty sentence ([#335])
* EDS conversion in `delphin.edm` now more robustly handles errors


## [v1.6.0]
Expand Down Expand Up @@ -1549,3 +1552,4 @@ information about changes, except for
[#335]: https://github.com/delph-in/pydelphin/issues/335
[#343]: https://github.com/delph-in/pydelphin/issues/343
[#344]: https://github.com/delph-in/pydelphin/issues/344
[#352]: https://github.com/delph-in/pydelphin/issues/352
6 changes: 5 additions & 1 deletion delphin/cli/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ def call_process(args):
options=shlex.split(args.options),
all_items=args.all_items,
result_id=args.p,
gzip=args.gzip)
gzip=args.gzip,
executable=args.executable)


# process subparser
Expand Down Expand Up @@ -92,3 +93,6 @@ def call_process(args):
)
parser.add_argument(
'-z', '--gzip', action='store_true', help='compress table files with gzip')
parser.add_argument(
'--executable', metavar='PATH', default='ace',
help='path to ACE executable (default: ace)')
9 changes: 6 additions & 3 deletions delphin/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ def _red(s):
def process(grammar, testsuite, source=None, select=None,
generate=False, transfer=False, full_forest=False,
options=None, all_items=False, result_id=None, gzip=False,
stderr=None, report_progress=True):
executable='ace', stderr=None, report_progress=True):
"""
Process the [incr tsdb()] profile *testsuite* with *grammar*.
Expand Down Expand Up @@ -586,6 +586,7 @@ def process(grammar, testsuite, source=None, select=None,
specified ``result-id`` (transfer and generation)
gzip (bool): if `True`, non-empty tables will be compressed
with gzip
executable (str): path to the ACE executable (default: ace)
stderr (file): stream for ACE's stderr
report_progress (bool): print a progress bar to stderr if
`True` and logging verbosity is at WARNING or lower;
Expand All @@ -599,8 +600,10 @@ def process(grammar, testsuite, source=None, select=None,
if not grammar.is_file():
raise CommandError(f'{grammar} is not a file')

kwargs = {}
kwargs['stderr'] = stderr
kwargs = {
'stderr': stderr,
'executable': executable,
}
if sum(1 if mode else 0 for mode in (generate, transfer, full_forest)) > 1:
raise CommandError("'generate', 'transfer', and 'full-forest' "
"are mutually exclusive")
Expand Down

0 comments on commit 91b5496

Please sign in to comment.