Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into v1.4
Browse files Browse the repository at this point in the history
achilleas-k committed Aug 16, 2017
2 parents f769a87 + 0251fbd commit 55f24ab
Showing 5 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@ pip-log.txt
*.log
*.kate-swp
*.swp
*cache

# idea / pycharm files
.idea
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@
.. image:: https://coveralls.io/repos/github/G-Node/nixpy/badge.svg?branch=v1.4
:target: https://coveralls.io/github/G-Node/nixpy?branch=v1.4


----

Versions
4 changes: 4 additions & 0 deletions nixio/data_array.py
Original file line number Diff line number Diff line change
@@ -129,6 +129,10 @@ def __getitem__(self, index):
count, offset, shape = self.__tuple_to_count_offset_shape(index)
raw = np.empty(shape, dtype=self.dtype)

if hasattr(self, "polynom_coefficients") and self.polynom_coefficients:
# if there are coefficients, convert the dtype of the returned data
# array to double
raw.dtype = np.float64
self._read_data(raw, count, offset)

return raw
7 changes: 7 additions & 0 deletions nixio/test/test_data_array.py
Original file line number Diff line number Diff line change
@@ -117,6 +117,13 @@ def test_data_array_coefficients(self):
self.array.polynom_coefficients = (1.1, 2.2)
assert(self.array.polynom_coefficients == (1.1, 2.2))

data = [10, 29, 33]
intarray = self.block.create_data_array("intarray", "array",
nix.DataType.Int64,
data=data)
intarray.polynom_coefficients = (0.0, 0.1)
np.testing.assert_almost_equal(intarray[:], np.array(data) * 0.1)

# TODO delete does not work

def test_data_array_data(self):
2 changes: 1 addition & 1 deletion scripts/dorelease.py
Original file line number Diff line number Diff line change
@@ -216,7 +216,7 @@ def print_appveyor_urls():
wait_for_ret()

apiurl = "https://ci.appveyor.com/api/"
account = "gicmo"
account = "achilleas-k"
project_name = "nixpy"

url = os.path.join(apiurl, "projects", account, project_name)

0 comments on commit 55f24ab

Please sign in to comment.