install.rst 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. How to install the pyCBD framework?
  2. ===================================
  3. This section describes the necessary components and steps to take to install
  4. the CBD framework.
  5. Dependencies
  6. ------------
  7. The following dependencies are required:
  8. * Python :code:`>= 3.6`, as identified by `vermin <https://pypi.org/project/vermin/>`_.
  9. * All additional libraries should be bundled with Python, so no extra installations should be needed.
  10. .. versionchanged:: 1.5
  11. Python 2 is no longer supported.
  12. Next, there are some additional **optional** requirements:
  13. * **Simulation:**
  14. * `tqdm <https://tqdm.github.io/>`_ when using a progress-bar of the simulation.
  15. * `TkInter <https://docs.python.org/3/library/tkinter.html>`_ for realtime simulation using the
  16. :code:`Tk` backend/platform.
  17. * **Visualization and Plotting:**
  18. * `GraphViz <https://www.graphviz.org/download/>`_ for generating a graphical version of the dependency graph.
  19. * `MatPlotLib <https://matplotlib.org/>`_ for plotting data in Matplotlib.
  20. * `Seaborn <https://seaborn.pydata.org/>`_ for plotting data using Seaborn.
  21. * `Bokeh <https://docs.bokeh.org/en/latest/index.html>`_ for plotting data in Bokeh.
  22. * **Conversion:**
  23. * `Lark <https://lark-parser.readthedocs.io/en/latest/>`_ for the :mod:`pyCBD.converters.eq2CBD` converter, to
  24. allow the creation of CBDs directly from a textual language.
  25. * `PythonPDEVS <http://msdl.cs.mcgill.ca/projects/DEVS/PythonPDEVS>`_ for the :mod:`pyCBD.converters.hybrid`
  26. module. This allows CBDs to be run inside of DEVS simulations.
  27. * **Documentation:**
  28. * `Sphinx-Theme <https://pypi.org/project/sphinx-theme/>`_ for creating the docs.
  29. Installation
  30. ------------
  31. There are a few ways of using the framework:
  32. #. Use it as a project dependency. Simply add the :code:`src/pyCBD` folder to your project and
  33. import it w.r.t. the provided path.
  34. #. Edit the :code:`PYTHONPATH` or :code:`sys.path` variables to point to the :code:`src` folder.
  35. This way, the execution of your program will recognize things like:
  36. .. code-block:: python
  37. from pyCBD.Core import CBD
  38. .. tip::
  39. Some code editors (like `PyCharm <https://www.jetbrains.com/pycharm/>`_) allow you to mark
  40. a directory as "Sources Root", which basically adds it to your path upon execution.
  41. #. Execute one of the following commands in the :code:`src` folder to install the project to your
  42. user directory or update it:
  43. .. code-block:: bash
  44. # BUILDING:
  45. python setup.py install --user
  46. # UPDATING:
  47. python -m pip install .
  48. Standalone
  49. ----------
  50. There are some additional standalone components that have been made to work with
  51. the framework, but can technically be used without the connection to CBDs. These are:
  52. .. toctree::
  53. :maxdepth: 3
  54. pyCBD.util
  55. pyCBD.naivelog
  56. pyCBD.realtime