Skip to content

Fixed ORCA encoder adding "None" when not providing basis set - #42

Merged
coltonbh merged 2 commits into
atomsforhumanity:masterfrom
TroyNSmith:master
May 2, 2026
Merged

Fixed ORCA encoder adding "None" when not providing basis set#42
coltonbh merged 2 commits into
atomsforhumanity:masterfrom
TroyNSmith:master

Conversation

@TroyNSmith

Copy link
Copy Markdown
Contributor

Added test to check "None" is not entered into input file through ORCA encoder.

@TroyNSmith
TroyNSmith marked this pull request as draft May 2, 2026 18:02
@TroyNSmith
TroyNSmith marked this pull request as ready for review May 2, 2026 18:04

@avcopan avcopan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small tweak and I think this is good to go (see my comment below).

Comment thread src/qccodec/encoders/orca.py Outdated
Comment on lines +99 to +102
inp_lines.append(f"! {program_input.model.method} {program_input.model.basis}")
inp_lines.append(f"! {program_input.model.method}")
# Methods like XTB do not use a basis and ORCA will not recognize 'None'
if program_input.model.basis:
inp_lines.append(f" {program_input.model.basis}")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TroyNSmith This will split the basis onto a separate line without "!", which I don't think will work. Instead, we should probably do something like:

model_line = f"! {program_input.model.method}"
if program_input.model.basis:
    model_line += f" {program_input.model.basis}"
inp_lines.append(model_line)

@TroyNSmith TroyNSmith May 2, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@avcopan Ahh yes, good catch!

Added test to check "None" is not entered into input file through ORCA encoder.
@avcopan

avcopan commented May 2, 2026

Copy link
Copy Markdown
Contributor

@coltonbh From my perspective this is good to go.

Comment thread src/qccodec/encoders/orca.py

@coltonbh coltonbh left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

I'll add a CHANGELOG entry and release.

@coltonbh
coltonbh merged commit a2e3fa1 into atomsforhumanity:master May 2, 2026
9 checks passed
@coltonbh

coltonbh commented May 2, 2026

Copy link
Copy Markdown
Collaborator

Released to pypi as v0.10.1. Thank you @TroyNSmith and @avcopan!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants