<commit_before>.. _installing:

Install xarray-simlab
=====================

Required dependencies
---------------------

- Python 3.4 or later.
- `numpy <http://www.numpy.org/>`__
- `xarray <http://xarray.pydata.org>`__ (0.8.0 or later)

Optional dependencies
---------------------

For model visualization
~~~~~~~~~~~~~~~~~~~~~~~

- `graphviz <http://graphviz.readthedocs.io>`__

Install from source
-------------------

There is currently no ``xarray-simlab`` release available at PyPi_
or conda-forge_.

Be sure you have the required dependencies (numpy and xarray)
installed first. You might consider using conda_ to install them::

    $ conda install xarray numpy pip -c conda-forge

A good practice (especially for development purpose) is to install the packages
in a separate environment, e.g. using conda::

    $ conda create -n simlab_py36 python=3.6 xarray numpy pip -c conda-forge
    $ source activate simlab_py36

Then you can clone the ``xarray-simlab`` git repository and install it
using ``pip`` locally::

    $ git clone https://github.com/benbovy/xarray-simlab
    $ cd xarray-simlab
    $ pip install .

For development purpose, use the following command::

    $ pip install -e .

.. _PyPi: https://pypi.python.org/pypi
.. _conda-forge: https://conda-forge.github.io/
.. _conda: http://conda.io/

Import xarray-simlab
--------------------

To make sure that ``xarray-simlab`` is correctly installed, try import it by
running this line::

    $ python -c "import xsimlab"<commit_msg>corrected statement about packages and linked<commit_after>.. _installing:

Install xarray-simlab
=====================

Required dependencies
---------------------

- Python 3.4 or later.
- `numpy <http://www.numpy.org/>`__
- `xarray <http://xarray.pydata.org>`__ (0.8.0 or later)

Optional dependencies
---------------------

For model visualization
~~~~~~~~~~~~~~~~~~~~~~~

- `graphviz <http://graphviz.readthedocs.io>`__

Install from source
-------------------

While there are ``xarray-simlab`` releases available at `PyPi <https://pypi.python.org/pypi/xarray-simlab/0.0.9>`_ 
and `conda-forge <https://github.com/conda-forge/xarray-simlab-feedstock>`_, you may prefer to install from source.

Be sure you have the required dependencies (numpy and xarray)
installed first. You might consider using conda_ to install them::

    $ conda install xarray numpy pip -c conda-forge

A good practice (especially for development purpose) is to install the packages
in a separate environment, e.g. using conda::

    $ conda create -n simlab_py36 python=3.6 xarray numpy pip -c conda-forge
    $ source activate simlab_py36

Then you can clone the ``xarray-simlab`` git repository and install it
using ``pip`` locally::

    $ git clone https://github.com/benbovy/xarray-simlab
    $ cd xarray-simlab
    $ pip install .

For development purpose, use the following command::

    $ pip install -e .

.. _PyPi: https://pypi.python.org/pypi
.. _conda-forge: https://conda-forge.github.io/
.. _conda: http://conda.io/

Import xarray-simlab
--------------------

To make sure that ``xarray-simlab`` is correctly installed, try to import it by
running this line::

    $ python -c "import xsimlab"
{'fraction_non_alphanumeric': 0.17746478873239438, 'fraction_numerical': 0.00782472613458529, 'mean_word_length': 3.0050125313283207, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 8, 'lorem ipsum': 0, 'www.': 2, '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': '5729282', 'n_tokens_mistral': 1012, 'n_tokens_neox': 952, 'n_words': 323}