Skip to content

Commit 67e57ae

Browse files
authored
Merge pull request #63 from arokem/docs_popylar
DOC: Document the fact that we are using popylar/GA for usage tracking.
2 parents eef7952 + 055e36c commit 67e57ae

File tree

2 files changed

+29
-13
lines changed

2 files changed

+29
-13
lines changed

dmriprep/cli/run.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -221,16 +221,11 @@ def main():
221221

222222
exec_env = os.name
223223

224-
# special variable set in the container
225-
if os.getenv('IS_DOCKER_8395080871'):
226-
exec_env = 'singularity'
227-
cgroup = Path('/proc/1/cgroup')
228-
if cgroup.exists() and 'docker' in cgroup.read_text():
229-
exec_env = 'docker'
230-
if os.getenv('DOCKER_VERSION_8395080871'):
231-
exec_env = 'dmriprep-docker'
232-
233224
if not opts.notrack:
225+
logger.info(
226+
"Your usage of dmriprep is being recorded using popylar (https://popylar.github.io/). ", # noqa
227+
"For details, see https://nipreps.github.io/dmriprep/usage.html. ",
228+
"To opt out, call dmriprep with a `--notrack` flag")
234229
import popylar
235230
popylar.track_event(__ga_id__, 'run', 'cli_run')
236231

docs/usage.rst

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ The FreeSurfer license
4141
To obtain a FreeSurfer license, simply register for free at
4242
https://surfer.nmr.mgh.harvard.edu/registration.html.
4343

44-
When using manually-prepared environments or Singularity, FreeSurfer will search
45-
for a license key file first using the ``$FS_LICENSE`` environment variable and then
46-
in the default path to the license key file (``$FREESURFER_HOME/license.txt``).
47-
If using the ``--cleanenv`` flag and ``$FS_LICENSE`` is set, use ``--fs-license-file $FS_LICENSE``
44+
When using manually-prepared environments or Singularity, FreeSurfer will search
45+
for a license key file first using the ``$FS_LICENSE`` environment variable and then
46+
in the default path to the license key file (``$FREESURFER_HOME/license.txt``).
47+
If using the ``--cleanenv`` flag and ``$FS_LICENSE`` is set, use ``--fs-license-file $FS_LICENSE``
4848
to pass the license file location to *dMRIPrep*.
4949

5050
It is possible to run the Docker container pointing the image to a local path
@@ -60,3 +60,24 @@ file on the host system: ::
6060
/data /out/out \
6161
participant \
6262
--ignore fieldmaps
63+
64+
65+
Usage tracking with Google Analytics
66+
------------------------------------
67+
To be able to assess usage of the software, we are recording each use of the
68+
:abbr:`CLI (command-line interface)` as an event in Google Analytics,
69+
using `popylar <https://popylar.github.io>`__.
70+
``
71+
72+
For now, the only information that we are recording is the fact that the CLI was
73+
called and whether the call completed successfully. In addition, through Google
74+
Analytics, we will have access to very general information, such as the country
75+
and city in which the computer using the CLI was located and the time that it
76+
was used. At this time, we do not record any additional information, although in
77+
the future we may want to record statistics on the computational environment in
78+
which the CLI was called, such as the operating system.
79+
80+
Opting out of this usage tracking can be done by calling the CLI with the
81+
``--notrack`` flag::
82+
83+
dmriprep data/bids_root/ out/ participant -w work/ --notrack

0 commit comments

Comments
 (0)