diff --git a/docs/source/install/install.rst b/docs/source/install/install.rst index 41a73c401862cb08207d44abe4d22c3b55c27170..f0e9e54cd7e828dd64f56c848f5f6d6341bf3ae7 100644 --- a/docs/source/install/install.rst +++ b/docs/source/install/install.rst @@ -37,7 +37,7 @@ Building MOOSE In case your distribution is not listed on `our repository page <https://software.opensuse.org/download.html?project=home:moose&package=moose>`_ -, or if you want to build the lastest development code, read on. +, or if you want to build the latest development code, read on. First, you need to get the source code. You can use ``git`` (clone the repository) or download snapshot of github repo by clicking on `this link @@ -52,7 +52,7 @@ Or, $ wget https://github.com/BhallaLab/moose/archive/master.zip $ unzip master.zip -If you don't want lasest snapshot of ``MOOSE``, you can download other released +If you don't want latest snapshot of ``MOOSE``, you can download other released versions from `here <`https://github.com/BhallaLab/moose/releases>`_. Install dependencies @@ -111,7 +111,7 @@ build moose .. code-block:: bash - $ cd /to/moose/source/code + $ cd /to/moose/source/code/ (root directory of moose) $ mkdir _build $ cd _build $ cmake .. @@ -159,6 +159,9 @@ or by using ``git`` :: $ git clone https://github.com/BhallaLab/moose-gui + +Alternatively the moose-gui folder exists within the moose folder downloaded and built earlier in the installation process. It can be found under ``location_of_moose_folder/moose/moose-gui/``. + Below are packages which you may want to install to use MOOSE Graphical User Interface. - Required: diff --git a/docs/source/user/py/quickstart/moose_quickstart.rst b/docs/source/user/py/quickstart/moose_quickstart.rst index e41c9c338607f0befb4ca56e006dec149d5f1a9c..0663c4437fe9e3c89200859510e1dbead22e3217 100644 --- a/docs/source/user/py/quickstart/moose_quickstart.rst +++ b/docs/source/user/py/quickstart/moose_quickstart.rst @@ -2,13 +2,13 @@ Getting started with python scripting for MOOSE *********************************************** -.. contents:: +.. contents: :local: :depth: 1 .. figure:: ../../../images/Gallery_Moose_Multiscale.png :alt: **multiple scales in moose** - :scale: 50% + :scale: 100% *Multiple scales can be modelled and simulated in MOOSE* @@ -34,14 +34,55 @@ Contents: :maxdepth: 2 :numbered: + moose_quickstart +Coding basics and how to use this document +========================================== +This page acts as the first stepping stone for learning how moose works. The tutorials here are intended to be interactive, and are presented as python commands. Python commands are identifiable by the ``>>>`` before the command as opposed to ``$`` which identifies a command-line command. -Indices and tables -================== + >>> this_is_a_python_command -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` +You are encouraged to run a python shell while reading through this documentation and trying out each command for yourself. Python shells are environments within your terminal wherein everything you type is interpreted as a python command. They can be accessed by typing +:: + + $ python + +in your command-line terminal. + +While individually typing lines of code in a python terminal is useful for practicing using moose and coding in general, note that once you close the python environment all the code you typed is gone and the moose models created are also lost. In order to 'save' models that you create, you would have to type your code in a text file with a ``.py`` extension. The easiest way to do this is to create a text file in command line, open it with a text editor (for example, gedit), and simply type your code in (make sure you indent correctly). +:: + + $ touch code.py + $ gedit code.py + +Once you have written your code in the file, you can run it through your python environment. +:: + + $ python code.py + +Note that apart from this section of the quickstart, most of the moose documentation is in the form of ``snippets``. These are basically ``.py`` files with code that demonstrates a certain functionality in moose. If you see a dialogue box like this one: + +.. automodule:: func + :members: main + +You can view the code by clicking the green source button on the left side of the box. Alternatively, the source code for all of the examples in the documentation can be found in ``moose/moose-examples/snippets``. Once you run each file in python, it is encouraged that you look through the code to understand how it works. + +In the quickstart, most of the snippets demonstrate the functionality of specific classes. However, snippets in later sections such as the cookbook show how to do specific things in moose such as creating networks, chemical models, and synaptic channels. + + +Importing moose and accessing documentation +=========================================== + + +In a python script you import modules to access the functionalities they provide. In order to use moose, you need to import it within a python environment or at the beginning of your python script. + + >>> import moose + +This make the ``moose`` module available for use in Python. You can use Python's built-in ``help`` function to read the top-level documentation for the moose module. + + >>> help(moose) + +This will give you an overview of the module. Press ``q`` to exit the pager and get back to the interpreter. You can also access the documentation for individual classes and functions this way. >>> help(moose.connect) @@ -69,6 +110,13 @@ Note that you need to put the class-name followed by dot followed by field-name within quotes. Otherwise, ``moose.doc`` will receive the field value as parameter and get confused. +Alternatively, if you want to see a full list of classes, functions and their fields, you can browse through the following pages. This is especially helpful when going through snippets. + +* :ref:`genindex` +* :ref:`modindex` +.. + :ref:`search` + .. _quickstart-creating: Creating objects and traversing the object hierarchy