<commit_before>
===============
Getting Started
===============

Try root_numpy on `CERN's LXPLUS <http://information-technology.web.cern.ch/services/lxplus-service>`_
======================================================================================================

First set up an environment with consistent GCC, ROOT and Python builds::

   export LCGENV_PATH=/afs/cern.ch/sw/lcg/releases
   /cvmfs/sft.cern.ch/lcg/releases/lcgenv/latest/lcgenv -p LCG_84 x86_64-slc6-gcc49-opt ROOT > lcgenv.sh
   echo 'export PATH=$HOME/.local/bin:$PATH' >> lcgenv.sh
   source lcgenv.sh

In new terminal sessions, only the last line above will be required.

Install pip and virtualenv::

   curl -O https://bootstrap.pypa.io/get-pip.py
   python get-pip.py --user
   pip install --user virtualenv

Then create and activate a virtualenv (change `my_env` at your will)::

   virtualenv my_env
   source my_env/bin/activate

Now install NumPy and root_numpy::

   pip install numpy
   pip install root_numpy

Note that neither `sudo` nor `--user` is used, because we are in a virtualenv.

root_numpy should now be ready to use::

   >>> from root_numpy import root2array, testdata
   >>> root2array(testdata.get_filepath('single1.root'))[:20] # doctest: +SKIP
   rec.array([(1, 1.0, 1.0), (2, 3.0, 4.0), (3, 5.0, 7.0), (4, 7.0, 10.0),
          (5, 9.0, 13.0), (6, 11.0, 16.0), (7, 13.0, 19.0), (8, 15.0, 22.0),
          (9, 17.0, 25.0), (10, 19.0, 28.0), (11, 21.0, 31.0),<commit_msg>update docs on getting started on lxplus<commit_after>
===============
Getting Started
===============

Try root_numpy on `CERN's LXPLUS <http://information-technology.web.cern.ch/services/lxplus-service>`_
======================================================================================================

First set up an environment with consistent GCC, ROOT and Python builds::

   export LCGENV_PATH=/afs/cern.ch/sw/lcg/releases
   /cvmfs/sft.cern.ch/lcg/releases/lcgenv/latest/lcgenv -p LCG_84 x86_64-slc6-gcc49-opt ROOT > lcgenv.sh
   echo 'export PATH=$HOME/.local/bin:$PATH' >> lcgenv.sh
   source lcgenv.sh

In new terminal sessions, only the last line above will be required.

Install pip and virtualenv::

   curl -O https://bootstrap.pypa.io/get-pip.py
   python get-pip.py --user
   pip install --user virtualenv

Then create and activate a virtualenv (change ``my_env`` at your will)::

   virtualenv my_env
   source my_env/bin/activate

Now install NumPy and root_numpy::

   pip install numpy
   pip install root_numpy

Note that neither ``sudo`` nor ``--user`` is used, because we are in a
virtualenv.

root_numpy should now be ready to use::

   >>> from root_numpy import root2array, testdata
   >>> root2array(testdata.get_filepath('single1.root'))[:20] # doctest: +SKIP
   rec.array([(1, 1.0, 1.0), (2, 3.0, 4.0), (3, 5.0, 7.0), (4, 7.0, 10.0),
          (5, 9.0, 13.0), (6, 11.0, 16.0), (7, 13.0, 19.0), (8, 15.0, 22.0),
          (9, 17.0, 25.0), (10, 19.0, 28.0), (11, 21.0, 31.0),
{'fraction_non_alphanumeric': 0.2216270505523937, 'fraction_numerical': 0.05691329092735186, 'mean_word_length': 3.7655502392344498, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7169815', 'n_tokens_mistral': 1207, 'n_tokens_neox': 1051, 'n_words': 303}