[ase-users] How to implement local modifications to ASE?
Ask Hjorth Larsen
asklarsen at gmail.com
Sat Sep 8 16:29:55 CEST 2018
Hi,
Am Sa., 8. Sep. 2018 um 08:44 Uhr schrieb Clayton Spencer via
ase-users <ase-users at listserv.fysik.dtu.dk>:
>
> Greetings,
>
> I apologize if this is a naive question. I'm new to python and ASE.
>
> I'd like to make some changes to the ASE source code on a local installation. Specifically, I'd like to modify the gaussian.py calculator so that it will work better with certain aspects of the Gaussian16 software version that is installed on my local system.
>
> I think I know the modifications that I need to make to the distributed gaussian.py calculator source. Where do I go from there? Is it simply a matter of replacing the existing gaussian.py file in my .local/lib/python2.7/site-packages/ase/calculators directory with the edited version? It appears that ASE also has compiled binaries in a /bin directory. To get ASE to work with the new gaussian.py calculator, do I need to recompile all the source? If so, I confess that I'm not sure how to do that.
>
> Please advise on how to best to proceed?
If you want to improve the Gaussian calculator there are different ways:
1) If you want to contribute the improvements to ASE, you should get
the development version and work in a fork using git
2) If you want to add something simple and it's not worth adding to
ASE, subclass the calculator and use the subclass in your scripts.
You can define the subclass in the script.
class MyGaussian(Gaussian):
def my_function(self):
return 42
atoms.calc = MyGaussian()
etc.
3) If what you want to do is a bit more complex, find the Gaussian
source file, copy/paste the whole calculator source into your script
and make any modifications you like. Obviously this is not good for
long-term maintenance if that is what you care about, but it's the
fastest way to make a change.
Best regards
Ask
>
> Thanks, in advance.
>
> Clayton Spencer
>
> _______________________________________________
> ase-users mailing list
> ase-users at listserv.fysik.dtu.dk
> https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
More information about the ase-users
mailing list