How to use the morphio.test function in morphio

To help you get started, we’ve selected a few morphio examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github BlueBrain / MorphIO / tests / brain / python / synapses.py View on Github external
def setUp(self):
        self.circuit = morphio.Circuit(morphio.test.circuit_config)
        self.synapses = self.circuit.afferent_synapses([320])
github BlueBrain / MorphIO / tests / brain / python / compartmentReport.py View on Github external
# FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
# details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this library; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.


import setup
import morphio
import numpy
import unittest
from morphio import *

report_path = morphio.test.root_data_path + "/local/simulations/may17_2011/Control/voltage.h5"
all_compartments_report_path = morphio.test.root_data_path + "/local/simulations/may17_2011/Control/allCompartments.h5"


class TestMetaData(unittest.TestCase):
    def setUp(self):
        self.report = CompartmentReport(all_compartments_report_path)

    def test_metadata(self):
        metadata = self.report.metadata
        assert(metadata['data_unit'] == 'mV')
        assert(metadata['time_unit'] == 'ms')
        assert(metadata['start_time'] == 0.0)
        assert(metadata['end_time'] == 10.0)
        assert(numpy.isclose(metadata['time_step'], 0.1))
        assert(metadata['frame_count'] == 100)
        assert(self.report.cell_count == 35)
github BlueBrain / MorphIO / tests / brain / python / compartmentReport.py View on Github external
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
# details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this library; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.


import setup
import morphio
import numpy
import unittest
from morphio import *

report_path = morphio.test.root_data_path + "/local/simulations/may17_2011/Control/voltage.h5"
all_compartments_report_path = morphio.test.root_data_path + "/local/simulations/may17_2011/Control/allCompartments.h5"


class TestMetaData(unittest.TestCase):
    def setUp(self):
        self.report = CompartmentReport(all_compartments_report_path)

    def test_metadata(self):
        metadata = self.report.metadata
        assert(metadata['data_unit'] == 'mV')
        assert(metadata['time_unit'] == 'ms')
        assert(metadata['start_time'] == 0.0)
        assert(metadata['end_time'] == 10.0)
        assert(numpy.isclose(metadata['time_step'], 0.1))
        assert(metadata['frame_count'] == 100)
        assert(self.report.cell_count == 35)
github BlueBrain / MorphIO / tests / brain / python / spikes.py View on Github external
def setUp(self):
        self.filename = morphio.test.root_data_path + \
                        "/local/simulations/may17_2011/Control/out.spikes"