Inspired by the complexity of Neo.
When browsing/inspecting an object, you want to collect all methods and attributes that match the key.
Browsing the documentation of
neo.io.BlackrockIO and looking for the ways of extracting
Epochs, you found
read_epoch() method. But calling this method raises
AssertionError. You need to go deeper.
pip install pinspect neo
- Download BlackRock sampledata.zip
wget http://www.blackrockmicro.com/wp-content/software/sampledata.zip unzip sampledata.zip
- In python,
from neo.io import BlackrockIO from pinspect import find session = BlackrockIO('sampleData') graph = find(session, 'epoch', verbose=True)
BlackrockIO.rescale_epoch_duration() -> 'TypeError' BlackrockIO.read_epoch() -> 'AssertionError' BlackrockIO._rescale_epoch_duration() -> 'TypeError' BlackrockIO.read().segments.epochs -> 'list of size 0' BlackrockIO.read().segments.events.to_epoch() -> 'Epoch'
The last two lines are candidates to explore manually.
You can pass
visualize=True and enjoy the beautiful
pyvis interactive graph rendering.
Hover over the nodes (objects) and edges (methods and attributes) to explore the graph in details and inspect how a particular object has been generated.
Below is the full unfiltered graph of
neo.BlackRockIO of all possible method and attribute calls. Can you find the green dot?
- Python 3.6+
Another package to inspect python variables is objbrowser.