[Numpy-discussion] Guidance regarding build and testing

Ryan Nelson rnelsonchem at gmail.com
Mon Dec 22 10:00:57 EST 2014


Ralf's suggestion for Numpy works very well. In a more general case,
though, you might want to play around with conda, the package manager for
Anaconda's Python distribution (http://continuum.io/downloads).

I use the Miniconda package, which is pretty much just conda, to create new
"environments," which are a lot like virtualenvs (
http://conda.pydata.org/docs/faq.html#env-creating). The nice thing here is
that all of the dependencies are only downloaded once, and you can make
Python 2 and 3 environments pretty easily.

For example, to make a Python 3 environment, you could use the following:
$ conda create -n npy3 python=3 numpy ipython
$ source activate npy3
That creates a Python3 environment called "npy3" with numpy, ipython, and
all the dependencies. Once activated, you can remove the conda version of
numpy and then install the development version:
[npy3]$ conda remove numpy
[npy3]$ python setup.py install
### Do dev stuff ###
[npy3]$ source deactivate

This is not necessary for what you are trying to do, but it might be
helpful to know about as you move along.


On Sun, Dec 21, 2014 at 4:54 PM, Ralf Gommers <ralf.gommers at gmail.com>

> On Sun, Dec 21, 2014 at 7:17 PM, Maniteja Nandana <
> maniteja.modesty067 at gmail.com> wrote:
>> Hello Ralf,
>> Thanks for the help. Now I am able to see the modifications in the
>> interpreter. As I was going through broadcasting and slicing, I was eager
>> to try out different modifications to understand the working.
>> On Sun, Dec 21, 2014 at 10:57 PM, Ralf Gommers <ralf.gommers at gmail.com>
>> wrote:
>>> Almost. test_xxx.py contains tests for all functions in the file xxx.py
>> Sorry was a bit confused then. Thanks for the correction  :)
>>> Note that there is also a variant which does use virtualenvs documented
>>> at https://github.com/scipy/scipy/blob/master/HACKING.rst.txt#faq
>>> (under "*How do I set up a development version of SciPy in parallel to
>>> a released version that I use to do my job/research?").*
>>>> maniteja at ubuntu:~/FOSS/numpy$ echo $PYTHONPATH
>>>> /home/maniteja/FOSS/numpy/numpy
>>> Maybe that's one /numpy too many? If it's right, you should have a dir
>>> /home/maniteja/FOSS/numpy/
>>> numpy/numpy/core.
>>>  No I have setup.py in home/maniteja/FOSS/numpy/numpy.
>>  Hence, I have core also as home/maniteja/FOSS/numpy/numpy/core
>>> An easy way to check which numpy you're using is "import numpy;
>>>> print(numpy.__file__)".
>>> Thanks, I didn't get the idea then. It now shows
>> '/home/maniteja/FOSS/numpy/numpy/__init__.pyc'
>> The documentation tells that the PWD of the setup.py is to be set as
>> PYTHONPATH variable.
> That's correct. Note that setup.py's are hierarchical - you have one in
> .../FOSS/numpy (this is the main one), one in .../FOSS/numpy/numpy, one in
> .../FOSS/numpy/numpy/core and so on.
> This is fine. You should not develop directly on your own master branch.
>>> Rather, keep your master branch in sync with numpy master, and create a new
>>> feature branch for every new feature that you want to work on.
>>> Ralf
>>> Oh thanks, I have only used git for my local repositories or
>> collaboration with peers. So just wanted to clarify before I end up messing
>> anything :), though there I know that there needs to be write access to
>> modify the master branch.
>> Lastly, it would be great if you could suggest whether I should learn
>> Cython or any other codebase to understand the source code
> It depends on what you want to work on. There's not much Cython in numpy,
> only in numpy.random. There's a lot of things you can work on knowing only
> Python, but the numpy core (ndarray, dtypes, ufuncs, etc.) is written in C.
> I'd suggest diving right in and starting with something that can be
> fixed/implemented in Python, something from
> https://github.com/numpy/numpy/labels/Easy%20Fix perhaps. Then send a PR
> for that so you get some feedback and a feeling for how the process of
> contributing works.
>> and also the timings preferable to work and discuss on the mailing lists
>> as I stay in India ,which is GMT+5:30 timezone. This is my winter holidays.
>> So, I could adjust my timings accordingly as I have no schoolwork :)
> I wouldn't worry about that. In many cases it takes a day or couple of
> days before someone replies, especially if the topic requires detailed
> knowledge of the codebase. And the people on this list are split roughly
> equally between the US and Europe with smaller representations from all
> other continents, so there's always someone awake:)
> Cheers,
> Ralf
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20141222/8f42e91d/attachment.html>

More information about the NumPy-Discussion mailing list