Skip to content

Commit

Permalink
added ipynb support to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Teschl committed Jun 6, 2024
1 parent 9d585e5 commit 5ba0c96
Show file tree
Hide file tree
Showing 5 changed files with 137 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
'sphinx.ext.napoleon',
'sphinx.ext.viewcode',
'sphinx.ext.todo',
'nbsphinx',
]

project = 'TopoToolbox'
Expand Down
4 changes: 4 additions & 0 deletions docs/examples.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Examples
========

Here we can link to the example .ipynb files later on.
41 changes: 41 additions & 0 deletions docs/getting_started.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Getting Started with TopoToolbox"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import topotoolbox"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
4 changes: 4 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ Welcome to TopoToolbox's python documentation!
:caption: Contents:

api
installing
getting_started
examples


Indices and tables
==================
Expand Down
87 changes: 87 additions & 0 deletions docs/installing.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
How to install
==============

Installing topotoolbox with pip
-------------------------------

[not working jet!] ::

$ pip install topotoolbox

Generating/Installing distribution archives
-------------------------------------------

For any operating system, install the following:

- **Python**
- **pip**
- **Git** (only when *building* the package yourself)

Linux
~~~~~

**Installing from .whl file**

Make sure to choose the appropriate file for your OS. For Linux, the file name should contain something like: `linux_x86_64`

.. code-block:: bash
pip install dist_name.whl
**Installing directly from the repository:**

.. code-block:: bash
cd path/to/pytopotoolbox
pip install .
**Generating distribution archives**

.. code-block:: bash
cd path/to/pytopotoolbox
python3 -m pip install --upgrade build
python3 -m build
Windows
~~~~~~~

**Installing from .whl file**

Make sure to choose the appropriate file for your OS. For Windows, the file name should contain something like: `win_amd64`.

.. code-block:: bash
pip install dist_name.whl
**Installing directly from the repository:**

Since there are C/C++ files that need to be compiled in order to build the package, there are a few extra steps to take.

1. Install the `Developer Command Prompt for VS 2022 <https://visualstudio.microsoft.com/downloads/>`_.
- Scroll down to '*All Downloads*'
- Open '*Tools for Visual Studio*'
- Download '*Build Tools for Visual Studio 2022*'
- Install it while including the '*Desktop development with C++*' workload
2. To ensure the compiler is working with 64-bit architecture, that is necessary for python, **open 'x64 Native Tools Command Prompt for VS 2022'** instead of the '*Developer Command Prompt*' that defaults to 32-bit architecture.
3. In the newly opened terminal, run:

.. code-block:: bash
cd path\to\pytopotoolbox
pip install .
**Generating distribution archives**

Open the 'x64 Native Tools Command Prompt for VS 2022' Terminal and run:

.. code-block:: bash
cd path\to\pytopotoolbox
py -m pip install --upgrade build
py -m build
Mac
~~~

*work in progress*

0 comments on commit 5ba0c96

Please sign in to comment.