Merge lp://qastaging/~jochym/elastic/mixin into lp://qastaging/elastic

Proposed by Paweł T. Jochym
Status: Merged
Approved by: Paweł T. Jochym
Approved revision: no longer in the source branch.
Merge reported by: Paweł T. Jochym
Merged at revision: not available
Proposed branch: lp://qastaging/~jochym/elastic/mixin
Merge into: lp://qastaging/elastic
Diff against target: 140 lines (+55/-20)
1 file modified
elastic.py (+55/-20)
To merge this branch: bzr merge lp://qastaging/~jochym/elastic/mixin
Reviewer Review Type Date Requested Status
Paweł T. Jochym Approve
Review via email: mp+105579@code.qastaging.launchpad.net

Commit message

Implementation of the mixin design pattern for the elastic module. It becomes a plug-in for the Atoms class.
The backward compatibility class Crystal(Atoms) provides for the old code to run without change.

Description of the change

Backward-compatible change in the implementation of the code.
The mixin design pattern is implemented by making __Crystal a base class of the Atoms ase class with just a little bit of trickery to get the constructor of the Atoms class to call the __Crystal class constructor. The (empty) Crystal(Atoms) class is provided to let the 3.0 code run without change. The documentation still needs updating.
Current usage style is (in this order!):

imprort ase
import elastic

After this sequence the ase.Atoms class gets additional methods for elastic tensor calculations.

To post a comment you must log in.
Revision history for this message
Paweł T. Jochym (jochym) wrote :

I (obviously) think it is a good idea ;)

review: Approve
lp://qastaging/~jochym/elastic/mixin updated
51. By Paweł T. Jochym

Implementation of the mixin design pattern for the elastic module.
It becomes a plug-in for the Atoms class.
The backward compatibility class Crystal(Atoms)
provides for the old code to run without change.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: