From daf33ced67f295287184b211f6ab95070c6ca42f Mon Sep 17 00:00:00 2001 From: Troy Smith Date: Sat, 2 May 2026 13:56:48 -0400 Subject: [PATCH 1/2] Fixed ORCA encoder adding "None" when not providing basis set Added test to check "None" is not entered into input file through ORCA encoder. --- src/qccodec/encoders/orca.py | 7 ++++++- tests/test_orca_encoders.py | 11 +++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/qccodec/encoders/orca.py b/src/qccodec/encoders/orca.py index 10c8aaf..b0eeded 100644 --- a/src/qccodec/encoders/orca.py +++ b/src/qccodec/encoders/orca.py @@ -96,7 +96,12 @@ def encode(program_input: ProgramInput) -> NativeInput: inp_lines.append("") # Method and Basis - inp_lines.append(f"! {program_input.model.method} {program_input.model.basis}") + model_line = f"! {program_input.model.method}" + # ORCA will not recognize 'None' when using composite methods + if program_input.model.basis: + model_line += f" {program_input.model.basis}" + + inp_lines.append(model_line) # NumGrad. May be used for gradients or optimizations if "numgrad" in kw_lower: diff --git a/tests/test_orca_encoders.py b/tests/test_orca_encoders.py index 8f6a0a3..2cf71ec 100644 --- a/tests/test_orca_encoders.py +++ b/tests/test_orca_encoders.py @@ -81,6 +81,17 @@ def test_write_input_files( ) +def test_no_none_fields(): + """Tests 'None' not in input file when basis not provided.""" + program_input = ProgramInput( + calctype=CalcType.optimization, model=Model(method="xTB"), structure=water + ) + native_input = encode(program_input) + input_file = native_input.input_file + + assert "None" not in input_file, f"'None' found in\n{input_file}" + + def test_validate_keywords_raises_error_if_coords_block_in_keywords(): """The 'coords' block should not be set directly as a keyword.""" From 00e753ee5dbce9073f06309ca0df123e1e4dfd13 Mon Sep 17 00:00:00 2001 From: Colton Hicks Date: Sat, 2 May 2026 14:41:29 -0700 Subject: [PATCH 2/2] Added CHANGELOG entry --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a7c2f1..3cd2467 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [unreleased] +### Fixed + +- ORCA encoder no longer writes `None` if no basis (e.g., when no basis is needed for an XTB calculation). [#42](https://github.com/coltonbh/qccodec/pull/42) by [TroyNSmith](https://github.com/TroyNSmith) + ## [0.10.0] - 2026-03-26 ### Changed