Skip to content

Commit

Permalink
Merge pull request #181 from nno/_dbg/xenia2
Browse files Browse the repository at this point in the history
BLD: use Xenia
  • Loading branch information
nno committed Jul 19, 2019
2 parents d43b0e7 + dfcb4c2 commit 872c912
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 29 deletions.
58 changes: 31 additions & 27 deletions .travis.yml
Expand Up @@ -3,26 +3,26 @@
# based on nipype configuration, which in turn was based on nipy)
#
# We pretend to be java because we need GNU Octave which is not
# available (as of April 2015)
# available (as of June 2019)

language: java
dist: trusty
dist: xenial
cache:
- apt
env:
global:
- COVERALLS_PARALLEL=true
matrix:
- TRAVIS_WITH_EXTERNALS=false TRAVIS_WITH_COVERAGE=false COVERALLS_PARALLEL=false
- TRAVIS_WITH_EXTERNALS=true TRAVIS_WITH_COVERAGE=false COVERALLS_PARALLEL=false
- TRAVIS_WITH_EXTERNALS=true TRAVIS_WITH_COVERAGE=true PARTITION_INDEX=1 PARTITION_COUNT=8 COVERALLS_PARALLEL=false NO_DOC_TEST=true
- TRAVIS_WITH_EXTERNALS=true TRAVIS_WITH_COVERAGE=true PARTITION_INDEX=2 PARTITION_COUNT=8 COVERALLS_PARALLEL=false NO_DOC_TEST=true
- TRAVIS_WITH_EXTERNALS=true TRAVIS_WITH_COVERAGE=true PARTITION_INDEX=3 PARTITION_COUNT=8 COVERALLS_PARALLEL=false NO_DOC_TEST=true
- TRAVIS_WITH_EXTERNALS=true TRAVIS_WITH_COVERAGE=true PARTITION_INDEX=4 PARTITION_COUNT=8 COVERALLS_PARALLEL=false NO_DOC_TEST=true
- TRAVIS_WITH_EXTERNALS=true TRAVIS_WITH_COVERAGE=true PARTITION_INDEX=5 PARTITION_COUNT=8 COVERALLS_PARALLEL=false NO_DOC_TEST=true
- TRAVIS_WITH_EXTERNALS=true TRAVIS_WITH_COVERAGE=true PARTITION_INDEX=6 PARTITION_COUNT=8 COVERALLS_PARALLEL=false NO_DOC_TEST=true
- TRAVIS_WITH_EXTERNALS=true TRAVIS_WITH_COVERAGE=true PARTITION_INDEX=7 PARTITION_COUNT=8 COVERALLS_PARALLEL=false NO_DOC_TEST=true
- TRAVIS_WITH_EXTERNALS=true TRAVIS_WITH_COVERAGE=true PARTITION_INDEX=8 PARTITION_COUNT=8 TRAVIS_AFTER_ALL_ARGS='--is_master' COVERALLS_PARALLEL=true NO_DOC_TEST=true
# - TRAVIS_WITH_EXTERNALS=true TRAVIS_WITH_COVERAGE=false COVERALLS_PARALLEL=false
# - TRAVIS_WITH_EXTERNALS=true TRAVIS_WITH_COVERAGE=true PARTITION_INDEX=1 PARTITION_COUNT=8 COVERALLS_PARALLEL=false NO_DOC_TEST=true
# - TRAVIS_WITH_EXTERNALS=true TRAVIS_WITH_COVERAGE=true PARTITION_INDEX=2 PARTITION_COUNT=8 COVERALLS_PARALLEL=false NO_DOC_TEST=true
# - TRAVIS_WITH_EXTERNALS=true TRAVIS_WITH_COVERAGE=true PARTITION_INDEX=3 PARTITION_COUNT=8 COVERALLS_PARALLEL=false NO_DOC_TEST=true
# - TRAVIS_WITH_EXTERNALS=true TRAVIS_WITH_COVERAGE=true PARTITION_INDEX=4 PARTITION_COUNT=8 COVERALLS_PARALLEL=false NO_DOC_TEST=true
# - TRAVIS_WITH_EXTERNALS=true TRAVIS_WITH_COVERAGE=true PARTITION_INDEX=5 PARTITION_COUNT=8 COVERALLS_PARALLEL=false NO_DOC_TEST=true
# - TRAVIS_WITH_EXTERNALS=true TRAVIS_WITH_COVERAGE=true PARTITION_INDEX=6 PARTITION_COUNT=8 COVERALLS_PARALLEL=false NO_DOC_TEST=true
# - TRAVIS_WITH_EXTERNALS=true TRAVIS_WITH_COVERAGE=true PARTITION_INDEX=7 PARTITION_COUNT=8 COVERALLS_PARALLEL=false NO_DOC_TEST=true
# - TRAVIS_WITH_EXTERNALS=true TRAVIS_WITH_COVERAGE=true PARTITION_INDEX=8 PARTITION_COUNT=8 TRAVIS_AFTER_ALL_ARGS='--is_master' COVERALLS_PARALLEL=true NO_DOC_TEST=true
before_install:
# to prevent IPv6 being used for APT
- sudo bash -c "echo 'Acquire::ForceIPv4 \"true\";' > /etc/apt/apt.conf.d/99force-ipv4"
Expand All @@ -35,9 +35,11 @@ before_install:
- travis_retry sudo apt-get -y install octave
- travis_retry sudo apt-get -y install liboctave-dev
- travis_retry sudo apt-get -y -qq install octave
- octave --version
- which make

