[ase-users] Phase diagram: only_show_simplices

Jens Jørgen Mortensen jjmo at dtu.dk
Tue Feb 4 15:34:34 CET 2020


On 1/27/20 8:41 AM, Adam Carlsson via ase-users wrote:
> Dear ASE users,
> 
> I am following the tutorial of the genetic algorithm (GA), 
> https://wiki.fysik.dtu.dk/ase/tutorials/ga/ga_convex_hull.htmland when 
> running the following script, which may be found in the previous link, I 
> stumble upon an error regarding the “only_show_simplices” input argument 
> of a phasediagram class.
> 
> **
> 
> *import**numpy**as**np*
> 
> *from**ase.phasediagram**import*PhaseDiagram
> 
> *from**ase.db**import*connect
> 
> *from**ase.io**import*write
> 
> db =connect('hull.db')
> 
> /# Select the evaluated candidates and retrieve the chemical formula and 
> mixing/
> 
> /# energy for the phase diagram/
> 
> refs =[]
> 
> dcts =list(db.select('relaxed=1'))
> 
> *for*dct *in*dcts:
> 
>      refs.append((dct.formula, -dct.raw_score))
> 
> pd =PhaseDiagram(refs)
> 
> pd.plot(only_label_simplices=*True*)
> 
> /# View the simplices of the convex hull/
> 
> simplices =[]
> 
> toview =sorted(np.array(dcts)[pd.hull], key=*lambda*x: x.mass)
> 
> *for*dct *in*toview:
> 
>      simplices.append(dct.toatoms())
> 
> write('hull.traj', simplices)
> 
> #end of script
> 
> However, I am stumbling upon this following error:
> 
>    File "plot_convex_hull.py", line 31, in <module>
> 
>      pd.plot(only_label_simplices=True)
> 
> TypeError: plot() got an unexpected keyword argument 'only_label_simplices'
> 
> And when investigating the phasediagram.py, I can not obtain any 
> information regarding the alternative of only showing simplices? Hence I 
> am wondering if the “only_label_simplices” is a valid input argument or 
> not?
> I would very much like to have the alternative of only demonstrating the 
> simplices and I have previously tried to implement the feature but with 
> no success. I would very much like to have some clarity regarding this 
> input tag for phasediagrams.
> 
> I should mention I am running ASE/3.18 and Python/3.7.2

Thanks for reporting this.  Those two plotting options have 
unfortunately been removed.  I'll add them again.  Until that happens, 
you can also call plot2d2() directly to get the raw data and the use 
that to create exactly the plot you want.

Jens Jørgen

> 
> Best regards,
> 
> Adam Carlsson
> 
> 
> _______________________________________________
> 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