18.11.2012 Views

ASE Manual Release 3.6.1.2825 CAMd - CampOS Wiki

ASE Manual Release 3.6.1.2825 CAMd - CampOS Wiki

ASE Manual Release 3.6.1.2825 CAMd - CampOS Wiki

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

<strong>ASE</strong> <strong>Manual</strong>, <strong>Release</strong> 3.6.1.2828<br />

Former committers:<br />

anro Anthony Goodrow anro:fysik,dtu,dk<br />

carstenr Carsten Rostgaard carstenr:fysik,dtu,dk<br />

hanke Felix Hanke F,Hanke:liverpool,ac,uk<br />

s042606 Janosch Michael Rauba s042606:fysik,dtu,dk<br />

s052580 Troels Kofoed Jacobsen s052580:fysik,dtu,dk<br />

11.1.3 Python 3 strategy<br />

• One codebase for both 2 and 3.<br />

• Use “print(...)” if possible:<br />

print ’bla bla’ # no<br />

print(’bla bla’) # yes<br />

print ’bla bla:’, x # no<br />

print(’bla bla: %s’ % x) # yes<br />

• Don’t do this: print >> f, .... Use f.write(... + ’\n’) or ase.utils.prnt(...,<br />

file=f).<br />

• More help here: http://packages.python.org/six/<br />

11.1.4 Using version control (SVN)<br />

The version control system used in <strong>ASE</strong> development is subversion. A thorough subversion manual can be found<br />

at http://svnbook.red-bean.com/, here is a brief overview of the most basic features needed when developing <strong>ASE</strong>.<br />

• perform svn checkout of ase.<br />

Place it, for example, in ase-svn directory:<br />

cd<br />

svn checkout https://svn.fysik.dtu.dk/projects/ase/trunk ase-svn<br />

This retrieves the code tree from the subversion repository. Prepend PYTHONPATH and PATH environment<br />

variables as described at Installation.<br />

• Updating the working copy of the code (in the directory ase-svn):<br />

svn update<br />

After each (important) update, remove ase/svnrevision.py* files, and run:<br />

python setup.py sdist<br />

to keep the ase/svnrevision.py file up-to-date.<br />

• Checking the status of the working copy (in the directory ase-svn):<br />

svn stat<br />

The status about the files which are not in version control can be surpassed with the -q flag, and the status<br />

with respect to latest additions in server can be checked with the -u flag.<br />

• Committing the changes to the repository<br />

Before sending the changes in the working copy to the repository, working copy should be updated. After<br />

that, the changes can be send with:<br />

svn commit -m "Message to describe the committed changes"<br />

If the -m option is omitted, an editor is opened for writing the log message.<br />

188 Chapter 11. <strong>ASE</strong> development

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

Saved successfully!

Ooh no, something went wrong!