12.07.2015 Views

The Computational Materials Repository

The Computational Materials Repository

The Computational Materials Repository

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2.9 Advanced Task 51from cmr . t o o l s . f u n c t i o n s import make schemadata ={ ’ p o s i t i o n s ’ : [ [ 0 , 0 , 0 ] , [ 0 , 0 , 1 . 1 7 8 6 5 8 ] , [ 0 , 0 , − 1 . 1 7 8 6 5 8 ] ] ,’ a s e p o s i t i o n s ’ : [ [ 0 , 0 , 0 ] , [ 0 , 0 , 1 . 1 7 8 6 5 8 ] , [ 0 , 0 , − 1 . 1 7 8 6 5 8 ] ] ,’ name ’ : ’CO2’ ,’ ase atomic numbers ’ : [ 6 , 8 , 8 ] ,’ atoms ’ : [ 6 , 8 , 8 ]}p r i n t make schema ( data )Figure 2.29: Creates the main part for a CMR schema automatically.2.9.3.4 Step 4: set environment variablesAdd the path of the newc converter to the python path. Also adjust theenvironment variable CMR SCHEMA PATH to point to this location becausewe’re going to create a XML schema in the next step; then add the plug-path tothe cmr configuration file that is normally located in $HOME/.cmr/cmr-settingsfilee.g.p l u g i n p a t h s=/home / . . . / newc2.9.3.5 Step 5: create an XML schema<strong>The</strong> xml schema allows to validate the db-file. If you made everything right,then you can load the CMR schema as follows and create the XML schema.import cmrfrom cmr . d e f i n i t i o n s import g e t c a l c u l a t o r i n f o r m a t i o nc a l c i n f o = g e t c a l c u l a t o r i n f o r m a t i o n (” newc” ””)c a l c i n f o . c r e a t e x s d ( )Now your CMR installation supports newc files.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!