Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge master into v1.5 #362

Merged
merged 333 commits into from
Jan 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
333 commits
Select commit Hold shift + click to select a range
1afea2e
[setup.py] Cleanup unnecessary imports and lines
achilleas-k Jul 5, 2018
4b7131c
Remove old src/ files
achilleas-k Jul 5, 2018
55a7011
Clarify test skip reason
achilleas-k Jul 6, 2018
7669f9d
[travis] Force compat tests on macOS again
achilleas-k Jul 6, 2018
d02ecfb
[tests] Remove C++ (HDF5 backend) test subclasses
achilleas-k Jul 6, 2018
24bd4cd
Test fix: name should be char[7], not char[6]
achilleas-k Jul 6, 2018
e4e7340
[appveyor] Fix nix version (1.4.1)
achilleas-k Jul 9, 2018
692611f
[util] Remove injections into core (bindings)
achilleas-k Apr 12, 2017
95956d8
[File] Remove Mixin, simplify File constructor
achilleas-k Apr 12, 2017
2344cfb
[Section] Duplicating SectionProxyList
achilleas-k Apr 12, 2017
99afd61
[test] Remove obsolete "backend" argument
achilleas-k Jul 9, 2018
9837608
Remove mentions of backend from docs
achilleas-k Jul 9, 2018
651cb98
Remove File.validate() method
achilleas-k Jul 9, 2018
364a48b
[File] Move file.py outside pycore
achilleas-k Apr 13, 2017
ea580f5
[Block,Source] Remove Mixins and move outside Pycore
achilleas-k Apr 13, 2017
02c9e5c
Remove monkey patcher for bindings
achilleas-k Apr 13, 2017
642e57b
[Group] Remove Mixins and move outside pycore/
achilleas-k Apr 13, 2017
24624a6
[DataSet,DataArray] Merge classes with mixins
achilleas-k Jul 9, 2018
43fb79a
[Tag,MultiTag] Merge classes with mixins
achilleas-k Jul 9, 2018
cc58cb0
Merge all remaining mixins into their respective classes
achilleas-k Jul 9, 2018
03456f0
Move nix objects out of pycore submodule
achilleas-k Jul 9, 2018
e46717d
Cleanup MANIFEST.in
achilleas-k Jul 9, 2018
ef7f8c0
[init] Top level access to all NIX object classes and enums
achilleas-k Jul 9, 2018
fb049fb
Use copyright symbol © in headers
achilleas-k Jul 10, 2018
c489847
Remove __future__ imports
achilleas-k Jul 10, 2018
43c53d1
Copyright dates: Revert top-level file dates
achilleas-k Jul 10, 2018
5658f10
Add utf-8 encoding and copyright header to all files
achilleas-k Jul 10, 2018
e2fa3fd
[travis] Temporarily disable brew upgrade boost
achilleas-k Jul 11, 2018
bb09503
Move nix objects out of pycore submodule
achilleas-k Jul 9, 2018
38177e0
New Container and LinkContainer classes
achilleas-k Apr 20, 2017
fa8b1dd
[File] Delete old, obsolete ProxyList interfaces
achilleas-k Apr 20, 2017
505bf34
[H5Group] Initialise group prop if it exists
achilleas-k Apr 20, 2017
2bfec3e
[H5Group] Don't iterate if len == 0
achilleas-k Apr 20, 2017
f283349
[Container] Small child class creation method
achilleas-k Apr 20, 2017
45173a8
[Block] Using Container instead of ProxyList
achilleas-k Apr 20, 2017
41acc10
[Group] Using LinkContainer instead of RefProxyList
achilleas-k Apr 20, 2017
46c93ac
Containers need reference to parent NIX object
achilleas-k Apr 20, 2017
81cd9ff
[Group] Cleanup: Remove RefProxyList interfaces
achilleas-k Apr 21, 2017
073012b
[EntityWithSources] Use new LinkContainer
achilleas-k Apr 21, 2017
6a66320
[H5Group] More suitable exception types for gets
achilleas-k Jun 9, 2017
d1236db
[H5Group] Simpler error messages
achilleas-k Jun 9, 2017
91f1054
[Container] Bugfix: Return error on get fail
achilleas-k Jun 9, 2017
6ee48ac
[Test] Failing test for feature of tag on group
achilleas-k Jun 9, 2017
2e854ad
[Test] Container method tests
achilleas-k Jun 9, 2017
0a701ef
[LinkContainer] FIX parent ref in linked objects
achilleas-k Jun 9, 2017
2a6eeb5
[Test] Linking deep source to object
achilleas-k Jun 9, 2017
ffeb492
[EWSources] New container for Source links
achilleas-k Jun 9, 2017
9e1debb
[test] Use .nix extension for test files
achilleas-k Jul 10, 2018
09d14c8
[tests] Create test files in temporary directories
achilleas-k Jul 10, 2018
6f42be1
Use six.string_types instead of stupid import hacks
achilleas-k Sep 30, 2017
484a205
[Block] Merge DA creation functions
achilleas-k Oct 1, 2017
5cc1c6e
Add metadata to block
achilleas-k Sep 28, 2017
a3bc4fc
Flatten Entity class hierarchy
achilleas-k Sep 27, 2017
a169b86
Metadata property creation function
achilleas-k Oct 1, 2017
8cc4e05
Special SourceLinkContainer
achilleas-k Oct 1, 2017
a00e387
Section and Property containers
achilleas-k Oct 1, 2017
78f88fb
OverflowError check no longer relevant
achilleas-k Jul 10, 2018
b163d26
DataView.data_extent should be read only
achilleas-k Oct 1, 2017
9e621be
Remove slice to count & offset conversions
achilleas-k Sep 24, 2017
1efb7ef
[DataArray] Old fix for poly coeff on integer arrays
achilleas-k Jul 10, 2018
6b08c0a
[h5dataset] Catch H5Py indexing ValueError
achilleas-k Jul 11, 2018
7650c0c
Use Container classes for Features and References
achilleas-k Jul 12, 2018
b05ac6b
Add Container.items() iterator
achilleas-k Oct 1, 2017
57c7220
Metadata property: add straightforwardly
achilleas-k Jul 12, 2018
cd0b31a
Test fix: sources.extent() requires iterable
achilleas-k Jul 12, 2018
cbf9a57
Cleanup: Delete obsolete files
achilleas-k Jul 12, 2018
fa99cc8
Use new Container type for .dimensions
achilleas-k Jul 12, 2018
5586989
[test] Fix test for Dimension indexing exception types
achilleas-k Jul 12, 2018
c49b098
Cleanup: Remove obsolete ProxyList objects and tests
achilleas-k Jul 12, 2018
5c83e54
Cleanup: Remove old obsolete ProxyList functions
achilleas-k Jul 12, 2018
10bb1af
[test] Section getter method no longer available
achilleas-k Jul 12, 2018
b569b6b
[H5Group] Don't raise StopIteration when no values
achilleas-k Jul 13, 2018
2b872f0
[property] Add uncertainty
mpsonntag Jul 12, 2018
b9b9cca
[property] Add reference
mpsonntag Jul 12, 2018
b991a78
[property] Add value origin
mpsonntag Jul 12, 2018
71d69ef
[section] Add reference
mpsonntag Jul 12, 2018
defde91
[property] Add dependency (value)
mpsonntag Jul 12, 2018
30b5ae3
[section/property] Opt prop id assign on create
mpsonntag Jul 12, 2018
9351b19
[file/section] Opt sec id assign on create
mpsonntag Jul 12, 2018
98f1942
[test] Add new section attribute tests
mpsonntag Jul 12, 2018
c90f4b5
[test] Add new property attribute tests
mpsonntag Jul 12, 2018
889605e
[property] Add newvalue property
mpsonntag Jul 13, 2018
4c3feb2
[property] Add new value data type helper funcs
mpsonntag Jul 13, 2018
20000ae
[property] Add newvalue prop setter
mpsonntag Jul 13, 2018
2bdaa5a
[property] Add new create property method
mpsonntag Jul 13, 2018
43b86c9
[section] Add new create property method
mpsonntag Jul 13, 2018
bfdb3d3
[property] Add OdmlType class
mpsonntag Jul 13, 2018
06ebe4c
[property] Add OdmlType compatible method
mpsonntag Jul 13, 2018
81bad61
[property] Add OdmlType get_odml_type method
mpsonntag Jul 13, 2018
485b409
[property] Add odml_type property
mpsonntag Jul 13, 2018
8280a3b
[section] Update docstring
mpsonntag Jul 13, 2018
93641c7
[property] Add DataType class
mpsonntag Jul 13, 2018
5f20378
[section] Use DataType from property
mpsonntag Jul 13, 2018
c4e0d00
[datatype/value] Rename file value to datatype
mpsonntag Jul 13, 2018
5197d8d
Resolve changed DataType imports
mpsonntag Jul 13, 2018
62b6cd9
[datatype] Use DataType class
mpsonntag Jul 13, 2018
1531c37
[sec/prop] Remove usage of Value class
mpsonntag Jul 13, 2018
de48bd8
[test] Fix sec/prop tests after Value removal
mpsonntag Jul 13, 2018
db7d971
[section] Fix create value bug
mpsonntag Jul 13, 2018
af9f228
[sec/prop] Cleanup naming after Value removal
mpsonntag Jul 13, 2018
f1d76cb
[test] Update xcompat tests to post-nix1.4
achilleas-k Jul 13, 2018
400fde7
[property] Remove mapping
mpsonntag Jul 13, 2018
98cf1ff
[section] Remove mapping
mpsonntag Jul 13, 2018
020b06e
[test] Cleanup nix_comp test after mapping removal
mpsonntag Jul 13, 2018
6905355
[travis] build against master
mpsonntag Jul 13, 2018
b411c27
[property] Reorder OdmlType
mpsonntag Jul 16, 2018
212ecd9
[property] Code cleanup
mpsonntag Jul 16, 2018
4cabc6e
[file] Warn if old 'backend' arg is specified
achilleas-k Jul 16, 2018
f0eae96
[section] Code cleanup
mpsonntag Jul 16, 2018
6b56433
[datatype] Code cleanup
mpsonntag Jul 16, 2018
5632d81
[property] Refactor OdmlType class
mpsonntag Jul 17, 2018
cb87daa
[property] Update OdmlType compatible comparisons
mpsonntag Jul 17, 2018
d849524
[property] Switch uncertainty from int to Number
mpsonntag Jul 17, 2018
b10ae8f
[init] Expose new OdmlType class
mpsonntag Jul 17, 2018
76d09a3
[property] Update OdmlType docstrings
mpsonntag Jul 17, 2018
128d901
[section] Remove obsolete ProxyList methods
mpsonntag Jul 17, 2018
0e9059b
Add me to LICENSE file
achilleas-k Jul 18, 2018
2ea84d5
[file] __enter__ and __exit__ methods for context
achilleas-k Jul 18, 2018
8a8a614
[test] Open file using 'with' statement
achilleas-k Jul 18, 2018
0a24c40
[section] Convert single-value strings to list as well
achilleas-k Jul 18, 2018
e2e99f0
[section] Don't write data twice when setting item
achilleas-k Jul 18, 2018
9c3742b
[test] section.create_property() with all types
achilleas-k Jul 18, 2018
bedaa1d
[test] Clean out old property tests
achilleas-k Jul 18, 2018
b69f83c
Column width and string formatting changes for consistency
achilleas-k Jul 18, 2018
eddc495
[test] Small test for empty properties
achilleas-k Jul 18, 2018
61d0b05
Check property values against Iterable for numpy
achilleas-k Jul 18, 2018
304a6bd
Value setter: special string case
achilleas-k Jul 19, 2018
7ab7c40
More accurate error for inconsistent value setting in props
achilleas-k Jul 19, 2018
ec66ae5
[appveyor] Disable NIX download and build for now
achilleas-k Jul 20, 2018
88f9522
[container] Better membership type testing
achilleas-k Jul 20, 2018
edd066d
[LinkContainer] Check type for contains function
achilleas-k Jul 20, 2018
e99a6e3
[test] Bad appends and checks for container classes
achilleas-k Jul 20, 2018
6ab2d03
[test] Check for dangling references to deleted objects
achilleas-k Jul 20, 2018
9933a5c
[file] Minor pep8 docstring wrap
achilleas-k Jul 23, 2018
f6b0be9
[test] Separate reference cleanup tests
achilleas-k Jul 23, 2018
3b784ea
Reference for underlying h5object
achilleas-k Jul 23, 2018
5de571f
[h5group] Fix find_children limit and filtr
achilleas-k Jul 23, 2018
cfcae06
[test] Delete {Multi}Tag references on object del
achilleas-k Jul 24, 2018
f570998
[Container,H5Group] Recursively delete all references to obj
achilleas-k Jul 23, 2018
b487980
[MultiTag] Throw useful error when positions are deleted
achilleas-k Jul 24, 2018
d40785f
More correct but more inefficient delete_all method
achilleas-k Jul 24, 2018
ed64ccb
[H5Group] Faster delete_all
achilleas-k Jul 24, 2018
3a4a706
New test: Delete sources and check references
achilleas-k Jul 25, 2018
517f4c9
New test: Delete Sections and check metadata references
achilleas-k Jul 25, 2018
7b70440
Subclass Container for Sections and Sources
achilleas-k Jul 25, 2018
a1690ea
New test: Delete feature data from Block
achilleas-k Jul 25, 2018
32530e5
[test] Context open testfile in tmpdir
achilleas-k Jul 25, 2018
a075e94
[feature] Throw more meaningful error if data deleted
achilleas-k Jul 25, 2018
2528b2a
[travis] Disable -nauto for coveralls build
achilleas-k Jul 25, 2018
6ad082f
[travis] Report to coveralls on success
achilleas-k Jul 25, 2018
6ada27d
[test] Section linking and inherited properties
achilleas-k Jul 26, 2018
237a545
[Section] Bug fix for nested lists in inherited_props
achilleas-k Jul 26, 2018
3445ca1
New test: Delete Sections and check Section.link
achilleas-k Jul 26, 2018
0c55f19
New test: All compression setting combinations
achilleas-k Jul 26, 2018
14e503d
Minor docstring typo fix
achilleas-k Jul 31, 2018
ee11186
[dimensions] Bugfix: Set .index properly on __init__
achilleas-k Aug 8, 2018
b025ff0
[travis,appveyor] Add Python 3.7 to the mix
achilleas-k Sep 13, 2018
34562f6
[setup] Update language versions
achilleas-k Sep 13, 2018
3dde022
[dorelease] Don't validate version
achilleas-k Sep 13, 2018
48f1561
[compile] Two step compile+link for xcompat tests
achilleas-k Sep 14, 2018
0e47075
[travis] xenial & sudo required for Python 3.7
achilleas-k Sep 14, 2018
ab427c7
[section] Default type="undefined"
achilleas-k Sep 22, 2018
ba7f1dd
Fix compression flag handling
achilleas-k Jul 26, 2018
ca0f259
[dimensions] Allow "labels" to be resized in SetDimension
achilleas-k Sep 23, 2018
111c699
[dimensions] Allow "ticks" to be resized in RangeDimension
achilleas-k Sep 23, 2018
40bfc1c
[DataArray] Initialise dim attributes on append
achilleas-k Sep 23, 2018
627bc09
add pprint function for no-bindings-dev
hkchekc Sep 23, 2018
6688c76
no-bindings-dev section pprint
hkchekc Sep 23, 2018
8050426
remove id-printing for pprint() for section
hkchekc Sep 23, 2018
d4f7106
writing basic API
hkchekc Sep 6, 2018
5ff2b58
basic structure of dataframe obj
hkchekc Sep 10, 2018
6984edc
adding create function to Block
hkchekc Sep 11, 2018
2a033a1
basic dataframe model done
hkchekc Sep 12, 2018
c3a04f1
row as obj
hkchekc Sep 17, 2018
bde37eb
adding properties and ordereddict
hkchekc Sep 20, 2018
789d464
finish write_cell
hkchekc Sep 21, 2018
8ccffb2
loop to write columns
hkchekc Oct 2, 2018
0a53627
implicitly tranform md nparrays to tuple arrays
hkchekc Oct 2, 2018
db40895
Correct the asserts and misplaced exceptions
hkchekc Oct 2, 2018
5d364bf
support multiple cols reading
hkchekc Oct 8, 2018
6a86cd0
r/w rows also support multiple entries at once
hkchekc Oct 8, 2018
f7adde0
append_rows works
hkchekc Oct 8, 2018
be6c9e8
experiment on append_column
hkchekc Oct 8, 2018
2c23f97
[test] Disable unfinished tests for now
achilleas-k Oct 10, 2018
d158e69
validator for No bindings dev branch (#322)
hkchekc Oct 10, 2018
f874ea1
printing table
hkchekc Oct 10, 2018
465144a
add table format printing function
hkchekc Oct 11, 2018
e37488e
[MultiTag] Fix for retrieve_data with 1D pos
achilleas-k Oct 11, 2018
71f4017
write_to_csv bug
hkchekc Oct 19, 2018
920ed01
add a columns property
hkchekc Oct 22, 2018
5c0f6c0
[property] Force "uncertainty" to float
achilleas-k Sep 23, 2018
ce4effd
create_dataframe supporting name+dtype list as param
hkchekc Oct 29, 2018
6b6cd37
append_col functional and fix bug of df_name on creation
hkchekc Oct 29, 2018
589a391
skip test to pass CI
hkchekc Oct 29, 2018
5b6570a
[travis] Install numpy through homebrew on macOS
achilleas-k Oct 26, 2018
b22f51f
Change collections ABC imports to new module
achilleas-k Oct 26, 2018
281675b
PEP8 fixes, clear unused variables, and remove star imports
achilleas-k Oct 26, 2018
05f3d9f
unit.setter support single unit change
hkchekc Oct 31, 2018
8d98ce0
PEP8 fixes and cleanups
hkchekc Oct 31, 2018
0c6a061
validator for No bindings dev branch (#322)
hkchekc Oct 10, 2018
83ed8d0
[MultiTag] Fix for retrieve_data with 1D pos
achilleas-k Oct 11, 2018
88d2c63
Change collections ABC imports to new module
achilleas-k Oct 26, 2018
f20ad7b
PEP8 fixes, clear unused variables, and remove star imports
achilleas-k Oct 26, 2018
9a3db33
adding properties and cleanup class_attrs/ changing param name
hkchekc Nov 5, 2018
be6737c
[DataFrame] write_to_csv and write_to_pandas (#351)
hkchekc Nov 26, 2018
58df922
support create with list type data
hkchekc Nov 29, 2018
c33907f
allow data to be None in creation
hkchekc Nov 29, 2018
62fb7a0
del some redundancy
hkchekc Nov 29, 2018
99e6786
no param dtype
hkchekc Nov 29, 2018
e0300b0
cover all cond. of given param. / allow compound_arr as param
hkchekc Nov 30, 2018
24623d2
PEP8 fixes
hkchekc Nov 30, 2018
01333e7
fix bug when data is None
hkchekc Dec 6, 2018
8d1aaba
creation with data fix bug with str
hkchekc Dec 6, 2018
c708c95
fix bug if str in struct_arr
hkchekc Dec 6, 2018
e819e0b
some changes to the test
hkchekc Nov 5, 2018
9951b4f
changes after rebase
hkchekc Nov 9, 2018
40baaf5
write test_create_list & test_write_row
hkchekc Nov 9, 2018
5e474ab
fix bug in write_column L75 and write_rows index param is now mandatory
hkchekc Nov 9, 2018
602cbbe
change read_row to support nparrays and int indexing
hkchekc Nov 9, 2018
aa9c5df
write test for write_col and read_row
hkchekc Nov 9, 2018
f55e2db
add test for read_cell
hkchekc Nov 12, 2018
e2957c5
add test for write_cell
hkchekc Nov 12, 2018
9172fb5
add test for append_col
hkchekc Nov 12, 2018
741fd1a
add test for append_rows
hkchekc Nov 12, 2018
eff9cf6
fix df bugs/ add slice for read_col/ del df_shape setter/ app_col add…
hkchekc Nov 12, 2018
030a38c
add tests for properties
hkchekc Nov 12, 2018
d19125e
PEP8 fixes
hkchekc Nov 12, 2018
25ee891
change read_row() and super() in init
hkchekc Dec 10, 2018
5344c40
change int to int64 in test and conditional import collection abc
hkchekc Dec 10, 2018
08d9c8d
fixes for py2 tests. change majorly with Ordereddict and col_names/dt
hkchekc Dec 12, 2018
379346f
create test_df
hkchekc Dec 6, 2018
f1ec7c1
initial df compat test commit
hkchekc Dec 7, 2018
d33db22
add compat for attrs
hkchekc Dec 7, 2018
60f7518
readrow compat
hkchekc Dec 7, 2018
91e0bd0
completed the read in CPP test
hkchekc Dec 10, 2018
1af0c5a
finish basic test write_in_cpp
hkchekc Dec 10, 2018
81f9ef4
PEP8 fixes
hkchekc Dec 10, 2018
8ec787a
PEP8 fixes and add warning to py2 user regarding create_with_dict
hkchekc Dec 13, 2018
bec7fcd
Fixed tutorial pages source (#359)
JiriVanek Jan 11, 2019
e130af1
Fix Dataframe bug with numpy strings
hkchekc Jan 14, 2019
6b42acd
[compile] Search both /usr and /usr/local by default
achilleas-k Jan 16, 2019
e18638f
Codestyle improvements and cleanup
achilleas-k Jan 16, 2019
20c86b9
Reimplementing force-compat test option
achilleas-k Jan 16, 2019
0572c55
Run compatibility tests only when requested
achilleas-k Jan 17, 2019
3d03ed8
Rebase cleanup
achilleas-k Jan 17, 2019
102cfb3
[MultiTag] Change extent behaviour to match NIX
achilleas-k Jan 17, 2019
6487b8f
[Tag] Change extent behaviour to match NIX
achilleas-k Jan 18, 2019
6de77cd
Merge pull request #361 from achilleas-k/dev15
jgrewe Jan 18, 2019
389edd7
Info update: Version bump, copyright, and brief
achilleas-k Jan 18, 2019
8dd3096
Merge remote-tracking branch 'gnode/master' into v1.5
achilleas-k Jan 21, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 21 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,25 @@ matrix:
- language: generic
os: osx
env: pymajor=2
addons:
homebrew:
packages:
- python2
- cmake
- cppunit
- hdf5
- numpy
- language: generic
os: osx
env: pymajor=3
addons:
homebrew:
packages:
- python3
- cmake
- cppunit
- hdf5
- numpy

addons:
apt:
Expand All @@ -40,15 +56,9 @@ before_install:
- export NIX_INCDIR=${nixprefix}/include/nixio-1.0
- export NIX_LIBDIR=${nixprefix}/lib
- export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:${nixprefix}/lib/pkgconfig
- if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
brew upgrade cmake;
brew install cppunit hdf5;
if [[ "${pymajor}" == "3" ]]; then
brew upgrade python${pymajor} || true;
else
alias pip2='pip';
fi;
fi
- alias pip2='pip'
- if [[ "${TRAVIS_OS_NAME}" != "osx" ]]; then pip${pymajor} install --upgrade numpy; fi
- pip${pymajor} install --upgrade coveralls h5py pytest-xdist;
- git clone --branch ${NIX_BRANCH} https://github.com/G-Node/nix /tmp/libnix
- pushd /tmp/libnix
- mkdir build
Expand All @@ -59,7 +69,6 @@ before_install:
- popd
- popd
- which pip${pymajor}
- pip${pymajor} install --upgrade --no-binary ":all:" numpy coveralls h5py pytest-xdist
- which python${pymajor}
- python${pymajor} --version

Expand All @@ -68,9 +77,9 @@ install:

script:
- if [[ "${coveralls}" == 1 ]]; then
coverage run --source=nixio setup.py test --addopts "--force-compat -s" && coverage report -m;
coverage run --source=nixio setup.py test --addopts "--nix-compat -s" && coverage report -m;
else
python${pymajor} setup.py test --addopts "--force-compat -s -nauto";
python${pymajor} setup.py test --addopts "--nix-compat -s -nauto";
fi

after_success:
Expand Down
34 changes: 29 additions & 5 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,30 @@
import pytest
import tempfile
from nixio.test.xcompat.compile import maketests


BINDIR = tempfile.mkdtemp(prefix="nixpy-tests-")


def pytest_addoption(parser):
parser.addoption("--force-compat",
action="store_true",
default=False,
help=("Force cross-compatibility tests. "
"Raise error instead of skipping."))
parser.addoption("--nix-compat", action="store_true", default=False,
help=("Run nix compatibility tests "
"(requires NIX library)"))


@pytest.fixture
def bindir(request):
return BINDIR


def pytest_collection_modifyitems(config, items):
if config.getoption("--nix-compat"):
print("Compiling NIX compatibility tests")
maketests(BINDIR)
return
skip_compat = pytest.mark.skip(
reason="Use --nix-compat option to run compatibility tests"
)
for item in items:
if "compatibility" in item.keywords:
item.add_marker(skip_compat)
22 changes: 13 additions & 9 deletions docs/source/examples/fileCreate.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,31 @@
file_name = 'file_create_example.h5'

# create a new file overwriting any existing content
file = nix.File.open(file_name, nix.FileMode.Overwrite)
print(file.format, file.version, file.created_at)
nixfile = nix.File.open(file_name, nix.FileMode.Overwrite)
print(nixfile.format, nixfile.version, nixfile.created_at)

# close file
file.close()
nixfile.close()

# re-open file for read-only access
file = nix.File.open(file_name, nix.FileMode.ReadOnly)
nixfile = nix.File.open(file_name, nix.FileMode.ReadOnly)

# this command will fail putting out HDF5 Errors
file.create_block("test block", "test")
try:
nixfile.create_block("test block", "test")
except ValueError:
print("Error caught: cannot create a new group in nix.FileMode.ReadOnly mode")

file.close()

nixfile.close()

# re-open for read-write access
file = nix.File.open(file_name, nix.FileMode.ReadWrite)
nixfile = nix.File.open(file_name, nix.FileMode.ReadWrite)

# the following command now works fine
file.create_block("test block", "test")
nixfile.create_block("test block", "test")

file.close()
nixfile.close()



Expand Down
15 changes: 8 additions & 7 deletions docs/source/examples/imageData.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""Copyright © 2014 German Neuroinformatics Node (G-Node)
"""
Copyright © 2014 German Neuroinformatics Node (G-Node)

All rights reserved.

Expand All @@ -13,8 +14,8 @@

This tutorial shows how to store image data in nix-files.
See https://github.com/G-node/nix/wiki for more information.
We use the "Lenna" image in this tutorial.

We use the "Lenna" image in this tutorial.

"Lenna" by Original full portrait: "Playmate of the Month". Playboy
Magazine. November 1972, photographed by Dwight Hooker.This 512x512
Expand All @@ -27,7 +28,7 @@

import nixio as nix
import numpy as np
import Image as img
from PIL import Image as img


def load_image():
Expand All @@ -43,7 +44,7 @@ def plot_data(data_array):
img_data = np.array(img_data, dtype='uint8')
new_img = img.fromarray(img_data)
new_img.show()


if __name__ == '__main__':
img_data, channels = load_image()
Expand All @@ -52,7 +53,7 @@ def plot_data(data_array):
file = nix.File.open(file_name, nix.FileMode.Overwrite)

# create a 'Block' that represents a grouping object. Here, the recording session.
# it gets a name and a type
# it gets a name and a type
block = file.create_block("block name", "nix.session")

# create a 'DataArray' to take the sinewave, add some information about the signal
Expand All @@ -64,7 +65,7 @@ def plot_data(data_array):
width_dim.label = "width"
color_dim = data.append_set_dimension()
color_dim.labels = channels

# let's plot the data from the stored information
plot_data(data)
file.close()
12 changes: 6 additions & 6 deletions docs/source/examples/imageWithMetadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

This tutorial shows how to store image data in nix-files.
See https://github.com/G-node/nix/wiki for more information.
We use the "Lenna" image in this tutorial.

We use the "Lenna" image in this tutorial.

"Lenna" by Original full portrait: "Playmate of the Month". Playboy
Magazine. November 1972, photographed by Dwight Hooker.This 512x512
Expand All @@ -27,7 +27,7 @@

import nixio as nix
import numpy as np
import Image as img
from PIL import Image as img
import matplotlib.pyplot as plt


Expand All @@ -49,7 +49,7 @@ def print_metadata_table(section, ax):
nrows, ncols = len(cell_text)+1, len(columns)
ax.axis('off')
the_table = ax.table(cellText=cell_text,
colLabels=columns,
colLabels=columns,
loc='center')
for cell in the_table.get_children():
cell.set_height(.075)
Expand All @@ -72,13 +72,13 @@ def plot_data(data_array):
fig = plt.figure()
img_axis = fig.add_subplot(121)
img_axis.imshow(new_img)

info_axis = fig.add_subplot(122)
print_metadata_table(data.metadata, info_axis)
fig.subplots_adjust(left=0.075, right=0.975, bottom=0.075, top=0.975)
fig.savefig('image_with_metadata.png')
fig.show()


def add_image_information(nix_file):
section = nix_file.create_section('Image metadata', 'image_source')
Expand Down
Binary file modified docs/source/examples/image_with_metadata.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/source/examples/irregularlySampledData.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@


def create_data(duration, interval):
times = np.around(np.cumsum(np.random.poisson(interval*1000, 1.5*duration/interval))/1000., 3)
times = np.around(np.cumsum(np.random.poisson(interval*1000, int(1.5*duration/interval)))/1000., 3)
times = times[times <= duration]
x = np.arange(0, times[-1] * 2 * np.pi, 0.001)
y = np.sin(5 * x)
Expand All @@ -31,7 +31,7 @@ def create_data(duration, interval):
def plot_data(data_array):
x_axis = data_array.dimensions[0]
x = list(x_axis.ticks)
y = data_array.data
y = data_array[:]
plt.plot(x, y, marker='o', color='dodgerblue')
plt.xlabel(x_axis.label + " [" + x_axis.unit + "]")
plt.ylabel(data_array.label + " [" + data_array.unit + "]")
Expand Down
8 changes: 4 additions & 4 deletions docs/source/examples/multipleROIs.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

import nixio as nix
import numpy as np
import Image as img
from PIL import Image as img
import matplotlib.pyplot as plt


Expand Down Expand Up @@ -64,7 +64,7 @@ def plot_roi_data(tag):
for p in range(position_count):
roi_data = tag.retrieve_data(p, 0)[:]
roi_data = np.array(roi_data, dtype='uint8')
ax = plt.gcf().add_subplot(position_count, 1, p)
ax = plt.gcf().add_subplot(position_count, 1, p+1)
image = img.fromarray(roi_data)
ax.imshow(image)
plt.savefig('retrieved_rois.png')
Expand Down Expand Up @@ -93,12 +93,12 @@ def plot_roi_data(tag):
color_dim.labels = channels

# some space for three regions-of-interest
roi_starts = np.zeros((3, 3))
roi_starts = np.zeros((3, 3), dtype=int)
roi_starts[0, :] = [250, 245, 0]
roi_starts[1, :] = [250, 315, 0]
roi_starts[2, :] = [340, 260, 0]

roi_extents = np.zeros((3, 3))
roi_extents = np.zeros((3, 3), dtype=int)
roi_extents[0, :] = [30, 45, 3]
roi_extents[1, :] = [30, 40, 3]
roi_extents[2, :] = [25, 65, 3]
Expand Down
Binary file modified docs/source/examples/multiple_time_series.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/examples/retrieved_rois.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 7 additions & 6 deletions docs/source/examples/singleROI.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

import nixio as nix
import numpy as np
import Image as img
from PIL import Image as img


def load_image():
Expand All @@ -49,8 +49,9 @@ def plot_data(tag):
img_data = np.zeros(data_array.data.shape)
data_array.data.read_direct(img_data)
img_data = np.array(img_data, dtype='uint8')
pos = tag.position
ext = tag.extent
# positions and extents are double by default, need to convert to int
pos = tuple(map(int, tag.position))
ext = tuple(map(int, tag.extent))
draw_rect(img_data, pos, ext)
new_img = img.fromarray(img_data)
new_img.show()
Expand All @@ -60,11 +61,11 @@ def plot_data(tag):
img_data, channels = load_image()
# create a new file overwriting any existing content
file_name = 'single_roi.h5'
file = nix.File.open(file_name, nix.FileMode.Overwrite)
f = nix.File.open(file_name, nix.FileMode.Overwrite)

# create a 'Block' that represents a grouping object. Here, the recording session.
# it gets a name and a type
block = file.create_block("block name", "nix.session")
block = f.create_block("block name", "nix.session")

# create a 'DataArray' to take the sinewave, add some information about the signal
data = block.create_data_array("lenna", "nix.image.rgb", data=img_data)
Expand All @@ -85,4 +86,4 @@ def plot_data(tag):

# let's plot the data from the stored information
plot_data(tag)
file.close()
f.close()
8 changes: 4 additions & 4 deletions docs/source/examples/spikeFeatures.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,20 @@ def fake_neuron(stepsize=0.001, offset=.8, sta_offset=100):
stimulus = np.random.randn(100000) * 2.5
b, a = signal.butter(8, 0.25)
stimulus = signal.filtfilt(b, a, stimulus)
lif_model = lif.lif(stepsize=stepsize, offset=offset)
lif_model = lif.LIF(stepsize=stepsize, offset=offset)
time, v, spike_times = lif_model.run_stimulus(stimulus)
snippets = np.zeros((len(spike_times), 2 * sta_offset))

for i,t in enumerate(spike_times):
index = round(t/stepsize)
for i, t in enumerate(spike_times):
index = int(round(t/stepsize))
if index < sta_offset:
snip = stimulus[0:index + sta_offset]
snippets[i, -len(snip):] = snip
elif (index + sta_offset) > len(stimulus):
snip = stimulus[index-sta_offset:]
snippets[i, 0:len(snip)] = snip
else:
snippets[i,:] = stimulus[index - sta_offset:index + sta_offset]
snippets[i, :] = stimulus[index - sta_offset:index + sta_offset]
return time, v, spike_times, snippets


Expand Down
2 changes: 1 addition & 1 deletion docs/source/examples/spikeTagging.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@


def fake_neuron():
lif_model = lif.lif()
lif_model = lif.LIF()
t, v, spike_times = lif_model.run_const_stim(10000, 0.005)
return t, v, spike_times

Expand Down
10 changes: 7 additions & 3 deletions docs/source/examples/untaggedFeature.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,17 @@

def fake_neuron(stepsize=0.001, offset=.8):
stimulus = np.random.randn(80000) * 2.5

b, a = signal.butter(8, 0.125)
stimulus = signal.filtfilt(b, a, stimulus)
stimulus = signal.filtfilt(b, a, stimulus[:])

s = np.hstack((np.zeros(10000), stimulus, np.zeros(10000)))
lif_model = lif.lif(stepsize=stepsize, offset=offset)
lif_model = lif.LIF(stepsize=stepsize, offset=offset)
time, v, spike_times = lif_model.run_stimulus(s)

stimulus_onset = 10000*stepsize
stimulus_duration = len(stimulus)*stepsize

return time, v, stimulus, stimulus_onset, stimulus_duration


Expand Down Expand Up @@ -77,7 +81,7 @@ def plot_data(tag):
stim_onset, color='silver', alpha=0.25, zorder=0, label="stimulus epoch")
response_axis.legend()

stimulus_axis.plot(stimulus_time, stimulus, color="slategray", label="stimulus")
stimulus_axis.plot(stimulus_time, stimulus[:], color="slategray", label="stimulus")
stimulus_axis.set_xlabel(stim_time_dim.label + ((" [" + stim_time_dim.unit + "]") if stim_time_dim.unit else ""))
stimulus_axis.set_ylabel(stimulus_array.label + ((" [" + stimulus_array.unit + "]") if stimulus_array.unit else ""))
stimulus_axis.set_xlim(np.min(stimulus_time), np.max(stimulus_time))
Expand Down
Loading