# when installing externals, get recent GCC for Octave parallel toolbox
- if [[ "${TRAVIS_WITH_EXTERNALS}" == "true" ]]; then
- if [[ "${TRAVIS_WITH_EXTERNALS}" == "trueDISABLED" ]]; then
travis_retry sudo add-apt-repository 'ppa:ubuntu-toolchain-r/test' -y;
travis_retry sudo apt-get update -y -q;
travis_retry sudo apt-get install gcc-4.8 g++-4.8 -y -q;
Expand Down Expand Up @@ -137,6 +139,22 @@ install:
$RETRY $OCTAVE --eval "pkg('install','-auto','-forge','struct');";
fi

# optionally enable Octave statistics package
# $RETRY $OCTAVE --eval "pkg('install','-forge','statistics');";
- if [[ " $EXTERNALS " = *" octave_pkg_statistics "* ]]; then
$RETRY sudo apt-get -y -qq octave-statistics;
fi
# optionally enable Octave miscellaneous package
# (the "general" package is required for the "miscellaneous" package)
# (the "miscellaneous" package also requires "units")
- if [[ " $EXTERNALS " = *" octave_pkg_miscellaneous "* ]]; then
$RETRY $OCTAVE --eval "pkg('install','-auto','-forge','general');";
$RETRY sudo apt-get -y -qq install units;
$RETRY $OCTAVE --eval "pkg('install','-auto','-forge','miscellaneous');";
fi



# As of Aug 2017, the parallel package is disabled because it made Octave crash
# when using travis
#
Expand Down Expand Up @@ -237,28 +255,14 @@ before_script:



# optionally enable Octave statistics package
- if [[ " $EXTERNALS " = *" octave_pkg_statistics "* ]]; then
$RETRY $OCTAVE --eval "pkg('install','-auto','-forge','statistics');";
fi

# optionally enable Octave miscellaneous package
# (the "general" package is required for the "miscellaneous" package)
# (the "miscellaneous" package also requires "units")
- if [[ " $EXTERNALS " = *" octave_pkg_miscellaneous "* ]]; then
$RETRY $OCTAVE --eval "pkg('install','-auto','-forge','general');";
$RETRY sudo apt-get -y -qq install units;
$RETRY $OCTAVE --eval "pkg('install','-auto','-forge','miscellaneous');";
fi

# show Octave-rc
- echo "Octave-rc:"; cat $OCTAVERC


# show which packages are installed
- $OCTAVE --eval "pkg('list')"

# show WTF
# show WTF
- $OCTAVE --eval "addpath('${PTH}/CoSMoMVPA/mvpa');cosmo_wtf()"

script:
Expand Down
4 changes: 2 additions & 2 deletions COPYING
Expand Up @@ -12,9 +12,9 @@ is licensed under the Expat license.

License: Expat

Copyright (c) 2013-2018 Nikolaas N. Oosterhof
Copyright (c) 2013-2019 Nikolaas N. Oosterhof
2013 Andrew C. Connolly
2013-2018 CoSMoMVPA contributors (see AUTHOR file)
2013-2019 CoSMoMVPA contributors (see AUTHOR file)

- Expat License:

Expand Down
51 changes: 51 additions & 0 deletions doc/source/faq.rst
Expand Up @@ -1675,5 +1675,56 @@ You can use the example below to correlate two dissimilarity matrices; these can
For analysis at the group level, compute for each participant the correlation between their behavioural ratings, then use a one-sample t-test against a difference of zero.

Use the generalization measure with different durations for training and test set?
----------------------------------------------------------------------------------
'I would like to use the :ref:`cosmo_dim_generalization_measure` but with different time intervals for training and test set. For the training set I have 3 seconds of data per trial, but for the test set only 1 second. How can I run this analysis.'

Please see the code below for an example. It is similar to the documentation of :ref:`cosmo_dim_generalization_measure`, except that in the preparation phase the :ref:`cosmo_dim_transpose` step is done before the :ref:`cosmo_stack` step. This order is also necessary when using :ref:`cosmo_searchlight`.

.. code-block:: matlab
% Generalization over time
% Make some synthetic data
sz='big';
train_ds=cosmo_synthetic_dataset('type','timelock','size',sz,...
'nchunks',2,'seed',1);
test_ds=cosmo_synthetic_dataset('type','timelock','size',sz,...
'nchunks',3,'seed',2);
% select a smaller time period for the testing dataset
% here, only the time period between -0.15 and 0.05 seconds is selected
msk=cosmo_dim_match(test_ds, 'time', @(t) -0.15 <= t & t <= .05);
smaller_test_ds = cosmo_slice(test_ds, msk, 2);
% set chunks
train_ds.sa.chunks(:)=1;
smaller_test_ds.sa.chunks(:)=2;
% make time a sample dimension
dim_label='time';
train_ds_tr = cosmo_dim_transpose(train_ds, dim_label, 1);
smaller_test_ds_tr = cosmo_dim_transpose(smaller_test_ds, dim_label, 1);
% construct the dataset
ds_time=cosmo_stack({train_ds_tr, smaller_test_ds_tr});
%
% set measure and its arguments
measure_args=struct();
%
% use correlation measure
measure_args.measure=@cosmo_correlation_measure;
% dimension of interest is 'time'
measure_args.dimension=dim_label;
%
% run time-by-time generalization analysis
dgm_ds=cosmo_dim_generalization_measure(ds_time,measure_args,...
'progress',false);
%
% the output has train_time and test_time as sample dimensions
cosmo_disp(dgm_ds.a)
.. include:: links.txt

0 comments on commit 872c912

Please sign in to comment.