diff --git a/docs/gallery/general/plot_configurator.py b/docs/gallery/general/plot_configurator.py new file mode 100644 index 000000000..87d574b4f --- /dev/null +++ b/docs/gallery/general/plot_configurator.py @@ -0,0 +1,39 @@ +from pynwb import nwb_config +from datetime import datetime +from uuid import uuid4 + +import numpy as np +from dateutil import tz + +from pynwb import NWBHDF5IO, NWBFile, TimeSeries +from pynwb.behavior import Position, SpatialSeries +from pynwb.epoch import TimeIntervals +from pynwb.file import Subject + +session_start_time = datetime(2018, 4, 25, 2, 30, 3, tzinfo=tz.gettz("US/Pacific")) + +nwbfile = NWBFile( + session_description="Mouse exploring an open field", # required + identifier=str(uuid4()), # required + session_start_time=session_start_time, # required + session_id="session_1234", # optional + experimenter=[ + "Baggins, Bilbo", + ], # optional + lab="Bag End Laboratory", # optional + institution="University of My Institution", # optional + experiment_description="I went on an adventure to reclaim vast treasures.", # optional + related_publications="DOI:10.1016/j.neuron.2016.12.011", # optional +) + + +subject = Subject( + subject_id="001", + age="P90D", + description="mouse 5", + species="Mus musculus", + sex="M", +) + +nwbfile.subject = subject +breakpoint() diff --git a/out.txt b/out.txt new file mode 100644 index 000000000..b8b8ac878 --- /dev/null +++ b/out.txt @@ -0,0 +1,340 @@ +====================================================================== +2024-01-12 17:04:17,200 - INFO - running pynwb unit tests +test_init (unit.test_base.TestImage) ... test_images (unit.test_base.TestImages) ... test_add_data_interface (unit.test_base.TestProcessingModule) +Test adding a data interface to a ProcessingModule using add(...) and retrieving it. ... test_deprecated_add_container (unit.test_base.TestProcessingModule) ... test_deprecated_add_data_interface (unit.test_base.TestProcessingModule) ... test_deprecated_get_container (unit.test_base.TestProcessingModule) ... test_deprecated_get_data_interface (unit.test_base.TestProcessingModule) ... test_get_data_interface (unit.test_base.TestProcessingModule) +Test adding a data interface to a ProcessingModule and retrieving it using get(...). ... test_getitem (unit.test_base.TestProcessingModule) +Test adding a data interface to a ProcessingModule and retrieving it using __getitem__(...). ... test_init (unit.test_base.TestProcessingModule) +Test creating a ProcessingModule. ... test_bad_continuity_timeseries (unit.test_base.TestTimeSeries) ... test_conflicting_time_args (unit.test_base.TestTimeSeries) ... test_data_timeseries (unit.test_base.TestTimeSeries) +Test that setting a TimeSeries.data to another TimeSeries links the data correctly. ... test_dataio_dci_data (unit.test_base.TestTimeSeries) ... test_dataio_dci_timestamps (unit.test_base.TestTimeSeries) ... test_dataio_list_data (unit.test_base.TestTimeSeries) ... test_dataio_list_timestamps (unit.test_base.TestTimeSeries) ... test_dci_data (unit.test_base.TestTimeSeries) ... test_dci_data_arr (unit.test_base.TestTimeSeries) ... test_dci_timestamps (unit.test_base.TestTimeSeries) ... test_dci_timestamps_arr (unit.test_base.TestTimeSeries) ... test_dimension_warning (unit.test_base.TestTimeSeries) ... test_file_with_non_positive_rate_in_construct_mode (unit.test_base.TestTimeSeries) +Test that UserWarning is raised when rate is 0 or negative ... test_file_with_rate_and_timestamps_in_construct_mode (unit.test_base.TestTimeSeries) +Test that UserWarning is raised when rate and timestamps are both specified ... test_file_with_starting_time_and_timestamps_in_construct_mode (unit.test_base.TestTimeSeries) +Test that UserWarning is raised when starting_time and timestamps are both specified ... test_get_data_in_units (unit.test_base.TestTimeSeries) ... test_get_timestamps (unit.test_base.TestTimeSeries) ... test_good_continuity_timeseries (unit.test_base.TestTimeSeries) ... test_init_conversion_offset (unit.test_base.TestTimeSeries) ... test_init_data_timestamps (unit.test_base.TestTimeSeries) ... test_init_datalink_set (unit.test_base.TestTimeSeries) +Test creating a TimeSeries and that data_link is an empty set. ... test_init_no_parent (unit.test_base.TestTimeSeries) +Test creating an empty TimeSeries and that it has no parent. ... test_init_rate (unit.test_base.TestTimeSeries) ... test_init_timestampslink_set (unit.test_base.TestTimeSeries) +Test creating a TimeSeries and that timestamps_link is an empty set. ... test_no_starting_time (unit.test_base.TestTimeSeries) +Test that if no starting_time is given, 0.0 is assumed. ... test_no_time (unit.test_base.TestTimeSeries) ... test_non_positive_rate (unit.test_base.TestTimeSeries) ... test_timestamps_timeseries (unit.test_base.TestTimeSeries) +Test that setting a TimeSeries.timestamps to another TimeSeries links the timestamps correctly. ... test_check_types (unit.test_base.TestTimeSeriesReference) ... test_data_property (unit.test_base.TestTimeSeriesReference) ... test_data_property_bad_reference (unit.test_base.TestTimeSeriesReference) ... test_data_property_invalid_reference (unit.test_base.TestTimeSeriesReference) ... test_is_invalid (unit.test_base.TestTimeSeriesReference) ... test_is_valid (unit.test_base.TestTimeSeriesReference) ... test_is_valid_bad_index (unit.test_base.TestTimeSeriesReference) ... test_is_valid_no_num_samples (unit.test_base.TestTimeSeriesReference) ... test_timestamps_property (unit.test_base.TestTimeSeriesReference) ... test_timestamps_property_bad_reference (unit.test_base.TestTimeSeriesReference) ... test_timestamps_property_invalid_reference (unit.test_base.TestTimeSeriesReference) ... test_add_row (unit.test_base.TestTimeSeriesReferenceVectorData) ... test_add_row_get_length1_valid_data (unit.test_base.TestTimeSeriesReferenceVectorData) +Get data from a TimeSeriesReferenceVectorData with one element and valid data ... test_add_row_restricted_type (unit.test_base.TestTimeSeriesReferenceVectorData) ... test_add_row_with_bad_tuple (unit.test_base.TestTimeSeriesReferenceVectorData) ... test_add_row_with_plain_tuple (unit.test_base.TestTimeSeriesReferenceVectorData) ... test_append (unit.test_base.TestTimeSeriesReferenceVectorData) ... test_append_get_length1_valid_data (unit.test_base.TestTimeSeriesReferenceVectorData) +Get data from a TimeSeriesReferenceVectorData with one element and valid data ... test_append_restricted_type (unit.test_base.TestTimeSeriesReferenceVectorData) ... test_append_with_bad_tuple (unit.test_base.TestTimeSeriesReferenceVectorData) ... test_append_with_plain_tuple (unit.test_base.TestTimeSeriesReferenceVectorData) ... test_get_empty (unit.test_base.TestTimeSeriesReferenceVectorData) +Get data from an empty TimeSeriesReferenceVectorData ... test_get_length1_invalid_data (unit.test_base.TestTimeSeriesReferenceVectorData) +Get data from a TimeSeriesReferenceVectorData with one element and invalid data ... test_get_length5_valid_data (unit.test_base.TestTimeSeriesReferenceVectorData) +Get data from a TimeSeriesReferenceVectorData with 5 elements ... test_get_length5_with_invalid_data (unit.test_base.TestTimeSeriesReferenceVectorData) +Get data from a TimeSeriesReferenceVectorData with 5 elements ... test_init (unit.test_base.TestTimeSeriesReferenceVectorData) ... test_init (unit.test_behavior.BehavioralEpochsConstructor) ... test_init (unit.test_behavior.BehavioralEventsConstructor) ... test_init (unit.test_behavior.BehavioralTimeSeriesConstructor) ... test_init (unit.test_behavior.CompassDirectionConstructor) ... test_init (unit.test_behavior.EyeTrackingConstructor) ... test_init (unit.test_behavior.PositionConstructor) ... test_init (unit.test_behavior.PupilTrackingConstructor) ... test_gt_3_cols (unit.test_behavior.SpatialSeriesConstructor) ... test_init (unit.test_behavior.SpatialSeriesConstructor) ... test_set_unit (unit.test_behavior.SpatialSeriesConstructor) ... test_available_namespaces (unit.test_core.TestAvailableNamespaces) ... test_constructor (unit.test_core.TestNWBContainer) +Test constructor ... test_nwbfields (unit.test_core.TestNWBContainer) +Test that getters and setters work for nwbfields ... test_append_list (unit.test_core.TestNWBData) ... test_append_ndarray_2d (unit.test_core.TestNWBData) ... test_constructor (unit.test_core.TestNWBData) +Test constructor ... test_extend_list (unit.test_core.TestNWBData) ... test_extend_ndarray_1d (unit.test_core.TestNWBData) ... test_extend_ndarray_2d (unit.test_core.TestNWBData) ... test_print_file (unit.test_core.TestPrint) ... test_constructor (unit.test_core_NWBContainer.TestNWBContainer) +Test constructor ... test_nwbfields (unit.test_core_NWBContainer.TestNWBContainer) +Test that getters and setters work for nwbfields ... test_init (unit.test_device.TestDevice) ... test_init (unit.test_ecephys.ClusterWaveformsConstructor) ... test_init (unit.test_ecephys.ClusteringConstructor) ... test_dimensions_warning (unit.test_ecephys.ElectricalSeriesConstructor) ... test_init (unit.test_ecephys.ElectricalSeriesConstructor) ... test_invalid_data_shape (unit.test_ecephys.ElectricalSeriesConstructor) ... test_link (unit.test_ecephys.ElectricalSeriesConstructor) ... test_init (unit.test_ecephys.ElectrodeGroupConstructor) ... test_init_position_bad (unit.test_ecephys.ElectrodeGroupConstructor) ... test_init_position_none (unit.test_ecephys.ElectrodeGroupConstructor) ... test_init (unit.test_ecephys.EventDetectionConstructor) ... test_init (unit.test_ecephys.EventWaveformConstructor) ... test_init (unit.test_ecephys.FeatureExtractionConstructor) ... test_invalid_init_mismatched_description (unit.test_ecephys.FeatureExtractionConstructor) ... test_invalid_init_mismatched_description2 (unit.test_ecephys.FeatureExtractionConstructor) ... test_invalid_init_mismatched_electrodes (unit.test_ecephys.FeatureExtractionConstructor) ... test_invalid_init_mismatched_event_times (unit.test_ecephys.FeatureExtractionConstructor) ... test_add_electrical_series (unit.test_ecephys.FilteredEphysTest) ... test_init (unit.test_ecephys.FilteredEphysTest) ... test_add_electrical_series (unit.test_ecephys.LFPTest) ... test_init (unit.test_ecephys.LFPTest) ... test_incorrect_timestamps (unit.test_ecephys.SpikeEventSeriesConstructor) ... test_init (unit.test_ecephys.SpikeEventSeriesConstructor) ... test_no_rate (unit.test_ecephys.SpikeEventSeriesConstructor) ... test_dataframe_roundtrip (unit.test_epoch.TimeIntervalsTest) ... test_dataframe_roundtrip_drop_ts (unit.test_epoch.TimeIntervalsTest) ... test_from_dataframe (unit.test_epoch.TimeIntervalsTest) ... test_from_dataframe_missing_required_cols (unit.test_epoch.TimeIntervalsTest) ... test_from_dataframe_missing_supplied_col (unit.test_epoch.TimeIntervalsTest) ... test_init (unit.test_epoch.TimeIntervalsTest) ... test_no_tags (unit.test_epoch.TimeIntervalsTest) ... test_legacy_format (unit.test_epoch_legacy.TestTimeIntervalsIO) ... test_roundtrip (unit.test_epoch_legacy.TestTimeIntervalsIO) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (unit.test_epoch_legacy.TestTimeIntervalsIO) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_catch_dup_name (unit.test_extension.TestCatchDupNS) ... test_export (unit.test_extension.TestExtension) ... test_get_class (unit.test_extension.TestExtension) ... test_lab_meta (unit.test_extension.TestExtension) ... test_lab_meta_auto (unit.test_extension.TestExtension) ... test_load_namespace (unit.test_extension.TestExtension) ... test_load_namespace_with_reftype_attribute (unit.test_extension.TestExtension) ... test_load_namespace_with_reftype_attribute_check_autoclass_const (unit.test_extension.TestExtension) ... test_access_group_after_io (unit.test_file.NWBFileTest) +Motivated by #739 ... test_access_processing (unit.test_file.NWBFileTest) ... test_add_acquisition (unit.test_file.NWBFileTest) ... test_add_acquisition_check_dups (unit.test_file.NWBFileTest) ... test_add_acquisition_invalid_name (unit.test_file.NWBFileTest) ... test_add_analysis (unit.test_file.NWBFileTest) ... test_add_electrode (unit.test_file.NWBFileTest) ... test_add_electrode_missing_group (unit.test_file.NWBFileTest) +Test the case where the user creates an electrode table region with ... test_add_electrode_missing_location (unit.test_file.NWBFileTest) +Test the case where the user creates an electrode table region with ... test_add_electrode_some_opt (unit.test_file.NWBFileTest) ... test_add_invalid_time_interval (unit.test_file.NWBFileTest) ... test_add_invalid_time_w_ts (unit.test_file.NWBFileTest) ... test_add_invalid_times_column (unit.test_file.NWBFileTest) ... test_add_stimulus (unit.test_file.NWBFileTest) ... test_add_stimulus_template (unit.test_file.NWBFileTest) ... test_add_stimulus_template_images (unit.test_file.NWBFileTest) ... test_add_trial (unit.test_file.NWBFileTest) ... test_add_trial_column (unit.test_file.NWBFileTest) ... test_add_unit (unit.test_file.NWBFileTest) ... test_add_unit_column (unit.test_file.NWBFileTest) ... test_all_children (unit.test_file.NWBFileTest) ... test_constructor (unit.test_file.NWBFileTest) ... test_copy (unit.test_file.NWBFileTest) ... test_create_custom_intervals (unit.test_file.NWBFileTest) ... test_create_electrode_group (unit.test_file.NWBFileTest) ... test_create_electrode_group_invalid_index (unit.test_file.NWBFileTest) +Test the case where the user creates an electrode table region with ... test_epoch_tags (unit.test_file.NWBFileTest) ... test_fail_if_source_script_file_name_without_source_script (unit.test_file.NWBFileTest) ... test_get_acquisition_empty (unit.test_file.NWBFileTest) ... test_get_acquisition_multiple_elements (unit.test_file.NWBFileTest) ... test_get_neurodata_type (unit.test_file.NWBFileTest) ... test_multi_experimenters (unit.test_file.NWBFileTest) ... test_multi_publications (unit.test_file.NWBFileTest) ... test_print_units (unit.test_file.NWBFileTest) ... test_set_electrode_table (unit.test_file.NWBFileTest) ... test_age_reference_arg_check (unit.test_file.SubjectTest) ... test_age_regression_1 (unit.test_file.SubjectTest) ... test_age_regression_2 (unit.test_file.SubjectTest) ... test_constructor (unit.test_file.SubjectTest) ... test_nwbfile_constructor (unit.test_file.SubjectTest) ... test_subject_age_duration (unit.test_file.SubjectTest) ... test_weight_float (unit.test_file.SubjectTest) ... test_simple (unit.test_file.TestCacheSpec) ... test_simple (unit.test_file.TestNoCacheSpec) ... test_reftime_tzaware (unit.test_file.TestTimestampsRefAware) ... test_reftime_default (unit.test_file.TestTimestampsRefDefault) ... test_raise_warning__add_missing_timezone (unit.test_file.TestTimezone) ... test_init (unit.test_icephys.CurrentClampSeriesConstructor) ... test_unit_warning (unit.test_icephys.CurrentClampSeriesConstructor) ... test_init (unit.test_icephys.CurrentClampStimulusSeriesConstructor) ... test_unit_warning (unit.test_icephys.CurrentClampStimulusSeriesConstructor) ... test_init (unit.test_icephys.IZeroClampSeriesConstructor) ... test_stim_desc_warning (unit.test_icephys.IZeroClampSeriesConstructor) ... test_unit_warning (unit.test_icephys.IZeroClampSeriesConstructor) ... test_constructor (unit.test_icephys.IntracellularElectrodeConstructor) ... test_add_ic_electrode_deprecation (unit.test_icephys.NWBFileICEphys) ... test_create_ic_electrode_deprecation (unit.test_icephys.NWBFileICEphys) ... test_ic_electrodes_attribute_deprecation (unit.test_icephys.NWBFileICEphys) ... test_ic_electrodes_parameter_deprecation (unit.test_icephys.NWBFileICEphys) ... test_icephys_electrodes_parameter (unit.test_icephys.NWBFileICEphys) ... test_sweep_table_depractation_warn (unit.test_icephys.NWBFileICEphys) ... test_data_shape (unit.test_icephys.PatchClampSeriesConstructor) ... test_default (unit.test_icephys.PatchClampSeriesConstructor) ... test_sweepNumber_large_and_valid (unit.test_icephys.PatchClampSeriesConstructor) ... test_sweepNumber_throws_with_Float (unit.test_icephys.PatchClampSeriesConstructor) ... test_sweepNumber_throws_with_NaN (unit.test_icephys.PatchClampSeriesConstructor) ... test_sweepNumber_throws_with_negative (unit.test_icephys.PatchClampSeriesConstructor) ... test_sweepNumber_valid (unit.test_icephys.PatchClampSeriesConstructor) ... test_sweepNumber_valid_np (unit.test_icephys.PatchClampSeriesConstructor) ... test_init (unit.test_icephys.VoltageClampSeriesConstructor) ... test_unit_warning (unit.test_icephys.VoltageClampSeriesConstructor) ... test_init (unit.test_icephys.VoltageClampStimulusSeriesConstructor) ... test_unit_warning (unit.test_icephys.VoltageClampStimulusSeriesConstructor) ... test_basic_write (unit.test_icephys_metadata_tables.ExperimentalConditionsTableTests) +Populate, write, and read the ExperimentalConditionsTable container and other required containers ... test_enforce_unique_id (unit.test_icephys_metadata_tables.ExperimentalConditionsTableTests) +Test to ensure that unique ids are enforced on RepetitionsTable table ... test_init (unit.test_icephys_metadata_tables.ExperimentalConditionsTableTests) +Test __init__ to make sure we can instantiate the ExperimentalConditionsTable container ... test_missing_repetitions_on_init (unit.test_icephys_metadata_tables.ExperimentalConditionsTableTests) +Test that ValueError is raised when repetitions is missing. This is ... test_add_column (unit.test_icephys_metadata_tables.IntracellularRecordingsTableTests) ... test_add_row (unit.test_icephys_metadata_tables.IntracellularRecordingsTableTests) ... test_add_row_check_start_index_and_index_count_are_fixed (unit.test_icephys_metadata_tables.IntracellularRecordingsTableTests) ... test_add_row_incompatible_types (unit.test_icephys_metadata_tables.IntracellularRecordingsTableTests) ... test_add_row_index_out_of_range (unit.test_icephys_metadata_tables.IntracellularRecordingsTableTests) ... test_add_row_no_response (unit.test_icephys_metadata_tables.IntracellularRecordingsTableTests) ... test_add_row_no_stimulus (unit.test_icephys_metadata_tables.IntracellularRecordingsTableTests) ... test_add_row_no_stimulus_and_response (unit.test_icephys_metadata_tables.IntracellularRecordingsTableTests) ... test_basic_write (unit.test_icephys_metadata_tables.IntracellularRecordingsTableTests) +Populate, write, and read the SimultaneousRecordingsTable container and other required containers ... test_enforce_unique_id (unit.test_icephys_metadata_tables.IntracellularRecordingsTableTests) +Test to ensure that unique ids are enforced on RepetitionsTable table ... test_error_if_IZeroClampSeries_with_stimulus (unit.test_icephys_metadata_tables.IntracellularRecordingsTableTests) ... test_inconsistent_PatchClampSeries (unit.test_icephys_metadata_tables.IntracellularRecordingsTableTests) ... test_init (unit.test_icephys_metadata_tables.IntracellularRecordingsTableTests) ... test_no_electrode (unit.test_icephys_metadata_tables.IntracellularRecordingsTableTests) ... test_noerror_if_IZeroClampSeries (unit.test_icephys_metadata_tables.IntracellularRecordingsTableTests) ... test_round_trip_container_no_data (unit.test_icephys_metadata_tables.IntracellularRecordingsTableTests) +Test read and write the container by itself ... test_to_dataframe (unit.test_icephys_metadata_tables.IntracellularRecordingsTableTests) ... test_write_with_stimulus_template (unit.test_icephys_metadata_tables.IntracellularRecordingsTableTests) +Populate, write, and read the SimultaneousRecordingsTable container and other required containers ... test_add_icephys_meta_full_roundtrip (unit.test_icephys_metadata_tables.NWBFileTests) +This test adds all data and then constructs step-by-step the full table structure ... test_deprecate_simultaneous_recordings_on_add_stimulus (unit.test_icephys_metadata_tables.NWBFileTests) +Test that warnings are raised if the user tries to use a simultaneous_recordings table ... test_deprecate_sweepstable_on_add_acquistion (unit.test_icephys_metadata_tables.NWBFileTests) +Test that warnings are raised if the user tries to use a sweeps table ... test_deprecate_sweepstable_on_init (unit.test_icephys_metadata_tables.NWBFileTests) +Test that warnings are raised if the user tries to use a sweeps table ... test_deprecate_sweeptable_on_add_stimulus_template (unit.test_icephys_metadata_tables.NWBFileTests) +Make sure we warn when using the sweep-table ... test_deprectation_icephys_filtering_on_init (unit.test_icephys_metadata_tables.NWBFileTests) ... test_get_icephys_meta_parent_table (unit.test_icephys_metadata_tables.NWBFileTests) +Create the table hierarchy step-by-step and check that as we add tables the get_icephys_meta_parent_table ... test_icephys_filtering_roundtrip (unit.test_icephys_metadata_tables.NWBFileTests) ... test_basic_write (unit.test_icephys_metadata_tables.RepetitionsTableTests) +Populate, write, and read the RepetitionsTable container and other required containers ... test_enforce_unique_id (unit.test_icephys_metadata_tables.RepetitionsTableTests) +Test to ensure that unique ids are enforced on RepetitionsTable table ... test_init (unit.test_icephys_metadata_tables.RepetitionsTableTests) +Test __init__ to make sure we can instantiate the RepetitionsTable container ... test_missing_sequential_recordings_on_init (unit.test_icephys_metadata_tables.RepetitionsTableTests) +Test that ValueError is raised when sequential_recordings is missing. This is ... test_basic_write (unit.test_icephys_metadata_tables.SequentialRecordingsTableTests) +Populate, write, and read the SequentialRecordingsTable container and other required containers ... test_enforce_unique_id (unit.test_icephys_metadata_tables.SequentialRecordingsTableTests) +Test to ensure that unique ids are enforced on RepetitionsTable table ... test_init (unit.test_icephys_metadata_tables.SequentialRecordingsTableTests) +Test __init__ to make sure we can instantiate the SequentialRecordingsTable container ... test_missing_simultaneous_recordings_on_init (unit.test_icephys_metadata_tables.SequentialRecordingsTableTests) +Test that ValueError is raised when simultaneous_recordings is missing. This is ... test_add_simultaneous_recording (unit.test_icephys_metadata_tables.SimultaneousRecordingsTableTests) +Populate, write, and read the SimultaneousRecordingsTable container and other required containers ... test_basic_write (unit.test_icephys_metadata_tables.SimultaneousRecordingsTableTests) +Populate, write, and read the SimultaneousRecordingsTable container and other required containers ... test_enforce_unique_id (unit.test_icephys_metadata_tables.SimultaneousRecordingsTableTests) +Test to ensure that unique ids are enforced on RepetitionsTable table ... test_init (unit.test_icephys_metadata_tables.SimultaneousRecordingsTableTests) +Test __init__ to make sure we can instantiate the SimultaneousRecordingsTable container ... test_missing_intracellular_recordings_on_init (unit.test_icephys_metadata_tables.SimultaneousRecordingsTableTests) +Test that ValueError is raised when intracellular_recordings is missing. This is ... test_init (unit.test_image.ImageMaskSeriesConstructor) ... test_data_no_frame (unit.test_image.ImageSeriesConstructor) ... test_data_no_unit (unit.test_image.ImageSeriesConstructor) ... test_dimension_warning (unit.test_image.ImageSeriesConstructor) +Test that a warning is raised when the dimensions of the data are not the ... test_dimension_warning_external_file_with_rate (unit.test_image.ImageSeriesConstructor) +Test that a warning is not raised when external file is used with rate. ... test_dimension_warning_external_file_with_timestamps (unit.test_image.ImageSeriesConstructor) +Test that a warning is not raised when external file is used with timestamps. ... test_external_file_default_format (unit.test_image.ImageSeriesConstructor) +Test that format is set to 'external' if not provided, when external_file is provided. ... test_external_file_no_frame (unit.test_image.ImageSeriesConstructor) ... test_external_file_no_unit (unit.test_image.ImageSeriesConstructor) ... test_external_file_with_correct_format (unit.test_image.ImageSeriesConstructor) +Test that warning is not raised when external_file is provided and format ... test_external_file_with_correct_starting_frame (unit.test_image.ImageSeriesConstructor) +Test that ValueError is not raised when the length of starting_frame ... test_external_file_with_data (unit.test_image.ImageSeriesConstructor) +Test that ValueError is raised when external_file is provided and ... test_external_file_with_data_construct_mode (unit.test_image.ImageSeriesConstructor) +Test that UserWarning is raised when external_file is provided and ... test_external_file_with_default_starting_frame (unit.test_image.ImageSeriesConstructor) +Test that starting_frame is set to [0] if not provided, when external_file is has length 1. ... test_external_file_with_incorrect_format (unit.test_image.ImageSeriesConstructor) +Test that ValueError is raised when external_file is provided but ... test_external_file_with_incorrect_format_construct_mode (unit.test_image.ImageSeriesConstructor) +Test that UserWarning is raised when external_file is provided but ... test_external_file_with_incorrect_starting_frame (unit.test_image.ImageSeriesConstructor) +Test that ValueError is raised when the length of starting_frame ... test_external_file_with_incorrect_starting_frame_construct_mode (unit.test_image.ImageSeriesConstructor) +Test that warning is raised when the length of starting_frame ... test_init (unit.test_image.ImageSeriesConstructor) ... test_no_data_no_file (unit.test_image.ImageSeriesConstructor) ... test_init (unit.test_image.IndexSeriesConstructor) ... test_init_bad_unit (unit.test_image.IndexSeriesConstructor) ... test_init_indexed_ts (unit.test_image.IndexSeriesConstructor) ... test_init (unit.test_image.OpticalSeriesConstructor) ... test_grayscale_image (unit.test_image.TestImageSubtypes) ... test_rgb_image (unit.test_image.TestImageSubtypes) ... test_rgba_image (unit.test_image.TestImageSubtypes) ... test_init (unit.test_misc.AbstractFeatureSeriesConstructor) ... test_init (unit.test_misc.AnnotationSeriesConstructor) ... test_init (unit.test_misc.DecompositionSeriesConstructor) ... test_init_delayed_bands (unit.test_misc.DecompositionSeriesConstructor) ... test_init_with_source_channels (unit.test_misc.DecompositionSeriesConstructor) ... test_add_interval (unit.test_misc.IntervalSeriesConstructor) ... test_init (unit.test_misc.IntervalSeriesConstructor) ... test_add_spike_times (unit.test_misc.UnitsTests) ... test_add_waveforms (unit.test_misc.UnitsTests) ... test_electrode_group (unit.test_misc.UnitsTests) ... test_get_obs_intervals (unit.test_misc.UnitsTests) ... test_get_spike_times (unit.test_misc.UnitsTests) ... test_get_spike_times_interval (unit.test_misc.UnitsTests) ... test_get_spike_times_multi (unit.test_misc.UnitsTests) ... test_get_spike_times_multi_interval (unit.test_misc.UnitsTests) ... test_init (unit.test_misc.UnitsTests) ... test_obs_intervals (unit.test_misc.UnitsTests) ... test_times (unit.test_misc.UnitsTests) ... test_times_and_intervals (unit.test_misc.UnitsTests) ... test_waveform_attrs (unit.test_misc.UnitsTests) ... test_init (unit.test_ogen.OptogeneticSeriesConstructor) ... test_init (unit.test_ophys.CorrectedImageStackConstructor) ... test_init (unit.test_ophys.DfOverFConstructor) ... test_init (unit.test_ophys.FluorescenceConstructor) ... test_init (unit.test_ophys.ImageSegmentationConstructor) ... test_conversion_deprecated (unit.test_ophys.ImagingPlaneConstructor) ... test_init (unit.test_ophys.ImagingPlaneConstructor) ... test_manifold_deprecated (unit.test_ophys.ImagingPlaneConstructor) ... test_unit_deprecated (unit.test_ophys.ImagingPlaneConstructor) ... test_init (unit.test_ophys.MotionCorrectionConstructor) ... test_init (unit.test_ophys.OnePhotonSeriesConstructor) ... test_negative_binning_assertion (unit.test_ophys.OnePhotonSeriesConstructor) ... test_init (unit.test_ophys.OpticalChannelConstructor) ... test_conversion_of_2d_image_mask_to_pixel_mask (unit.test_ophys.PlaneSegmentationConstructor) ... test_conversion_of_2d_pixel_mask_to_image_mask (unit.test_ophys.PlaneSegmentationConstructor) ... test_init (unit.test_ophys.PlaneSegmentationConstructor) ... test_init_3d_image_mask (unit.test_ophys.PlaneSegmentationConstructor) ... test_init_image_mask (unit.test_ophys.PlaneSegmentationConstructor) ... test_init_pixel_mask (unit.test_ophys.PlaneSegmentationConstructor) ... test_init_voxel_mask (unit.test_ophys.PlaneSegmentationConstructor) ... test_init (unit.test_ophys.RoiResponseSeriesConstructor) ... test_warnings (unit.test_ophys.RoiResponseSeriesConstructor) ... test_init (unit.test_ophys.TwoPhotonSeriesConstructor) ... test_constructor (unit.test_resources.TestNWBContainer) +Test constructor ... test_init (unit.test_retinotopy.AxisMapConstructor) +Test that AxisMap constructor sets properties correctly. ... test_init_dimension_wrong_shape (unit.test_retinotopy.AxisMapConstructor) +Test that creating an AxisMap with a dimension argument that is not 2 elements raises an error. ... test_init_fov_wrong_shape (unit.test_retinotopy.AxisMapConstructor) +Test that creating an AxisMap with a dimension argument that is not 2 elements raises an error. ... test_init (unit.test_retinotopy.FocalDepthImageConstructor) +Test that FocalDepthImage constructor sets properties correctly. ... test_init (unit.test_retinotopy.ImageRetinotopyConstructor) +Test that ImagingRetinotopy constructor sets properties correctly. ... test_init_axis_descriptions_wrong_shape (unit.test_retinotopy.ImageRetinotopyConstructor) +Test that creating a ImagingRetinotopy with a axis descriptions argument that is not 2 elements raises an ... test_init (unit.test_retinotopy.RetinotopyImageConstructor) +Test that RetinotopyImage constructor sets properties correctly. ... test_init_dimension_wrong_shape (unit.test_retinotopy.RetinotopyImageConstructor) +Test that creating a RetinotopyImage with a dimension argument that is not 2 elements raises an error. ... test_init_fov_wrong_shape (unit.test_retinotopy.RetinotopyImageConstructor) +Test that creating a RetinotopyImage with a field of view argument that is not 2 elements raises an error. ... test_init (unit.test_retinotopy.RetinotopyMapConstructor) +Test that RetinotopyMap constructor sets properties correctly. ... test_add_scratch_container (unit.test_scratch.TestScratchData) ... test_add_scratch_container_description (unit.test_scratch.TestScratchData) ... test_add_scratch_container_name (unit.test_scratch.TestScratchData) ... test_add_scratch_dataframe (unit.test_scratch.TestScratchData) ... test_add_scratch_dataframe_no_description (unit.test_scratch.TestScratchData) ... test_add_scratch_dynamictable (unit.test_scratch.TestScratchData) ... test_add_scratch_int (unit.test_scratch.TestScratchData) ... test_add_scratch_list (unit.test_scratch.TestScratchData) ... test_add_scratch_list_no_name (unit.test_scratch.TestScratchData) ... test_add_scratch_ndarray (unit.test_scratch.TestScratchData) ... test_add_scratch_ndarray_no_description (unit.test_scratch.TestScratchData) ... test_add_scratch_scratchdata (unit.test_scratch.TestScratchData) ... test_constructor_list (unit.test_scratch.TestScratchData) ... test_get_scratch_df_convert_false (unit.test_scratch.TestScratchData) ... test_get_scratch_list_convert_false (unit.test_scratch.TestScratchData) ... test_constructor (unit.test_spec.NWBNamespaceTest) ... test_constructor (unit.test_spec.NWBRefSpecTests) ... test_wrong_reference_type (unit.test_spec.NWBRefSpecTests) ... +---------------------------------------------------------------------- +Ran 343 tests in 38.620s + +OK +====================================================================== +2024-01-12 17:04:58,349 - INFO - running integration tests +test_roundtrip (integration.hdf5.test_base.TestImagesIO) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_base.TestImagesIO) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_base.TestTimeSeriesIO) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_base.TestTimeSeriesIO) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_timestamps_linking (integration.hdf5.test_base.TestTimeSeriesLinking) +Test that timestamps get linked to in TimeSeries ... test_roundtrip (integration.hdf5.test_device.TestDeviceIO) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_device.TestDeviceIO) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_ecephys.ClusterWaveformsConstructor) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_ecephys.ClusterWaveformsConstructor) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_ecephys.EventDetectionConstructor) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_ecephys.EventDetectionConstructor) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_ecephys.EventWaveformConstructor) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_ecephys.EventWaveformConstructor) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_ecephys.FeatureExtractionConstructor) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_ecephys.FeatureExtractionConstructor) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_ecephys.TestClusteringIO) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_ecephys.TestClusteringIO) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_eg_ref (integration.hdf5.test_ecephys.TestElectricalSeriesIO) +Test that the electrode DynamicTableRegion references of the read ElectricalSeries have a group that ... test_roundtrip (integration.hdf5.test_ecephys.TestElectricalSeriesIO) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_ecephys.TestElectricalSeriesIO) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_ecephys.TestElectrodeGroupIO) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_ecephys.TestElectrodeGroupIO) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_ecephys.TestFilteredEphysIO) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_ecephys.TestFilteredEphysIO) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_ecephys.TestLFPIO) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_ecephys.TestLFPIO) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_icephys.TestCurrentClampSeries) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_icephys.TestCurrentClampSeries) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_icephys.TestCurrentClampStimulusSeries) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_icephys.TestCurrentClampStimulusSeries) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_icephys.TestIZeroClampSeries) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_icephys.TestIZeroClampSeries) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_icephys.TestIntracellularElectrode) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_icephys.TestIntracellularElectrode) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_icephys.TestPatchClampSeries) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_icephys.TestPatchClampSeries) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_container (integration.hdf5.test_icephys.TestSweepTableRoundTripComplicated) +Test properties of the SweepTable read from file ... test_roundtrip (integration.hdf5.test_icephys.TestSweepTableRoundTripComplicated) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_icephys.TestSweepTableRoundTripComplicated) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_container (integration.hdf5.test_icephys.TestSweepTableRoundTripEasy) +Test properties of the SweepTable read from file ... test_roundtrip (integration.hdf5.test_icephys.TestSweepTableRoundTripEasy) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_icephys.TestSweepTableRoundTripEasy) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_icephys.TestVoltageClampSeries) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_icephys.TestVoltageClampSeries) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_icephys.TestVoltageClampStimulusSeries) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_icephys.TestVoltageClampStimulusSeries) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_image.TestImageSeriesIO) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_image.TestImageSeriesIO) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_image.TestOpticalSeriesIO) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_image.TestOpticalSeriesIO) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_append (integration.hdf5.test_io.TestAppend) ... test_electrode_id_uniqueness (integration.hdf5.test_io.TestAppend) ... test_gzip_timestamps (integration.hdf5.test_io.TestH5DataIO) ... test_write_dataset_custom_chunks (integration.hdf5.test_io.TestH5DataIO) ... test_write_dataset_custom_compress (integration.hdf5.test_io.TestH5DataIO) ... test_write_dataset_custom_fillvalue (integration.hdf5.test_io.TestH5DataIO) ... test_write_dataset_datachunkiterator_data_and_time (integration.hdf5.test_io.TestH5DataIO) ... test_write_dataset_datachunkiterator_data_only (integration.hdf5.test_io.TestH5DataIO) ... test_write_dataset_datachunkiterator_with_compression (integration.hdf5.test_io.TestH5DataIO) ... test_nwbio (integration.hdf5.test_io.TestHDF5Writer) ... test_write_cache_spec (integration.hdf5.test_io.TestHDF5Writer) +Round-trip test for writing spec and reading it back in ... test_write_clobber (integration.hdf5.test_io.TestHDF5Writer) ... test_write_no_cache_spec (integration.hdf5.test_io.TestHDF5Writer) +Round-trip test for not writing spec ... test_nwbio (integration.hdf5.test_io.TestHDF5WriterWithInjectedFile) ... test_write_cache_spec (integration.hdf5.test_io.TestHDF5WriterWithInjectedFile) +Round-trip test for writing spec and reading it back in ... test_write_clobber (integration.hdf5.test_io.TestHDF5WriterWithInjectedFile) ... test_check_nwb_version_missing_version (integration.hdf5.test_io.TestNWBHDF5IO) +Test reading of files with missing nwb_version ... test_check_nwb_version_ok (integration.hdf5.test_io.TestNWBHDF5IO) +Test that opening a current NWBFile passes the version check ... test_check_nwb_version_old_version (integration.hdf5.test_io.TestNWBHDF5IO) +Test reading of files with version less than 2 ... test_nwb_version_property (integration.hdf5.test_io.TestNWBHDF5IO) +Test reading of files with missing nwb_version ... test_round_trip_with_path_string (integration.hdf5.test_io.TestNWBHDF5IO) +Opening a NWBHDF5IO with a path string should work correctly ... test_round_trip_with_pathlib_path (integration.hdf5.test_io.TestNWBHDF5IO) +Opening a NWBHDF5IO with a pathlib path should correctly ... test_roundtrip (integration.hdf5.test_misc.TestDecompositionSeriesIO) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_misc.TestDecompositionSeriesIO) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_eg_ref (integration.hdf5.test_misc.TestDecompositionSeriesWithSourceChannelsIO) +Test that the electrode DynamicTableRegion references of the read ElectricalSeries have a group that ... test_roundtrip (integration.hdf5.test_misc.TestDecompositionSeriesWithSourceChannelsIO) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_misc.TestDecompositionSeriesWithSourceChannelsIO) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_misc.TestUnitsFileIO) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_misc.TestUnitsFileIO) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_to_dataframe (integration.hdf5.test_misc.TestUnitsFileIO) ... test_get_obs_intervals (integration.hdf5.test_misc.TestUnitsIO) +Test whether the Units observation intervals read from file are what was written ... test_get_spike_times (integration.hdf5.test_misc.TestUnitsIO) +Test whether the Units spike times read from file are what was written ... test_roundtrip (integration.hdf5.test_misc.TestUnitsIO) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_misc.TestUnitsIO) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_link_root (integration.hdf5.test_modular_storage.TestTimeSeriesModular) ... test_roundtrip (integration.hdf5.test_modular_storage.TestTimeSeriesModular) ... test_roundtrip (integration.hdf5.test_nwbfile.TestAddStimulusTemplateImages) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_nwbfile.TestAddStimulusTemplateImages) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_nwbfile.TestAddStimulusTemplateTimeSeries) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_nwbfile.TestAddStimulusTemplateTimeSeries) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_nwbfile.TestDynamicTableFromDataframeIO) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_nwbfile.TestDynamicTableFromDataframeIO) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_to_dataframe (integration.hdf5.test_nwbfile.TestDynamicTableFromDataframeIO) ... test_roundtrip (integration.hdf5.test_nwbfile.TestElectrodes) ... test_roundtrip_export (integration.hdf5.test_nwbfile.TestElectrodes) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_nwbfile.TestElectrodesOptColumns) ... test_roundtrip_export (integration.hdf5.test_nwbfile.TestElectrodesOptColumns) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_nwbfile.TestElectrodesRegion) ... test_roundtrip_export (integration.hdf5.test_nwbfile.TestElectrodesRegion) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_nwbfile.TestEmptySubjectIO) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_nwbfile.TestEmptySubjectIO) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_nwbfile.TestEpochsIO) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_nwbfile.TestEpochsIO) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_df_comparison (integration.hdf5.test_nwbfile.TestEpochsIODf) +Test that the epochs read from file converted to a data frame are the same as the data frame converted ... test_df_comparison_no_ts (integration.hdf5.test_nwbfile.TestEpochsIODf) +Test that the epochs read from file converted to a data frame are the same as the data frame converted ... test_roundtrip (integration.hdf5.test_nwbfile.TestEpochsIODf) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_nwbfile.TestEpochsIODf) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_nwbfile.TestExperimentersConstructorRoundtrip) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_nwbfile.TestExperimentersConstructorRoundtrip) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_nwbfile.TestExperimentersSetterRoundtrip) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_nwbfile.TestExperimentersSetterRoundtrip) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_nwbfile.TestInvalidTimes) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_nwbfile.TestInvalidTimes) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_children (integration.hdf5.test_nwbfile.TestNWBFileHDF5IO) +Test that the TimeSeries and processing module are children of their respective parents ... test_read (integration.hdf5.test_nwbfile.TestNWBFileHDF5IO) +Test reading the NWBFile using HDF5IO ... test_write (integration.hdf5.test_nwbfile.TestNWBFileHDF5IO) +Test writing the NWBFile using HDF5IO ... test_roundtrip (integration.hdf5.test_nwbfile.TestNWBFileIO) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_nwbfile.TestNWBFileIO) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_nwbfile.TestPublicationsConstructorRoundtrip) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_nwbfile.TestPublicationsConstructorRoundtrip) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_nwbfile.TestPublicationsSetterRoundtrip) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_nwbfile.TestPublicationsSetterRoundtrip) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_nwbfile.TestSubjectAgeReferenceNotSetIO) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_nwbfile.TestSubjectAgeReferenceNotSetIO) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_nwbfile.TestSubjectIO) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_nwbfile.TestSubjectIO) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_nwbfile.TestTrials) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_nwbfile.TestTrials) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_nwbfile.TestUnits) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_nwbfile.TestUnits) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_ogen.TestOptogeneticSeriesIO) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_ogen.TestOptogeneticSeriesIO) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_ogen.TestOptogeneticStimulusSiteIO) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_ogen.TestOptogeneticStimulusSiteIO) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_ophys.MaskIO) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_ophys.MaskIO) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_ophys.TestCorrectedImageStackIO) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_ophys.TestCorrectedImageStackIO) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_ophys.TestImageMaskIO) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_ophys.TestImageMaskIO) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_ophys.TestImagingPlaneIO) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_ophys.TestImagingPlaneIO) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_ophys.TestMotionCorrection) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_ophys.TestMotionCorrection) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_ophys.TestOnePhotonSeriesIO) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_ophys.TestOnePhotonSeriesIO) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_ophys.TestPixelMaskIO) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_ophys.TestPixelMaskIO) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_ophys.TestPlaneSegmentationIO) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_ophys.TestPlaneSegmentationIO) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_ophys.TestRoiResponseSeriesIO) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_ophys.TestRoiResponseSeriesIO) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_ophys.TestTwoPhotonSeriesIO) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_ophys.TestTwoPhotonSeriesIO) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_roundtrip (integration.hdf5.test_scratch.TestScratchDataIO) +Test whether the read Container has the same contents as the original Container and validate the file. ... test_roundtrip_export (integration.hdf5.test_scratch.TestScratchDataIO) +Test whether the test Container read from an exported file has the same contents as the original test Container ... test_scratch_container (integration.hdf5.test_scratch.TestScratchDataIO) ... test_scratch_convert_DataFrame_table_desc (integration.hdf5.test_scratch.TestScratchDataIO) +Test round trip convert of DataFrame with a table description ... test_scratch_convert_int (integration.hdf5.test_scratch.TestScratchDataIO) ... test_scratch_convert_list (integration.hdf5.test_scratch.TestScratchDataIO) ... test_scratch_convert_ndarray (integration.hdf5.test_scratch.TestScratchDataIO) ... +---------------------------------------------------------------------- +Ran 161 tests in 79.178s + +OK +====================================================================== +2024-01-12 17:06:17,586 - INFO - missing test case; should define in /Users/mavaylon/Research/NWB/pynwb/src/pynwb/core.py +====================================================================== +2024-01-12 17:06:17,586 - INFO - missing test case; should define in /Users/mavaylon/Research/NWB/pynwb/src/pynwb/core.py +====================================================================== +2024-01-12 17:06:17,586 - INFO - missing test case; should define in /Users/mavaylon/Research/NWB/pynwb/src/pynwb/core.py +====================================================================== +2024-01-12 17:06:17,586 - INFO - missing test case; should define in /Users/mavaylon/Research/NWB/pynwb/src/pynwb/base.py +====================================================================== +2024-01-12 17:06:17,586 - INFO - missing test case; should define in /Users/mavaylon/Research/NWB/pynwb/src/pynwb/base.py +====================================================================== +2024-01-12 17:06:17,586 - INFO - missing test case; should define in /Users/mavaylon/Research/NWB/pynwb/src/pynwb/base.py +====================================================================== +2024-01-12 17:06:17,586 - INFO - missing test case; should define in /Users/mavaylon/Research/NWB/pynwb/src/pynwb/base.py +====================================================================== +2024-01-12 17:06:17,586 - INFO - missing test case; should define in /Users/mavaylon/Research/NWB/pynwb/src/pynwb/ecephys.py +====================================================================== +2024-01-12 17:06:17,586 - INFO - missing test case; should define in /Users/mavaylon/Research/NWB/pynwb/src/pynwb/icephys.py +====================================================================== +2024-01-12 17:06:17,586 - INFO - missing test case; should define in /Users/mavaylon/Research/NWB/pynwb/src/pynwb/icephys.py +====================================================================== +2024-01-12 17:06:17,586 - INFO - missing test case; should define in /Users/mavaylon/Research/NWB/pynwb/src/pynwb/icephys.py +====================================================================== +2024-01-12 17:06:17,586 - INFO - missing test case; should define in /Users/mavaylon/Research/NWB/pynwb/src/pynwb/icephys.py +====================================================================== +2024-01-12 17:06:17,586 - INFO - missing test case; should define in /Users/mavaylon/Research/NWB/pynwb/src/pynwb/icephys.py +====================================================================== +2024-01-12 17:06:17,586 - INFO - missing test case; should define in /Users/mavaylon/Research/NWB/pynwb/src/pynwb/icephys.py +====================================================================== +2024-01-12 17:06:17,586 - INFO - missing test case; should define in /Users/mavaylon/Research/NWB/pynwb/src/pynwb/icephys.py +====================================================================== +2024-01-12 17:06:17,586 - INFO - missing test case; should define in /Users/mavaylon/Research/NWB/pynwb/src/pynwb/icephys.py +====================================================================== +2024-01-12 17:06:17,586 - INFO - missing test case; should define in /Users/mavaylon/Research/NWB/pynwb/src/pynwb/image.py +====================================================================== +2024-01-12 17:06:17,587 - INFO - missing test case; should define in /Users/mavaylon/Research/NWB/pynwb/src/pynwb/image.py +====================================================================== +2024-01-12 17:06:17,587 - INFO - missing test case; should define in /Users/mavaylon/Research/NWB/pynwb/src/pynwb/image.py +====================================================================== +2024-01-12 17:06:17,587 - INFO - missing test case; should define in /Users/mavaylon/Research/NWB/pynwb/src/pynwb/image.py +====================================================================== +2024-01-12 17:06:17,587 - INFO - missing test case; should define in /Users/mavaylon/Research/NWB/pynwb/src/pynwb/image.py +====================================================================== +2024-01-12 17:06:17,587 - INFO - missing test case; should define in /Users/mavaylon/Research/NWB/pynwb/src/pynwb/ophys.py +====================================================================== +2024-01-12 17:06:17,587 - INFO - missing test case; should define in /Users/mavaylon/Research/NWB/pynwb/src/pynwb/ophys.py +====================================================================== +2024-01-12 17:06:17,587 - INFO - missing test case; should define in /Users/mavaylon/Research/NWB/pynwb/src/pynwb/ophys.py +====================================================================== +2024-01-12 17:06:17,587 - INFO - missing test case; should define in /Users/mavaylon/Research/NWB/pynwb/src/pynwb/ophys.py +====================================================================== +2024-01-12 17:06:17,587 - INFO - missing test case; should define in /Users/mavaylon/Research/NWB/pynwb/src/pynwb/misc.py +====================================================================== +2024-01-12 17:06:17,587 - INFO - missing test case; should define in /Users/mavaylon/Research/NWB/pynwb/src/pynwb/misc.py +====================================================================== +2024-01-12 17:06:17,587 - INFO - missing test case; should define in /Users/mavaylon/Research/NWB/pynwb/src/pynwb/misc.py +====================================================================== +2024-01-12 17:06:17,587 - INFO - missing test case; should define in /Users/mavaylon/Research/NWB/pynwb/src/pynwb/file.py +====================================================================== +2024-01-12 17:06:17,587 - INFO - missing test case; should define in /Users/mavaylon/Research/NWB/pynwb/src/pynwb/behavior.py +====================================================================== +2024-01-12 17:06:17,587 - INFO - missing test case; should define in /Users/mavaylon/Research/NWB/pynwb/src/pynwb/behavior.py +====================================================================== +2024-01-12 17:06:17,587 - INFO - missing test case; should define in /Users/mavaylon/Research/NWB/pynwb/src/pynwb/behavior.py +====================================================================== +2024-01-12 17:06:17,587 - INFO - missing test case; should define in /Users/mavaylon/Research/NWB/pynwb/src/pynwb/behavior.py +====================================================================== +2024-01-12 17:06:17,587 - INFO - missing test case; should define in /Users/mavaylon/Research/NWB/pynwb/src/pynwb/behavior.py +====================================================================== +2024-01-12 17:06:17,587 - INFO - missing test case; should define in /Users/mavaylon/Research/NWB/pynwb/src/pynwb/behavior.py +====================================================================== +2024-01-12 17:06:17,587 - INFO - missing test case; should define in /Users/mavaylon/Research/NWB/pynwb/src/pynwb/behavior.py +====================================================================== +2024-01-12 17:06:17,587 - INFO - missing test case; should define in /Users/mavaylon/Research/NWB/pynwb/src/pynwb/behavior.py +====================================================================== +2024-01-12 17:06:17,587 - INFO - missing test case; should define in /Users/mavaylon/Research/NWB/pynwb/src/pynwb/retinotopy.py +====================================================================== +2024-01-12 17:06:17,588 - INFO - 38 classes missing integration tests in ui_write +====================================================================== +2024-01-12 17:06:17,588 - INFO - running integration utils tests +test_get_nwb_version (integration.utils.test_io_utils.TestGetNWBVersion) +Get the NWB version from a builder. ... test_get_nwb_version_20b (integration.utils.test_io_utils.TestGetNWBVersion) +Get the NWB version from a builder where version == "2.0b". ... test_get_nwb_version_missing (integration.utils.test_io_utils.TestGetNWBVersion) +Get the NWB version from a builder where the root builder does not have an nwb_version attribute. ... test_get_nwb_version_prerelease_false (integration.utils.test_io_utils.TestGetNWBVersion) +Get the NWB version from a builder. ... test_get_nwb_version_prerelease_true1 (integration.utils.test_io_utils.TestGetNWBVersion) +Get the NWB version from a builder. ... test_get_nwb_version_prerelease_true2 (integration.utils.test_io_utils.TestGetNWBVersion) +Get the NWB version from a builder. ... +---------------------------------------------------------------------- +Ran 6 tests in 0.002s + +OK +====================================================================== +2024-01-12 17:06:17,595 - INFO - running pynwb backwards compatibility tests +test_outer_import_structure (back_compat.test_import_structure.TestImportStructure) ... test_read (back_compat.test_read.TestReadOldVersions) +Test reading and validating all NWB files in the same folder as this file. ... test_read_imageseries_no_data (back_compat.test_read.TestReadOldVersions) +Test that an ImageSeries written without data is read with data set to the default value. ... test_read_imageseries_no_unit (back_compat.test_read.TestReadOldVersions) +Test that an ImageSeries written without unit is read with unit set to the default value. ... test_read_imageseries_non_external_format (back_compat.test_read.TestReadOldVersions) +Test that reading an ImageSeries with an inconsistent format does not change the value. ... test_read_imageseries_nonmatch_starting_frame (back_compat.test_read.TestReadOldVersions) +Test that reading an ImageSeries with an inconsistent starting_frame does not change the value. ... test_read_subject_no_age__reference (back_compat.test_read.TestReadOldVersions) +Test that reading a Subject without an age__reference set with NWB schema 2.5.0 sets the value to None ... test_read_timeseries_no_data (back_compat.test_read.TestReadOldVersions) +Test that a TimeSeries written without data is read with data set to the default value. ... test_read_timeseries_no_unit (back_compat.test_read.TestReadOldVersions) +Test that an ImageSeries written without unit is read with unit set to the default value. ... +---------------------------------------------------------------------- +Ran 9 tests in 5.491s + +OK +====================================================================== +2024-01-12 17:06:23,096 - INFO - Ran 519 tests - OK diff --git a/src/pynwb/__init__.py b/src/pynwb/__init__.py index 6e3b3104f..5ec617623 100644 --- a/src/pynwb/__init__.py +++ b/src/pynwb/__init__.py @@ -18,6 +18,35 @@ from .spec import NWBDatasetSpec, NWBGroupSpec, NWBNamespace # noqa E402 from .validate import validate # noqa: F401, E402 +from .termset_config import NWBTermSetConfigurator + + +nwb_config = NWBTermSetConfigurator(path='src/pynwb/config/nwb_config.yaml') + +@docval({'name': 'config_path', 'type': str, 'doc': 'Path to the configuartion file.', + 'default': None}) +def load_termset_config(config_path: str): + """ + If a user does not provide a config_path, then this method will unload any present configuration + and load the default curated configuration. + + If a user provides a config_path, then this method will: + - Search the current configuation for data_types that are already present. These data_types will be + replaced with the new configuration. + - If the data_type is not present, then they will be loaded alongside the default curated configuration. + """ + if config_path is None: + nwb_config.unload_termset_config() + nwb_config.load_termset_config() + else: + nwb_config.load_termset_config(config_path) + +def unload_termset_config(): + """ + Remove validation. + """ + return nwb_config.unload_termset_config() + def __get_resources(): try: diff --git a/src/pynwb/config/nwb_config.yaml b/src/pynwb/config/nwb_config.yaml new file mode 100644 index 000000000..ee08cd6ca --- /dev/null +++ b/src/pynwb/config/nwb_config.yaml @@ -0,0 +1,6 @@ +Subject: + namespace: + namespace_version: + fields: + species: src/pynwb/config/nwb_subject_termset.yaml + # field2: ... diff --git a/src/pynwb/config/nwb_subject_termset.yaml b/src/pynwb/config/nwb_subject_termset.yaml new file mode 100644 index 000000000..e952c6776 --- /dev/null +++ b/src/pynwb/config/nwb_subject_termset.yaml @@ -0,0 +1,27 @@ +id: termset/species_example +name: Species +version: 0.0.1 +prefixes: + NCBI_TAXON: https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?mode=Info&id= +imports: + - linkml:types +default_range: string + +enums: + Species: + permissible_values: + Homo sapiens: + description: the species is human + meaning: NCBI_TAXON:9606 + Mus musculus: + description: the species is a house mouse + meaning: NCBI_TAXON:10090 + Ursus arctos horribilis: + description: the species is a grizzly bear + meaning: NCBI_TAXON:116960 + Myrmecophaga tridactyla: + description: the species is an anteater + meaning: NCBI_TAXON:71006 + Ailuropoda melanoleuca: + description: the species is a panda + meaning: NCBI_TAXON:9646 diff --git a/src/pynwb/core.py b/src/pynwb/core.py index b54f3e147..a87dab2e6 100644 --- a/src/pynwb/core.py +++ b/src/pynwb/core.py @@ -46,6 +46,15 @@ def _error_on_new_warn_on_construct(self, error_msg: str): raise ValueError(error_msg) warn(error_msg) + def get_config(self): + from . import nwb_config #update path + return nwb_config + + def get_type_map(self): + from . import get_type_map + tm = get_type_map() + return tm + @register_class('NWBContainer', CORE_NAMESPACE) class NWBContainer(NWBMixin, Container): diff --git a/src/pynwb/file.py b/src/pynwb/file.py index b473e571a..23add12ea 100644 --- a/src/pynwb/file.py +++ b/src/pynwb/file.py @@ -109,6 +109,7 @@ class Subject(NWBContainer): {'name': 'strain', 'type': str, 'doc': 'The strain of the subject, e.g., "C57BL/6J"', 'default': None}, ) def __init__(self, **kwargs): + self.init_validation(constructor_args=kwargs) keys_to_set = ( "age", "age__reference", diff --git a/src/pynwb/nwb-schema b/src/pynwb/nwb-schema index b4f8838cb..65bb32356 160000 --- a/src/pynwb/nwb-schema +++ b/src/pynwb/nwb-schema @@ -1 +1 @@ -Subproject commit b4f8838cbfbb7f8a117bd7e0aad19133d26868b4 +Subproject commit 65bb3235688365b63eebe3126bfa4bc5d82487fb diff --git a/src/pynwb/termset_config.py b/src/pynwb/termset_config.py new file mode 100644 index 000000000..7ca0b497a --- /dev/null +++ b/src/pynwb/termset_config.py @@ -0,0 +1,12 @@ +from hdmf.term_set import TermSetConfigurator as hdmf_TermSetConfigurator +from hdmf.utils import docval + + +class NWBTermSetConfigurator(hdmf_TermSetConfigurator): + """ + + """ + @docval({'name': 'path', 'type': str, 'doc': 'Path to the configuartion file.', + 'default': 'src/pynwb/config/nwb_config.yaml'}) + def __init__(self,**kwargs): + super().__init__(**kwargs) diff --git a/tests/unit/test_config.py b/tests/unit/test_config.py new file mode 100644 index 000000000..a358b5a5a --- /dev/null +++ b/tests/unit/test_config.py @@ -0,0 +1,2 @@ +from pynwb import nwb_config +breakpoint()