Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
f70c9cd
Added schemas Folder with __init__.py
JanNolten Nov 7, 2025
e007679
Added field_validator.py to group repeated validation
JanNolten Nov 7, 2025
ccac5cc
Added field_serializer.py to group repeated serialization
JanNolten Nov 7, 2025
11c2a35
added function_validator.py to validate elephant functions
JanNolten Nov 7, 2025
46ff38b
Added Pydantic Models for statistics
JanNolten Nov 7, 2025
5fb18dc
Added Pydantic Models for spike_train_correlation
JanNolten Nov 7, 2025
d5324bf
Added Pydantic Models for spike_train_synchrony
JanNolten Nov 7, 2025
c99b6c0
Original arguments are passed into the function
JanNolten Nov 7, 2025
cb533cc
Added pytest.ini to .gitignore
JanNolten Nov 7, 2025
71b7dc0
Added tests and option to skip validation
JanNolten Nov 7, 2025
7f4f5ef
Transfering Bug fixes
JanNolten Nov 7, 2025
b282cc3
Transfering Bug fixes
JanNolten Nov 7, 2025
9c3402a
Transfering Bug fixes
JanNolten Nov 7, 2025
ac00866
Implemented validation for statistics
JanNolten Nov 7, 2025
a95f9f8
Implemented validation for spike_train_correlation
JanNolten Nov 7, 2025
69745c2
Implemented validation for spike_train_synchrony
JanNolten Nov 7, 2025
460e9cd
Allowed some ValueErrors to also be TypeErrors
JanNolten Nov 7, 2025
bf9b837
Merge branch 'NeuralEnsemble:master' into feature/partial
JanNolten Nov 7, 2025
fac02e1
Removed ; at end of lines
JanNolten Nov 10, 2025
4fdd64a
Added Pydantic to requirements
JanNolten Nov 10, 2025
b5f0ff7
Merge branch 'NeuralEnsemble:master' into feature/partial
JanNolten Nov 11, 2025
7d933a4
Removed Self from typing, because it only works in python>=3.11.0
JanNolten Nov 11, 2025
932f1d4
Added ability to disable validation globally
JanNolten Nov 11, 2025
1f58b12
Allow t_start to be negative because it should be able to be used tha…
JanNolten Nov 11, 2025
6f2b7d3
Allowed all t_start and t_stop to be negative, becuase they could be …
JanNolten Nov 18, 2025
c46228d
Removed the option to skip validation with the extra kwargs not_valid…
JanNolten Nov 24, 2025
ae94ee6
Simplified test to make them more understandable
JanNolten Nov 24, 2025
ca247c0
Make test stricter by checking for the exact Error Type. Also Fixed Bugs
JanNolten Nov 24, 2025
91df787
Forgot to remove a print statement
JanNolten Nov 24, 2025
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
2 changes: 1 addition & 1 deletion elephant/test/test_spike_train_correlation.py
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,7 @@ def test_timescale_errors(self):

# Tau max with no units
tau_max = 1
self.assertRaises(ValueError,
self.assertRaises((ValueError, TypeError),
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the Pydantic Model is more specific, it sometimes raises a different error type than the function, so the test should allow both types

sc.spike_train_timescale, spikes_bin, tau_max)

# Tau max that is not a multiple of the binsize
Expand Down
6 changes: 3 additions & 3 deletions elephant/test/test_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ def test_lv_with_list(self):
def test_lv_raise_error(self):
seq = self.test_seq
self.assertRaises(ValueError, statistics.lv, [])
self.assertRaises(ValueError, statistics.lv, 1)
self.assertRaises((ValueError, TypeError), statistics.lv, 1)
self.assertRaises(ValueError, statistics.lv, np.array([seq, seq]))

def test_2short_spike_train(self):
Expand Down Expand Up @@ -430,7 +430,7 @@ def test_lvr_with_list(self):
def test_lvr_raise_error(self):
seq = self.test_seq
self.assertRaises(ValueError, statistics.lvr, [])
self.assertRaises(ValueError, statistics.lvr, 1)
self.assertRaises((ValueError, TypeError), statistics.lvr, 1)
self.assertRaises(ValueError, statistics.lvr, np.array([seq, seq]))
self.assertRaises(ValueError, statistics.lvr, seq, -1 * pq.ms)

Expand Down Expand Up @@ -478,7 +478,7 @@ def test_cv2_with_list(self):
def test_cv2_raise_error(self):
seq = self.test_seq
self.assertRaises(ValueError, statistics.cv2, [])
self.assertRaises(ValueError, statistics.cv2, 1)
self.assertRaises((ValueError, TypeError), statistics.cv2, 1)
self.assertRaises(ValueError, statistics.cv2, np.array([seq, seq]))


Expand Down