From f15a34d0f2541dfc562f599aabe563f981127758 Mon Sep 17 00:00:00 2001 From: Ingmar Schoegl Date: Tue, 5 Sep 2023 09:51:21 -0500 Subject: [PATCH] [Python] Fix default arguments for Solution.write_chemkin Also, add quiet option to suppress output --- interfaces/cython/cantera/solutionbase.pyx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/interfaces/cython/cantera/solutionbase.pyx b/interfaces/cython/cantera/solutionbase.pyx index 1e55bdb13..c252cdf3f 100644 --- a/interfaces/cython/cantera/solutionbase.pyx +++ b/interfaces/cython/cantera/solutionbase.pyx @@ -334,7 +334,8 @@ cdef class _SolutionBase: Y.to_file(str(filename)) def write_chemkin(self, mechanism_path=None, thermo_path=None, transport_path=None, - sort_species=False, sort_elements=False, overwrite=False): + sort_species=None, sort_elements=None, overwrite=False, + quiet=False): """ Write this `~cantera.Solution` instance to one or more Chemkin-format files. See the documentation for `cantera.yaml2ck.convert` for information about the @@ -351,7 +352,8 @@ cdef class _SolutionBase: sort_elements=sort_elements, overwrite=overwrite, ) - print(f"Wrote: {output_paths}") + if not quiet: + print(f"Wrote: {output_paths}") def __getitem__(self, selection): copy = self.__class__(origin=self)