Skip to content

Commit

Permalink
Remove the 5 'exec' calls definining polynomial classes.
Browse files Browse the repository at this point in the history
Currently there are 5 places under numpy/polynomial which do
something like:

  exec polytemplate.substitute(name='Hermite', nick='herm', domain='[-1,1]')

I have changed those so there are start/end markers, like

  ...

I have edited  polytemplate.py so that it implements a __main__
which finds those block markers and replaces the content with
the appropriate "polytemplate" substitution.

This means that if you edit the template then you will need
to manually run 'polytemplate.py' so that the dependent files
are rebuilt based on the new template.

The performance of

  python -c 'import time; t1=time.time(); import numpy; print time.time()-t1'

goes from 0.079 seconds to 0.057 seconds (best of 10), for
an import speedup of ~25%.
  • Loading branch information
adalke authored and scottza committed Jul 10, 2012
1 parent 436a28f commit 2e52dcc
Show file tree
Hide file tree
Showing 7 changed files with 5,456 additions and 25 deletions.
Loading

0 comments on commit 2e52dcc

Please sign in to comment.