Skip to content

Commit 7640163

Browse files
authored
Merge pull request #29 from simpeg/dev
Dev
2 parents 4774134 + d09a6ad commit 7640163

File tree

14 files changed

+844
-453
lines changed

14 files changed

+844
-453
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[bumpversion]
2-
current_version = 0.1.1b1
2+
current_version = 0.1.2
33
files = setup.py discretize/__init__.py docs/conf.py
44

.coveragerc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ omit =
77
*/site-packages/ordereddict.py
88
*/site-packages/nose/*
99
*/unittest2/*
10+
*/setup.py

README.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
.. image:: https://raw.github.com/simpeg/simpeg/master/docs/images/simpeg-logo.png
2-
:alt: discretize Logo
3-
41
discretize
52
==========
63

74
.. image:: https://img.shields.io/pypi/v/discretize.svg
85
:target: https://pypi.python.org/pypi/discretize
96
:alt: Latest PyPI version
107

11-
.. image:: https://img.shields.io/badge/license-MIT-blue.svg
8+
.. image:: https://img.shields.io/github/license/simpeg/simpeg.svg
129
:target: https://github.com/simpeg/discretize/blob/master/LICENSE
1310
:alt: MIT license
1411

appveyor.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,20 @@ install:
2020
- "conda create -q -n test-environment python=%PYTHON% numpy scipy matplotlib cython ipython pillow"
2121
- activate test-environment
2222
- pip install -r requirements_dev.txt
23-
- python setup.py install build_ext -i cython
23+
- python setup.py install
2424

2525
test_script:
26-
- nosetests tests\base -v -s
26+
- cd tests
27+
- nosetests base tree -v -s
28+
- cd ..
29+
30+
after_test:
31+
# This step builds your wheels.
32+
# Again, you only need build.cmd if you're building C extensions for
33+
# 64-bit Python 3.3/3.4. And you need to use %PYTHON% to get the correct
34+
# interpreter
35+
- python setup.py bdist_wheel
36+
37+
artifacts:
38+
# bdist_wheel puts your built wheel in the dist directory
39+
- path: dist\*

discretize/TreeMesh.py

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,7 @@
8383
import scipy.sparse as sp
8484

8585
from discretize import utils
86-
87-
try:
88-
from . import TreeUtils
89-
_IMPORT_TREEUTILS = True
90-
except Exception:
91-
_IMPORT_TREEUTILS = False
92-
86+
from . import TreeUtils
9387

9488
from .InnerProducts import InnerProducts
9589
from .TensorMesh import TensorMesh, BaseTensorMesh
@@ -105,13 +99,8 @@ class TreeMesh(BaseTensorMesh, InnerProducts, TreeMeshIO):
10599
_meshType = 'TREE'
106100

107101
def __init__(self, h, x0=None, levels=None):
108-
if not _IMPORT_TREEUTILS:
109-
raise Exception(
110-
'Could not import the Cython code to run the '
111-
'TreeMesh Try:.\n\npython setup.py build_ext --inplace'
112-
)
113102
assert type(h) is list, 'h must be a list'
114-
assert len(h) in [2, 3], "There is only support for TreeMesh in 2D or 3D."
103+
assert len(h) in [2, 3], "TreeMesh is only in 2D or 3D."
115104

116105
BaseTensorMesh.__init__(self, h, x0)
117106

@@ -370,7 +359,8 @@ def ntEx(self):
370359

371360
@property
372361
def ntEy(self):
373-
if self.dim == 2:return self.ntFx
362+
if self.dim == 2:
363+
return self.ntFx
374364
self.number()
375365
return len(self._edgesY)
376366

@@ -389,13 +379,13 @@ def _sortedCells(self):
389379

390380
@property
391381
def permuteCC(self):
392-
#TODO: cache these?
382+
# TODO: cache these?
393383
P = SortGrid(self.gridCC)
394384
return sp.identity(self.nC).tocsr()[P,:]
395385

396386
@property
397387
def permuteF(self):
398-
#TODO: cache these?
388+
# TODO: cache these?
399389
P = SortGrid(self.gridFx)
400390
P += SortGrid(self.gridFy, offset=self.nFx)
401391
if self.dim == 3:
@@ -404,16 +394,16 @@ def permuteF(self):
404394

405395
@property
406396
def permuteE(self):
407-
#TODO: cache these?
397+
# TODO: cache these?
408398
if self.dim == 2:
409399
P = SortGrid(self.gridFy)
410400
P += SortGrid(self.gridFx, offset=self.nEx)
411-
return sp.identity(self.nE).tocsr()[P,:]
401+
return sp.identity(self.nE).tocsr()[P, :]
412402
if self.dim == 3:
413403
P = SortGrid(self.gridEx)
414404
P += SortGrid(self.gridEy, offset=self.nEx)
415405
P += SortGrid(self.gridEz, offset=self.nEx+self.nEy)
416-
return sp.identity(self.nE).tocsr()[P,:]
406+
return sp.identity(self.nE).tocsr()[P, :]
417407

418408
def _index(self, pointer):
419409
assert len(pointer) is self.dim+1

0 commit comments

Comments
 (0)