mhoffman / kmos

kMC on steroids: A vigorous attempt to make lattice kinetic Monte Carlo modelling easier

Home Page:http://mhoffman.github.com/kmos/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SyntaxWarning when installing kmos

mieand opened this issue · comments

Hi,

I installed the newest version of kmos from scratch.
Both during installation and when doing "kmos export" one of the example models I get the following warnings:

/user/andersen/codes/kmos/kmos/cli.py:359: SyntaxWarning: name 'pt' is assigned to before global declaration
global pt

/user/andersen/codes/kmos/kmos/cli.py:411: SyntaxWarning: name 'model' is assigned to before global declaration
global model, np

Has this always been there and is it something to worry about?

Best,
Mie

Hi Mie

thanks for checking back. No this is nothing to worry about. If I remember I needed these 'global' declarations to make the commands 'kmos import' and 'kmos shell' work for newer versions for IPython. It is a bit unfortunate that it spits out a warning at this point but I couldn't figure out how to get it to work without. Unless you put the global statements at the top which somehow looks like it could cause too many side-effects (now or in the future). So this 'warning' was somehow the best compromise I could find.

Best,
Max.