<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi, Jan-Mathijs,<br>
<br>
Thank you for the detailed reply. I'll take all this under
advisement.<br>
<br>
That style guide is nice and detailed. I'll spend some time with it.<br>
<br>
> In general, we shy away from fancy object-oriented stuff (with
a few exceptions, but these pertain to functionality that typical
users don’t need to be aware of), because our users are most often
scientist with little computational background (nor interest).<br>
<br>
Would you consider the use of packages (aka "namespaces")? Not for
user-visible code, but for FieldTrip's internal use. These are the
"+foo" folders that create namespace qualifications for the
functions and classes contained in them. There seems to be a good
amount of copy-and-pasted code in the various private/ folders in
FieldTrip. Moving these to a +fieldtrip/+internal package could be a
way to remove the code duplication and expose those functions for
testing, but still make it clear they're undocumented stuff for
FieldTrip's internal use, and, as with the private/ folders, caveat
emptor if a user decides to call them directly. The "+internal"
package is just a naming convention; no access is enforced by the
Matlab interpreter. But I think it's a well-established convention
in various programming languages at this point.<br>
<br>
I can't find when packages were introduced in Matlab, but this
article - <a href="https://blogs.mathworks.com/pick/2014/07/18/simple-namespaces-and-brilliant-function-handles/">https://blogs.mathworks.com/pick/2014/07/18/simple-namespaces-and-brilliant-function-handles/</a>
- from 2014 says they've been around "for a number of years" and is
"very mature" at that point. So it would be well supported by all
the Matlab versions you're targeting.<br>
<br>
> The majority of the test functions in our test directory can
only be run on our local compute cluster, since many of the
functions require data that is only available locally. <br>
<br>
Is this because the data is proprietary, or just because it's big
and can't be stored in the repo?<br>
<br>
Cheers,<br>
Andrew<br>
<br>
<div class="moz-cite-prefix">On 3/24/19 3:43 PM, Schoffelen, J.M.
(Jan Mathijs) wrote:<br>
</div>
<blockquote type="cite" cite="mid:681232FB-56FB-4CAB-88F1-CE1E34059D2A@donders.ru.nl">
Dear Andrew,
<div class=""><br class="">
</div>
<div class="">Thanks for reaching out. If I recall well, we have a
page that documents some coding guidelines, which by no means is
exhaustive, on <a href="http://www.fieldtriptoolbox.org/development/guideline/code/" class="" moz-do-not-send="true">http://www.fieldtriptoolbox.org/development/guideline/code/</a>.
I realise that this is quite outdated, since it still mentions
SVN as the version control system used, which we abandoned quite
a while ago. Yet, I think that most of these guidelines still
hold. Indeed the recommendation would be to use 2 spaces for
indents, but it could be that this is somewhat inconsistent
(although I’d expect that the majority of the code is using this
convention). </div>
<div class=""><br class="">
</div>
<div class="">We look favourable to any type of pull request (I
just saw yours posted), as long as they well-motivated and
thought through. Sometimes we choose to ignore lint warnings,
though, for instance when coding style optimizations are not
sufficiently backward compatible, or when readability of the
code is severely compromised. </div>
<div class=""><br class="">
</div>
<div class="">In general, we try to support Matlab versions up to
5 years ago, so these days that would mean that we would start
to support functionality that has been introduced from 2014
onwards. This being said, sometimes we boost backward
compatibility of functionality by including drop-in replacements
of core Matlab functions in the compat/matlabltSOMENUMBER
folders. For instance, the “string” datatype functionality,
introduced in matlab2016 has the useful “contains” function,
that we considered to be of sufficient value (cleaning up many
instances of ~isempty(strfind()) ), to be promoted to a drop-in
function. In general, we shy away from fancy object-oriented
stuff (with a few exceptions, but these pertain to functionality
that typical users don’t need to be aware of), because our users
are most often scientist with little computational background
(nor interest).</div>
<div class=""><br class="">
</div>
<div class="">The majority of the test functions in our test
directory can only be run on our local compute cluster, since
many of the functions require data that is only available
locally. The travis continuous integration stuff that is
deployed upon submitting a PR at the moment is not doing
anything meaningful (don’t tell anybody), and it will always
pass. In general, when adding new functionality, we typically
try and create a little test function that ideally (if possible)
creates some toy data from scratch, so that it does not depend
on reading data from disk. In principle, all test functions that
don’t load in data should run anywhere. </div>
<div class=""><br class="">
</div>
<div class="">I hope that these replies are by no means the end of
it, and I am looking forward to further interactions, either on
this platform or through github.</div>
<div class=""><br class="">
</div>
<div class="">Best wishes,</div>
<div class="">Jan-Mathijs</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space;
-webkit-line-break: after-white-space;" class="">
J.M.Schoffelen, MD PhD<br class="">
Associate PI, VIDI-fellow - PI, language in interaction<br class="">
Telephone: +31-24-3614793</div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space;
-webkit-line-break: after-white-space;" class="">
Physical location: room 00.028</div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space;
-webkit-line-break: after-white-space;" class="">
Donders Centre for Cognitive Neuroimaging, Nijmegen,
The Netherlands<br class="">
<br class="">
</div>
</div>
<div class=""> </div>
<div class=""><br class="">
<div>
<blockquote type="cite" class="">
<div class="">On 23 Mar 2019, at 19:42, Andrew Janke <<a href="mailto:floss@apjanke.net" class="" moz-do-not-send="true">floss@apjanke.net</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="">Hi, FieldTrip folks,<br class="">
<br class="">
I'm a software developer working with a student who's
using FieldTrip<br class="">
for their thesis, and would like to make a couple Pull
Requests to the<br class="">
FieldTrip project.<br class="">
<br class="">
What's the standard code style for FieldTrip? It looks
like 2 spaces for<br class="">
indents, but this isn't consistent between all the
files.<br class="">
<br class="">
Would you want style-only Pull Requests? How about Pull
Requests that<br class="">
fix Matlab lint warnings ("code inspections")?<br class="">
<br class="">
I noticed in <a href="http://www.fieldtriptoolbox.org/faq/requirements/" class="" moz-do-not-send="true">
http://www.fieldtriptoolbox.org/faq/requirements/</a>
that you<br class="">
try to support older Matlab versions. What's the oldest
Matlab version<br class="">
you're currently targeting? I'm wondering what
recently-added Matlab<br class="">
features can be used yet, and which versions of Matlab I
should run the<br class="">
tests under.<br class="">
<br class="">
Speaking of which, how do you run the full FieldTrip
test suite (the<br class="">
stuff in the test/ directory)?<br class="">
<br class="">
Cheers,<br class="">
Andrew Janke<br class="">
<a href="mailto:floss@apjanke.net" class="" moz-do-not-send="true">floss@apjanke.net</a><br class="">
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a class="moz-txt-link-freetext" href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
<a class="moz-txt-link-freetext" href="https://doi.org/10.1371/journal.pcbi.1002202">https://doi.org/10.1371/journal.pcbi.1002202</a><br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
<br class="">
<br class="">
<div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal;
text-align: start; text-indent: 0px; text-transform: none;
white-space: normal; word-spacing: 0px;
-webkit-text-stroke-width: 0px; word-wrap: break-word;
-webkit-nbsp-mode: space; -webkit-line-break:
after-white-space;" class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal;
text-align: start; text-indent: 0px; text-transform: none;
white-space: normal; word-spacing: 0px;
-webkit-text-stroke-width: 0px; word-wrap: break-word;
-webkit-nbsp-mode: space; -webkit-line-break:
after-white-space;" class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal;
text-align: start; text-indent: 0px; text-transform: none;
white-space: normal; word-spacing: 0px;
-webkit-text-stroke-width: 0px; word-wrap: break-word;
-webkit-nbsp-mode: space; -webkit-line-break:
after-white-space;" class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal;
text-align: start; text-indent: 0px; text-transform:
none; white-space: normal; word-spacing: 0px;
-webkit-text-stroke-width: 0px; word-wrap: break-word;
-webkit-nbsp-mode: space; -webkit-line-break:
after-white-space;" class="">
<br class="">
</div>
</div>
</div>
</div>
</div>
<br class="">
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
fieldtrip mailing list
<a class="moz-txt-link-freetext" href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a>
<a class="moz-txt-link-freetext" href="https://doi.org/10.1371/journal.pcbi.1002202">https://doi.org/10.1371/journal.pcbi.1002202</a>
</pre>
</blockquote>
<br>
</body>
</html>