Skip to content

ORCA parser & MolecularOrbitals as HDF5Dataset#182

Open
EBB2675 wants to merge 21 commits into
developfrom
minimal-orca-parser
Open

ORCA parser & MolecularOrbitals as HDF5Dataset#182
EBB2675 wants to merge 21 commits into
developfrom
minimal-orca-parser

Conversation

@EBB2675

@EBB2675 EBB2675 commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

Initialize the ORCA output parser and map representative ORCA electronic-structure calculations to the schema

Implemented

  • Parse program metadata

  • Parse ModelSystem

    • Atomic species and positions
    • Total charge and spin
  • Parse electronic-structure methods

    • DFT and exchange-correlation functionals
    • Hartree-Fock reference form
    • MP2 and local MP2
    • Coupled-cluster methods and perturbative triples
    • Local-correlation methods, spaces, and screening thresholds
    • Orbital localization
    • CASSCF and CASCI active-space methods
    • NEVPT2 multireference perturbation methods
    • State multiplicities, roots, and state weights
    • Scalar relativistic Hamiltonians, including DKH order
  • Parse basis sets

    • Orbital basis sets
    • SCF auxiliary basis sets
    • Post-HF auxiliary basis sets
    • Basis-set roles and numbers of basis functions
  • Parse MolecularOrbitals

    • Orbital energies and occupations
    • AO-to-MO coefficients
    • Numbers of atomic and molecular orbitals
  • Build representative outputs and workflows

    • Link molecular orbitals to the model system
    • Build serial local-correlation workflows

Testing

  • Added representative ORCA outputs covering:

    • DFT
    • RI-MP2
    • DLPNO-CCSD(T)
    • CASSCF
    • CASCI and QD-NEVPT2
    • Molecular-orbital coefficients
  • Added integration tests for:

    • Model systems
    • Electronic-structure methods
    • Basis sets
    • Relativistic treatments
    • Molecular orbitals

@coveralls

coveralls commented Jun 2, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 27400558775

Coverage increased (+1.3%) to 75.474%

Details

  • Coverage increased (+1.3%) from the base build.
  • Patch coverage: 44 uncovered changes across 2 files (681 of 725 lines covered, 93.93%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
src/nomad_simulation_parsers/parsers/orca/parser.py 461 419 90.89%
src/nomad_simulation_parsers/schema_packages/orca.py 97 95 97.94%
Total (7 files) 725 681 93.93%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 11070
Covered Lines: 8355
Line Coverage: 75.47%
Coverage Strength: 0.75 hits per line

💛 - Coveralls

Copilot AI 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.

Pull request overview

This PR adds an initial ORCA output parser integration to the NOMAD simulation parser plugin, including schema-package mappings, a text parser for ORCA .out files, and tests + test data to validate parsed model systems, methods (DFT/MP2/CC/CAS), and molecular orbitals (including HDF5-backed coefficients).

Changes:

  • Introduces a new ORCA parser (OrcaParser + OutReader/OutParser) capable of extracting key simulation, method, and molecular-orbital data.
  • Adds an ORCA schema package with mapping annotations and registers both parser + schema package as plugin entry points.
  • Adds ORCA test fixtures/data and new tests covering model systems, DFT settings, orbital energies/occupations, and MO coefficient handling.

Reviewed changes

Copilot reviewed 8 out of 15 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/parsers/test_orca_parser.py Adds unit tests for ORCA parsing, including HDF5-backed MO coefficients.
tests/data/orca/RI_MP2_water.out Adds ORCA MP2 output fixture used by parsing tests.
src/nomad_simulation_parsers/schema_packages/orca.py Introduces ORCA schema package mapping annotations (simulation, methods, outputs, molecular orbitals).
src/nomad_simulation_parsers/schema_packages/init.py Registers the ORCA schema package entry point.
src/nomad_simulation_parsers/parsers/orca/text_parser.py Adds the ORCA text extraction layer (quantities/regex blocks).
src/nomad_simulation_parsers/parsers/orca/parser.py Adds ORCA mapping parser + post-processing/enrichment for methods, basis sets, and molecular orbitals.
src/nomad_simulation_parsers/parsers/init.py Registers the ORCA parser entry point.
pyproject.toml Exposes the ORCA parser and schema package via plugin entry points.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/nomad_simulation_parsers/schema_packages/orca.py Outdated
Comment thread src/nomad_simulation_parsers/parsers/orca/text_parser.py Outdated
Comment thread src/nomad_simulation_parsers/parsers/orca/text_parser.py Outdated
@EBB2675 EBB2675 changed the title Minimal ORCA - MolecularOrbitals as HDF5Dataset ORCA parser & MolecularOrbitals as HDF5Dataset Jun 9, 2026
@EBB2675 EBB2675 requested review from ladinesa and ndaelman-hu June 9, 2026 16:09
def _token_list_to_mo_coefficients(tokens: list[str]) -> np.ndarray | None:
coefficients_by_mo: dict[int, list[float]] = {}
index = 0
while index < len(tokens):

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.

for loop?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

because the MO coefficient blocks have variable column and row counts. The next block start can only be determined after consuming the current block, so the loop needs to update the token index dynamically. I added a comment to make this explicit

Comment thread src/nomad_simulation_parsers/parsers/orca/parser.py Outdated
Comment thread src/nomad_simulation_parsers/parsers/orca/parser.py Outdated
Comment thread src/nomad_simulation_parsers/parsers/orca/parser.py Outdated
Comment thread src/nomad_simulation_parsers/parsers/orca/parser.py
Comment thread src/nomad_simulation_parsers/parsers/orca/parser.py Outdated
Comment thread src/nomad_simulation_parsers/parsers/orca/parser.py Outdated
Comment thread src/nomad_simulation_parsers/parsers/orca/parser.py Outdated
Comment thread src/nomad_simulation_parsers/parsers/orca/parser.py Outdated
Comment thread src/nomad_simulation_parsers/parsers/orca/parser.py Outdated
Comment thread src/nomad_simulation_parsers/parsers/orca/parser.py
Comment thread src/nomad_simulation_parsers/parsers/orca/parser.py Outdated
@ladinesa

Copy link
Copy Markdown
Collaborator

As promised, I put up some simplifications in #185

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.

4 participants