[Biopython-dev] Fwd: Feature: Python implementation of MMCIF parser (#33)
Eric Talevich
eric.talevich at gmail.com
Mon Apr 23 16:32:11 EDT 2012
On Fri, Apr 20, 2012 at 8:57 PM, Lenna Peterson <arklenna at gmail.com> wrote:
>
> I've started testing the PLY lexer on PyPy. NumPyPy now implements
> more functions needed by PDB; the only things I found to be missing
> are random and linalg. This eliminates Superimposer, FragmentMapper,
> and Vector.
>
> I played around with trying to spoof "import numpy" to automatically
> import numpypy (code here: https://gist.github.com/2432815) but I
> don't think that's wise yet.
>
> My last commit to this branch was a few changes to allow the MMCIF
> parser to work on NumPy. PyPy won't run `setup.py test` due to global
> numpy failure, but if I install this branch and `pypy test_MMCIF.py`,
> it passes.
>
> Anybody with more PyPy and/or package structuring experience have thoughts?
>
> Lenna
Would it be more or less error-prone to simply replace every numpy
import with this (after testing each module on PyPy):
try:
import numpy
except:
import numpypy as numpy
Or similarly, use this as one of our compatibility utilities:
from Bio import numpy
# Some conditional junk in Bio/__init__.py or setup.py to reveal this
module to PyPy and CPython as needed
In either case, here's the relatively short list of modules that would
need to be modified:
Bio/Affy/CelFile.py
Bio/Cluster/__init__.py
Bio/KDTree/KDTree.py
Bio/LogisticRegression.py
Bio/MarkovModel.py
Bio/MaxEntropy.py
Bio/NaiveBayes.py
Bio/PDB/Atom.py
Bio/PDB/FragmentMapper.py
Bio/PDB/MMCIFParser.py
Bio/PDB/NeighborSearch.py
Bio/PDB/PDBParser.py
Bio/PDB/ResidueDepth.py
Bio/PDB/Superimposer.py
Bio/PDB/Vector.py
Bio/SVDSuperimposer/SVDSuperimposer.py
Bio/Statistics/lowess.py
Bio/SubsMat/__init__.py
Bio/kNN.py
More information about the Biopython-dev
mailing list