Skip to content

Commit

Permalink
Develop (#236)
Browse files Browse the repository at this point in the history
* HOTFIX updated alyx-matlab submodule

* Scale cleanup (#220)

* #219 fix for scale cleanup on error

* Update to CHANGELOG

* Support for remote error IDs

* Added test for StimulusControl and fixed err id in expServer test

* Mpep bind server test (#209)

* Started expServer tests

* Added more tests; bug fix for older versions

* Removed validation functions for old MATLAB versions; added documentation

* More coverage, documentation

* Draws text to screen during calibration #128

* Fix for #4

* Added structAssign test; rewardId tests

* Typo fix in structAssign_test

* Finished tests for expServer

* #156

* Returned listener delete to cleanup

* Stricter tolerance in AlyxPanel_test; bug fix for rounding negative numbers

* Update alyx-matlab submodule

* Minor changes to documentation

* Update CHANGELOG.md

* Added tests for tl.bindMpepServer and pnet spy

* Fixture path fix

* Moved audioDevices default to devices mock

* Assertion added #204

* paths template consistent with new cortexlab servers (#224)

* single-character change to README.md to test if I still have permission to push to dev (hopefully I don't)

* modified paths_template to be consistent with current cortexlab server settings

* Changes to server name vars in paths template

* ExpPanel updates (#221)

* Returned access restriction; started docs; Hiding info fields and comments box; cleaner subclassing

* Rethrow Signals update mismatch as warning, #72

* SqueakExpPanel -> SignalsExpPanel

* Removed code for very specific experiment that is no longer used

* Completed using_ExpPanel docs

* Formatting docs

* Issue #79

* Cleaned up UpdatesFilter

* documentation; changed plot colours

* Signals exp test (#231)

* Tiny changes to appease MATLAB

* Started installation section

* Added matlabdomain extension

* Added infomation for remote location in reposPath

* Started a setup page

* Added parameters walkthrough

* HOTFIX changed Alyx Panel login timer to 90 mins

* 2.3 <- 2.2.1 (#198)

* updated signals submodule

* updated signals submodule (eb71b1f)

* Added test for ensureCell

* Fix'd typo in ensureCell_test

* Future-proofing runall to ignore tests with specific hardware requirements

* Added tests for nop, iff and emptyElems

* Added tests for cellsprintf and num2cellstr; bug fix in num2cellstr

* Submodule update

* mapToCell test

* Removed complete todos

* Added test for dat.expExists

* Restore changes made in commit
247060a

* Expanded test for dispWaterReq

* assert -> verifyMatches

* Added catStructs test

* Added tabulateArgs test

* superSave test added

* added an informative error message in the case that dat.paths is missing

* Attempting to construct a branch that doesn't differ from dev in its submodules

* Revert "Attempting to construct a branch that doesn't differ from dev in its submodules"
Reverting a commit that should have been to dev_kevin, not to dev

* Revert "added an informative error message in the case that dat.paths is missing"
Reverting a commit that should have been to dev_kevin, not to dev
This reverts commit a492bd2.

* Added file package test

* Added test for pick

* Added test for namedArg

* Added varName test

* Added back tolerance change

* Dev kevin (#192)

* added an informative error message when dat.paths is not present

* added an identifier to the error message

* Added warnings and errors to deal with the case that hardware.mat is not found

* fixed identifier

* Changed error identifiers following Miles' suggestion of module:package:function:error

* added more info to error for empty rig

* added more info to no dat.paths error

* Bug fix in namedArg test

* Removed old function -> now a method of Alyx

* Started +fun package test; added fileFunction test

* No longer using 'which' to assert function existence

* Bug fixes for tests

* Bug fix for wiringInfo method

* Added KeyedSeq test

* Added docs for apply and applyForce

* Added loadVar test

* Issue #168

* Added mergeStructs test

* Added performance tests; reorganized tests; updated changelog

* Added parameters walkthrough

* Added timeline walkthrough; bug fix for wiringInfo in Timeline

* added informative error messages to calibration code

* Added documentation for setting up Window; documentation for Window class; Minor bug fixes

* Added a few examples to hardware docs

* Added Viewing model walkthrough and expanded FAQ

* Updated changelog

* Updates to docs

* Added test for +hw/calibrate.m

* deleted exp.construct

* Added documentation for calibration test

* Updated docs; added services guide

* Updates docs

* Fix for Communicator WTF mode; increased test coverage for iff

* Update to changelog and signals

* HOTFIX changed Alyx Panel login timer to 90 mins

* Removed readthedocs, updated submodules

* Update Shields

* HOTFIX: Correct location of docs in README; Stronger wording in install instructions

* Added issue templates (#179)

* Added troubleshooting docs and error id list

* Using signals error handling branch; added troubleshooting doc

* Re-factoring SignalsExp for test subclassing

* Started expServer tests

* Added more tests; bug fix for older versions

* Removed validation functions for old MATLAB versions; added documentation

* More coverage, documentation

* Draws text to screen during calibration #128

* Fix for #4

* Added structAssign test; rewardId tests

* Typo fix in structAssign_test

* Finished tests for expServer

* #156

* Returned listener delete to cleanup

* Stricter tolerance in AlyxPanel_test; bug fix for rounding negative numbers

* Update alyx-matlab submodule

* Minor changes to documentation

* Update CHANGELOG.md

* Added tests for tl.bindMpepServer and pnet spy

* Fixture path fix

* Moved audioDevices default to devices mock

* WIP

* #100 #202

* Updated tests with share fixtures; added pause/resume to SignalsExp; added further tests for SignalsExp; updated tests README; SessionURL fetched from database when necessary

* Added better update of keyboard input signal

* Potential fix for #213

* Updates to submodules

* Update to alyx-matlab

* Context menu for hiding event updates in ExpPenel

* trialCondition index can be reset with signal

* Improvements to test UI

* Documentation

* README for +eui package (#156)

* WIP

* Removed warning from updateLogEntry when Alyx deactivated #202

* Added hide option for ExpPanel; ExpPanel guide in docs

* Added utils; started docs

* #218

* Support for ids in errOnFail

* Removed old commented-out code

* Scale port closed on errors

* Added brief PTB install instructions (#228)

* cleanup

* Documentation; #229

* More flags for addRigboxPaths

* started updating README after Anwar's comments

* updated some instructions in README

* Revert "started updating README after Anwar's comments"

This reverts commit 9f5a456.

* Updated documentation

* Removed PTBDebug call and added example to docstring

* Update to CHANGELOG and signals

* #205 - refactored

* Update to tests

* Warning supression in tests

* CHANGELOG

Co-authored-by: Jai Bhagat <[email protected]>

* Fix for eui.ExpPanel/live input parse error and tests added (#239)

* Fix for eui.ExpPanel/live input parse error and tests added

* Updated CHANGELOG and tests Contents file

* Better handling of ExpDefs; Documentation updates

* Fix for selecting expDef from uigetfile

* Use erase instead of strrep (#238)

* Bug fix for updateParams on edit; update submodules

* Documentation (#237)

* Added troubleshooting to index

* Fixed external links in index

* Updated index version number

* Documented stimulusControllers and typo fix in MockDialog

* Documented tabulateArgs

* README and CONTRIBUTING

* Updated badges

* Ignore todos in html

* Param profiles test (#244)

* tests and documentation for *paramProfile functions; repos created when none exist

* CHANGELOG

* Info label format (#246)

* Added label format option to SignalsExpPanel

* CHANGELOG

* Documentation (#261)

* Typo fix; added acknowledgement; mentioned 2PCs in software req

* Generic paths template

* added more steering wheel setup details

* Merge from master and updates to README, addRigboxPaths

Co-authored-by: Jai Bhagat <[email protected]>
Co-authored-by: Kevin Miller <[email protected]>
  • Loading branch information
3 people authored Feb 14, 2020
1 parent 7d6b601 commit a1a6664
Show file tree
Hide file tree
Showing 115 changed files with 6,914 additions and 1,912 deletions.
2 changes: 1 addition & 1 deletion +dat/constructExpRef.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function ref = constructExpRef(subjectRef, expDate, expSequence)
%DAT.CONSTRUCTEXPREF Constructs an experiment reference string
% ref = DAT.CONSTRUCTEXPREF(subject, dat, seq) constructs and returns a
% ref = DAT.CONSTRUCTEXPREF(subject, date, seq) constructs and returns a
% standard format string reference, for the experiment using the 'subject',
% the 'date' of the experiment (a MATLAB datenum), and the daily sequence
% number of the experiment, 'seq' (must be an integer).
Expand Down
19 changes: 15 additions & 4 deletions +dat/expFilePath.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,36 @@

% 2013-03 CB created

assert(length(varargin) > 1, 'Error: Not enough arguments supplied.')
assert(length(varargin) > 1, 'Rigbox:dat:expFilePath:NotEnoughInputs',...
'Not enough input arguments.')

parsed = catStructs(regexp(varargin{1}, dat.expRefRegExp, 'names'));
if isempty(parsed) % Subject, not ref
if nargin > 4
if nargin < 3
error('Rigbox:dat:expFilePath:NotEnoughInputs', ...
['Not enough input arguments; check expRef formatted correcly ' ...
'or enter subject, date and sequence as separate arguments'])
elseif nargin == 3
error('Rigbox:dat:expFilePath:NotEnoughInputs', ...
'Not enough input arguments; missing file type')
elseif nargin > 4
location = varargin{5};
varargin(5) = [];
else
location = {};
end
typeIdx = 4;
else % Ref, not subject
typeIdx = 2;
if nargin > 2
if nargin < 2
error('Rigbox:dat:expFilePath:NotEnoughInputs', ...
'Not enough input arguments; missing file type')
elseif nargin > 2
location = varargin{3};
varargin(3) = [];
else
location = {};
end
typeIdx = 2;
end

% tabulate the args to get complete rows
Expand Down
3 changes: 3 additions & 0 deletions +dat/expPath.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
reposArgs = varargin(end);
varargin = varargin(1:end - 1);
else
% Check for minimum inputs
assert(nargin > 2, ...
'Rigbox:dat:expPath:NotEnoughInputs', 'Must provide repo location')
reposArgs = varargin((end - 1):end);
varargin = varargin(1:end - 2);
end
Expand Down
20 changes: 19 additions & 1 deletion +dat/loadParamProfiles.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
function p = loadParamProfiles(expType)
%DAT.LOADPARAMPROFILES Loads the parameter sets for given experiment type
% TODO
% Loads a struct of parameter structures from a MAT file called
% 'parameterProfiles'. Each field of this struct is a parameter set name
% for a given expType. Parameters of a given expType can be saved using
% the DAT.SAVEPARAMPROFILE function.
%
% Input:
% expType (char): The name of the experiment type, e.g. ChoiceWorld.
%
% Output:
% p (struct): a scalar struct of parameter sets for the given
% experiment type. Each fieldname holds a different parameter
% structure. The fields are sorted in ASCII dictionary order.
%
% Example:
% dat.saveParamProfile('ChoiceWorld', 'defSet', exp.choiceWorldParams)
% profiles = dat.loadParamProfiles('ChoiceWorld');
% p = exp.Parameters(profiles.defSet);
%
% See also DAT.SAVEPARAMPROFILE, DAT.PATHS
%
% Part of Rigbox

Expand Down
27 changes: 16 additions & 11 deletions +dat/reposPath.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,26 @@
% repository specified by 'name'.
%
% Each repository can have multiple locations with one location being the
% "master" copy and others considered backups (e.g. copies on local
% machines). Users of this function wanting to *save* data should do so
% in all locations. To *load* data, the master may be the only location
% containing all data (i.e. because local copies will only be on specific
% machines). The optional 'location' parameter specifies one or more
% locations, with "all" being the default that returns all locations for
% that repository, and "master" will return the path to the master
% location.
% 'master' copy and others considered backups or archives (e.g. copies on
% local machines). Users of this function wanting to *save* data should
% do so in all locations (i.e. master and local). To *load* data, the
% remote locations (i.e. master and archives) should be used (i.e.
% because local copies will only be on specific machines). The optional
% 'location' parameter specifies one or more locations, with 'all' being
% the default that returns the master and local locations for that
% repository, 'master' will return the path to the master location, and
% 'remote' will return the master and archive/alternate paths (in that
% order).
%
% e.g. to get all paths you should save to for the "main" repository:
% savePaths = DAT.REPOSPATH('main') % savePaths is a string cell array
% e.g. to get all paths you should save to for the 'main' repository:
% savePaths = DAT.REPOSPATH('main') % savePaths is a cell string
%
% To get the master location for the "main" repository:
% To get the master location for the 'main' repository:
% loadPath = DAT.REPOSPATH('main', 'master') % loadPath is a string
%
% When data are spread across multiple remote locations such as archives:
% loadPath = DAT.REPOSPATH('main', 'remote') % loadPath is a cell string
%
% Part of Rigbox

% 2013-03 CB created
Expand Down
57 changes: 34 additions & 23 deletions +dat/saveParamProfile.m
Original file line number Diff line number Diff line change
@@ -1,38 +1,49 @@
function saveParamProfile(expType, profileName, params)
%DAT.SAVEPARAMPROFILE Stores the named parameters for experiment type
% TODO
% - Figure out how to save struct without for-loop in 2016b!
% Saves a parameter structure in a MAT file called 'parameterProfiles'.
% Each field of this struct is an expType, and each nested field
% is the set name. Parameters of a given expType can be loaded using the
% DAT.LOADPARAMPROFILES function.
%
% Inputs:
% expType (char): The name of the experiment type, e.g. ChoiceWorld.
% profileName (char): The name of the parameter set being saved. If
% the name already exists in the file for a given expType, it is
% overwritten.
% params (struct): A parameter structure to be saved.
%
% Example:
% dat.saveParamProfile('ChoiceWorld', 'defSet', exp.choiceWorldParams)
% profiles = dat.loadParamProfiles('ChoiceWorld');
% p = exp.Parameters(profiles.defSet);
%
% See also DAT.LOADPARAMPROFILES, DAT.PATHS
%
% Part of Rigbox

% 2013-07 CB created
% 2017-02 MW adapted to work in 2016b

%path to repositories
% If main repo folders don't exist yet, create them
repos = dat.reposPath('main');
cellfun(@mkdir, repos(~file.exists(repos)))

% Path to repository files
fn = 'parameterProfiles.mat';
repos = fullfile(dat.reposPath('main'), fn);
repos = fullfile(repos, fn);

%load existing profiles for specified expType
% Load existing profiles for specified expType
profiles = dat.loadParamProfiles(expType);
%add (or replace) the params with a field named by profile
% Add (or replace) the params with a field named by profile
profiles.(profileName) = params;
%wrap in a struct for saving
% Wrap in a struct for saving
set = struct;
set.(expType) = profiles;

%save the updated set of profiles to each repos
%where files exist already, append
% cellfun(@(p) save(p, '-struct', 'set', '-append'),
% file.filterExists(repos, true)); % Had to change her to a for loop, sorry
% Chris!
p = file.filterExists(repos, true);
for i = 1:length(p)
save(p{i}, '-struct', 'set', '-append')
end
%and any that don't we should create from scratch
p = file.filterExists(repos, false);
for i = 1:length(p)
save(p{i}, '-struct', 'set')
end
% cellfun(@(p) save(p, '-struct', 'set'), file.filterExists(repos, false));
% Save the updated set of profiles to each repos where files exist already,
% append
saveFn = @(p,name,varargin) save(p, '-struct', 'name', varargin{:});
cellfun(@(p) saveFn(p, set, '-append') , file.filterExists(repos, true));

end
% Any that don't we should create from scratch
cellfun(@(p) saveFn(p, set), file.filterExists(repos, false));
2 changes: 1 addition & 1 deletion +dat/updateLogEntry.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function updateLogEntry(subject, id, newEntry)

% 2013-03 CB created

if isfield(newEntry, 'AlyxInstance')
if isfield(newEntry, 'AlyxInstance') && ~isempty(getOr(dat.paths, 'databaseURL'))
% Update session narrative on Alyx
if ~isempty(newEntry.comments) && ~strcmp(subject, 'default')
try
Expand Down
2 changes: 1 addition & 1 deletion +eui/ChoiceExpPanel.m
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function refresh(obj)
end
end

methods %(Access = protected)
methods (Access = protected)
function newTrial(obj, num, condition)
%attempt num is red when on higher than third
attemptColour = iff(condition.repeatNum > 3, [1 0 0], [0 0 0]);
Expand Down
2 changes: 1 addition & 1 deletion +eui/ConditionPanel.m
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function onEdit(obj, src, eventData)
% See also FILLCONDITIONTABLE, EUI.PARAMEDITOR/UPDATE
row = eventData.Indices(1);
col = eventData.Indices(2);
assert(all(cellfun(@strcmpi, strrep(obj.ConditionTable.ColumnName, ' ', ''), ...
assert(all(cellfun(@strcmpi, erase(obj.ConditionTable.ColumnName, ' '), ...
obj.ParamEditor.Parameters.TrialSpecificNames)), 'Unexpected condition names')
paramName = obj.ParamEditor.Parameters.TrialSpecificNames{col};
newValue = obj.ParamEditor.update(paramName, eventData.NewData, row);
Expand Down
32 changes: 32 additions & 0 deletions +eui/Contents.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
% +EUI Experiment UI package
%
% This +eui package contains all code pertaining to graphical user
% interfaces in Rigbox. There are five base classes in this folder:
%
% 1. MControl - The class behind the Master Control (MC) GUI.
% 2. ExpPanel - The superclass for UI panels that process and plot remote
% experiment event updates (i.e. the panels under the Current
% Experiments tab of MC).
% 3. Log - UI control for viewing experiment log entries (the table under
% the Log tab of MC).
% 4. AlyxPanel - UI for interacting with the Alyx database (the Alyx panel
% in the New Experiments tab of MC). Can be run as a stand-alone GUI.
% 5. ParamEditor - UI for viewing and editing parameters (the Parameter
% panel in the New Experiments table of MC). Can be run as a
% stand-alone GUI.
%
% Files
% AlyxPanel - A GUI for interating with the Alyx database
% ChoiceExpPanel - UI control for monitoring a 2AFC experiment
% ConditionPanel - Deals with formatting trial conditions UI table
% ExpPanel - Basic UI control for monitoring an experiment
% FieldPanel - Deals with formatting global parameter UI elements
% Log - UI control for viewing experiment log entries
% MappingExpPanel - Preliminary UI for monitoring a mapping experiment
% MControl - GUI for the control of experiments
% ParamEditor - GUI for visualizing and editing experiment parameters
% SignalsTest - A GUI for testing SignalsExp experiment definitions
% SqueakExpPanel - Basic UI control for monitoring a Signals experiment
%
% See Also
% docs/html/using_mc.m, docs/html/using_ParamEditor.m
Loading

0 comments on commit a1a6664

Please sign in to comment.