Describe the bug
When uploading EEG MAT data to a project, the sampling rate specified in "sampling rate (Hz)" field cannot be remembered, and fallbacks to 1.0s.
Steps to reproduce
- In project data structure viewer, open an upload window, and select "TimeSeries EEG MAT" tab
- Select a MAT-formatted data file, and set "sampling rate (Hz)" to 500
- Input other information
- Upload
- In project data structure viewer, click on the uploaded file
- The "DataTypeDetails" window says the Sample Period is 1.0 (s)
Expected results
The "DataTypeDetails" window should say the Sample Period is 0.002 (s)
Actual results
The "DataTypeDetails" window says the Sample Period is 1.0 (s)
Additional information
After checking the source code, I found the launch() function, defined in RegionTimeSeriesImporter class, did not register the sampling_rate property of view_model to the ts object. While the start_time property is registered.
I modified the launch() function, added 1 new line like the following code:
ts.start_time = view_model.start_time
ts.sample_period_unit = 's'
# Added by Picsell Dois
# Fix a problem which prevents the uploader from remembering sampling rate
ts.sample_period = 1.0 / view_model.sampling_rate
# EndOf: Added by Picsell Dois
After relaunching TVB, the sample rate can be remembered properly:

Describe the bug
When uploading EEG MAT data to a project, the sampling rate specified in "sampling rate (Hz)" field cannot be remembered, and fallbacks to 1.0s.
Steps to reproduce
Expected results
The "DataTypeDetails" window should say the Sample Period is 0.002 (s)
Actual results
The "DataTypeDetails" window says the Sample Period is 1.0 (s)
Additional information
After checking the source code, I found the
launch()function, defined inRegionTimeSeriesImporterclass, did not register thesampling_rateproperty ofview_modelto thetsobject. While thestart_timeproperty is registered.I modified the
launch()function, added 1 new line like the following code:After relaunching TVB, the sample rate can be remembered properly: