diff --git a/overreact/_cli.py b/overreact/_cli.py index 4c9ba55e..1deea55c 100644 --- a/overreact/_cli.py +++ b/overreact/_cli.py @@ -738,7 +738,7 @@ def main(arguments=None): ) parser.add_argument( "path", - help="path to a source (`.k`) or compiled (.jk) model input file (if a source " + help="path to a source (`.k`) or compiled (`.jk`) model input file (if a source " "input file is given, but there is a compiled file available, the compiled " "file will be used; use --compile|-c to force recompilation of the " "source input file instead)", @@ -766,7 +766,7 @@ def main(arguments=None): "--compile", # TODO(schneiderfelipe): should we consider --compile|-c always as a # do-nothing (no analysis)? - help="force recompile a source (`.k`) into a compiled (.jk) model input file", + help="force recompile a source (`.k`) into a compiled (`.jk`) model input file", action="store_true", ) parser.add_argument( diff --git a/overreact/io.py b/overreact/io.py index ec4fc26d..11bd1843 100644 --- a/overreact/io.py +++ b/overreact/io.py @@ -47,7 +47,7 @@ def parse_model(path: Text, force_compile: bool = False): ---------- path : str Path to the model or source input file. - If the final extension is not ``.jk`` or ``.k``, it is guessed. + If the final extension is not `.jk` or `.k`, it is guessed. force_compile : bool If True, a `.k` file will take precedence over any `.jk` file for reading. A `.jk` file is thus either generated or overwritten. This is sometimes @@ -96,22 +96,22 @@ def parse_model(path: Text, force_compile: bool = False): """ if not path.endswith((".k", ".jk")): path = path + ".jk" - logger.warning(f"assuming .jk file in {path}") + logger.warning(f"assuming `.jk` file in {path}") name, _ = os.path.splitext(path) path_jk = name + ".jk" if not force_compile and os.path.isfile(path_jk): - logger.info(f"parsing .jk file in {path_jk}") + logger.info(f"parsing `.jk` file in {path_jk}") return _parse_model(path_jk) path_k = name + ".k" - logger.info(f"parsing .k file in {path_k}") + logger.info(f"parsing `.k` file in {path_k}") if not os.path.isfile(path_k): - raise FileNotFoundError(f"no .k file found in {path_k}") + raise FileNotFoundError(f"no `.k` file found in {path_k}") model = _parse_source(path_k) with open(path_jk, "w") as f: - logger.info(f"writing .jk file in {path_jk}") + logger.info(f"writing `.jk` file in {path_jk}") f.write(_unparse_model(model)) return model diff --git a/tests/test_cli.py b/tests/test_cli.py index f0ecc7dd..66669cd4 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -6,21 +6,21 @@ def test_cli_compiles_source_file(monkeypatch): - """Ensure the command-line interface can compile a source file (.k).""" + """Ensure the command-line interface can compile a source file (`.k`).""" params = ["overreact", "--compile", "data/ethane/B97-3c/model.k"] monkeypatch.setattr("sys.argv", params) cli.main() def test_cli_describes_source_file(monkeypatch): - """Ensure the command-line interface can describe a source file (.k).""" + """Ensure the command-line interface can describe a source file (`.k`).""" params = ["overreact", "data/ethane/B97-3c/model.k"] monkeypatch.setattr("sys.argv", params) cli.main() def test_cli_describes_model_file(monkeypatch): - """Ensure the command-line interface can describe a model file (.jk).""" + """Ensure the command-line interface can describe a model file (`.jk`).""" params = ["overreact", "data/ethane/B97-3c/model.jk"] monkeypatch.setattr("sys.argv", params) cli.main()