Skip to content
Snippets Groups Projects

BUGFIX: Initialize `constraints` in `read_castep_castep`

Merged Yuji Ikeda requested to merge yuzie007/ase:fix-1524 into master

Closes #1524 (closed)

This MR solves the issue above by initializing constraints in read_castep_castep.

Since the change is minor, I would like to merge this soon.

Checklist

Edited by Yuji Ikeda

Merge request reports

Pipeline #1417328429 passed

Pipeline passed for 183eb06a on yuzie007:fix-1524

Test coverage 75.35% (0.00%) from 1 job

Merged by Yuji IkedaYuji Ikeda 7 months ago (Aug 18, 2024 7:59am UTC)

Loading

Pipeline #1417332321 passed

Pipeline passed for fe53425c on master

Test coverage 75.42% (0.00%) from 1 job

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Yuji Ikeda changed the description

    changed the description

  • merged

  • Yuji Ikeda mentioned in commit fe53425c

    mentioned in commit fe53425c

  • Thanks for getting this fixed so quickly - would this be an issue if there was a constraint on the atom (just they haven't been written to the castep file yet?)

  • Author Maintainer

    The issue was not related to the existence of constraints in the castep file. The issue was because, as I partly wrote in #1524 (closed),

    • In one-atom case + GeometryOtimization, the force block is not written for most SCF steps.
    • In the castep file, constraints (regardless if they exist or not) are written together with forces, and therefore, if the force block does not exist, constraints are not read as well.
    • Nevertheless, read_castep_castep tries to set constraints, and when it is not initialized, then the error is raised.
    Edited by Yuji Ikeda
  • So for the atoms object to be initialized with the correct constraints wouldn't it be necessary to look ahead to find the forces block in the single atom case? Or is "constraints" always guaranteed to be [] in this case. I'm obviously not very familiar with CASTEP - so happy with this fix if you are.

  • Author Maintainer

    I believe that, in most cases, GeometryOptimization (and maybe MolecularDynamics) is meaningful only for systems with more than one atom, where the issue does not happen anyway.

    If you have some actual problem, it would be again helpful to open the issue with a minimum complete example :)

Please register or sign in to reply
Loading