Skip to content

Commit

Permalink
Bug fixes in installation and testing
Browse files Browse the repository at this point in the history
  • Loading branch information
faridyagubbayli committed May 20, 2023
1 parent 4214f3b commit 600ae6c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 0 additions & 2 deletions binvox/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
__version__ = "0.1.5"

from binvox.utils import compress_flat_voxels
from binvox.binvox import Binvox
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from distutils.core import setup
from binvox import __version__

__version__ = "0.1.6"

# read the contents of your README file
from pathlib import Path
Expand Down
12 changes: 6 additions & 6 deletions tests/test_load.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,27 @@

def test_loading():
# Load using original python script from Daniel Maturana
with open('chair.binvox', 'rb') as f:
with open('tests/chair.binvox', 'rb') as f:
loaded_old = binvox_rw_original.read_as_3d_array(f)

# Load with our library
loaded_new = Binvox.read('chair.binvox', mode='dense')
loaded_new = Binvox.read('tests/chair.binvox', mode='dense')

# Check for the correctness of the data
assert np.allclose(loaded_old.data, loaded_new.numpy())


def test_saving():
# Load from binvox file
binvox = Binvox.read('chair.binvox', mode='dense')
binvox = Binvox.read('tests/chair.binvox', mode='dense')
# Save to binvox file
binvox.write('chair_new.binvox')
binvox.write('tests/chair_new.binvox')

# Check for the equality of files
assert filecmp.cmp('chair.binvox', 'chair_new.binvox')
assert filecmp.cmp('tests/chair.binvox', 'tests/chair_new.binvox')

# Load from the newly saved file
binvox_duplicate = Binvox.read('chair_new.binvox', mode='dense')
binvox_duplicate = Binvox.read('tests/chair_new.binvox', mode='dense')

# Check correctness of data
assert np.allclose(binvox.numpy(), binvox_duplicate.numpy())

0 comments on commit 600ae6c

Please sign in to comment.