Skip to content

Fix naming inconsistencies across Computer, Code, and CalcJob APIs #7277

@GeigerJ2

Description

@GeigerJ2

During the systematic review of all runtime/scheduler options in #7272, several naming inconsistencies were identified across the Computer, Code, and CalcJob layers. These have grown organically over time and should be cleaned up for a consistent API.

What Mismatch Notes
withmpi / with_mpi CalcJob input spec and CodeInfo field use withmpi; Code property uses with_mpi Most impactful — user-facing input name
mpiprocs_per_machine / default_mpiprocs_per_machine Builder/CLI key drops the default_ prefix that the Computer API uses (get_default_mpiprocs_per_machine()) Silent mismatch, no deprecation note
input_plugin / default_calc_job_plugin DB attribute stored as input_plugin, public property is default_calc_job_plugin Has TODO at abstract.py:37 for v3.0
workdir / work_dir Computer API is get_workdir(), Builder/CLI key is work_dir Minor

withmpiwith_mpi specifically

This is the most user-facing inconsistency. Affected layers:

Layer Current Target
AbstractCode property with_mpi with_mpi (already correct)
CalcJob input spec metadata.options.withmpi metadata.options.with_mpi
CalcJob node attribute withmpi with_mpi
CodeInfo field withmpi with_mpi

Suggested migration pattern (applies to all of the above)

  1. >v2.8: Add the new name alongside the old. Internally use the new name; emit AiidaDeprecationWarning when the old name is used. If both are set and disagree, raise ValueError. Non-breaking — existing code keeps working.
  2. v3.0: Remove the old aliases.
  3. Database migration: optional per case — can read both names at runtime during the deprecation period, then migrate or drop in v3.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    maintainer onlyFundamental, large, and/or technical changes reserved for internal contributions by the core team.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions