Skip to content

Contribution guide

Qi Zhang edited this page Sep 10, 2019 · 6 revisions

[TOC]

Global generic API used by multiple modules

It is easy to come across some methods used by several modules, especially the QuantumESPRESSO.Cards, QuantumESPRESSO.Namelists and QuantumESPRESSO.QuantumESPRESSOInput modules and their submodules. Because Namelists and Cards, etc., can share similar interfaces. For example, the name and to_qe methods. But if not writing carefully, they could cause name conflicting. For instance, if you define name methods in QuantumESPRESSO.Cards and QuantumESPRESSO.Namelists separately. When loaded first by one and then the other, the generate name conflicts. A way to solve this is in an upper-level module (QuantumESPRESSO here), define a generic name. Then in each module mentioned above, using QuantumESPRESSO, and extend QuantumESPRESSO.name.

When using, write like this

using QuantumESPRESSO

Then all extended name methods will be loaded.

Clone this wiki locally