Commit 3861251b authored by eric pellegrini's avatar eric pellegrini
Browse files

modified the setup.py file for matching prior ScientificPython install

parent 2e802624
......@@ -233,7 +233,7 @@
<span class="sd"> zeros is created and used. Otherwise, the</span>
<span class="sd"> array myst be of shape (N,), where N is the</span>
<span class="sd"> number of particles in the universe.</span>
<span class="sd"> :type data_array: Scientific.N.array_type</span>
<span class="sd"> :type data_array: numpy.ndarray</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">ParticleProperty</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">universe</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
<span class="k">if</span> <span class="n">data_array</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
......@@ -309,7 +309,7 @@
<span class="sd"> zeros is created and used. Otherwise, the</span>
<span class="sd"> array myst be of shape (N,3), where N is the</span>
<span class="sd"> number of particles in the universe.</span>
<span class="sd"> :type data_array: Scientific.N.array_type</span>
<span class="sd"> :type data_array: numpy.ndarray</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">ParticleProperty</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">universe</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="k">if</span> <span class="n">data_array</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
......@@ -461,7 +461,7 @@
<span class="sd"> zeros is created and used. Otherwise, the</span>
<span class="sd"> array myst be of shape (N,3), where N is the</span>
<span class="sd"> number of particles in the universe.</span>
<span class="sd"> :type data_array: Scientific.N.array_type</span>
<span class="sd"> :type data_array: numpy.ndarray</span>
<span class="sd"> :param cell: the cell parameters of the universe,</span>
<span class="sd"> i.e. the return value of universe.cellParameters()</span>
<span class="sd"> &quot;&quot;&quot;</span>
......@@ -520,7 +520,7 @@
<span class="sd"> zeros is created and used. Otherwise, the</span>
<span class="sd"> array myst be of shape (N,3,3), where N is the</span>
<span class="sd"> number of particles in the universe.</span>
<span class="sd"> :type data_array: Scientific.N.array_type</span>
<span class="sd"> :type data_array: numpy.ndarray</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">ParticleProperty</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">universe</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="k">if</span> <span class="n">data_array</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
......@@ -587,7 +587,7 @@
<span class="sd"> zeros is created and used. Otherwise, the</span>
<span class="sd"> array myst be of shape (N,3,N,3), where N is the</span>
<span class="sd"> number of particles in the universe.</span>
<span class="sd"> :type data_array: Scientific.N.array_type</span>
<span class="sd"> :type data_array: numpy.ndarray</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">ParticleProperty</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">universe</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="k">if</span> <span class="n">data_array</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
......
......@@ -1100,7 +1100,7 @@
<span class="sd"> :param vector: a point in the universe</span>
<span class="sd"> :type vector: Scientific.Geometry.Vector</span>
<span class="sd"> :returns: the fractional coordinate equivalent of vector</span>
<span class="sd"> :rtype: Scientific.N.array_type</span>
<span class="sd"> :rtype: numpy.ndarray</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s">&quot;Universe is not periodic&quot;</span><span class="p">)</span>
</div>
......@@ -1113,7 +1113,7 @@
<span class="sd"> their components have values between 0. and 1.</span>
<span class="sd"> :param array: an array of fractional coordinates</span>
<span class="sd"> :type array: Scientific.N.array_type</span>
<span class="sd"> :type array: numpy.ndarray</span>
<span class="sd"> :returns: the real-space equivalent of vector</span>
<span class="sd"> :rtype: Scientific.Geometry.Vector</span>
<span class="sd"> &quot;&quot;&quot;</span>
......
......@@ -10,11 +10,7 @@
#include "MMTK/core.h"
#include "Scientific/netcdfmodule.h"
#ifdef USE_NETCDF_H_FROM_SCIENTIFIC
# include "Scientific/netcdf.h"
#else
# include "netcdf.h"
#endif
#include "Scientific/netcdf.h"
#include <time.h>
/* Unit names */
......
#!/usr/bin/env python
from click.exceptions import FileError
package_name = "MMTK"
......@@ -50,24 +51,22 @@ if not scientific_ok:
compile_args = []
include_dirs = ['Include']
if (int(scientific_version[1]) >= 8 or \
(int(scientific_version[1]) == 7 and int(scientific_version[2]) >= 8)):
netcdf_h = os.path.join(sys.prefix, 'include',
'python%d.%d' % sys.version_info[:2],
'Scientific', 'netcdf.h')
if os.path.exists(netcdf_h):
compile_args.append("-DUSE_NETCDF_H_FROM_SCIENTIFIC=1")
netcdf_h = os.path.join(sys.prefix, 'local', 'include',
'python%d.%d' % sys.version_info[:2],
'Scientific', 'netcdf.h')
if os.path.exists(netcdf_h):
compile_args.append("-DUSE_NETCDF_H_FROM_SCIENTIFIC=1")
else:
# Take care of the common problem that netcdf is in /usr/local but
# /usr/local/include is not on $CPATH.
if os.path.exists('/usr/local/include/netcdf.h'):
include_dirs.append('/usr/local/include')
python_version = 'python%d.%d' % sys.version_info[:2]
netcdf_h_search_paths = [os.path.join(sys.prefix,'include',python_version,'Scientific'),
os.path.join(sys.prefix,'local','include',python_version,'Scientific')]
netcdf_h = None
for path in netcdf_h_search_paths:
test_path = os.path.join(path,'netcdf.h')
if os.path.exists(test_path):
netcdf_h = test_path
print "NetCDF header found --> %s" % netcdf_h
include_dirs.append(os.path.dirname(path))
break
if netcdf_h is None:
raise FileError("No suitable NetCDF header found.")
compile_args.append("-DNUMPY=1")
import numpy.distutils.misc_util
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment