Skip to content

Commit

Permalink
Merge pull request #222 from somexlab/v0.3.9
Browse files Browse the repository at this point in the history
v0.3.9
  • Loading branch information
enrico-lattuada authored Apr 4, 2024
2 parents 8c56c9b + 5efe7ff commit baf445c
Show file tree
Hide file tree
Showing 10 changed files with 211 additions and 46 deletions.
20 changes: 17 additions & 3 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ on:
branches:
- main

# trigger on request
workflow_dispatch:

jobs:
build_sdist:
name: Build source distribution
Expand All @@ -37,7 +40,7 @@ jobs:
if-no-files-found: error

build_wheels:
name: Build wheel for ${{ matrix.os }}, Python ${{ matrix.python-version }}
name: Build wheel for ${{ matrix.os }}, Python ${{ matrix.python-version[1] }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -48,6 +51,12 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
if: runner.os == 'Windows'

- name: Build wheels
uses: pypa/cibuildwheel@v2.17.0
env:
Expand All @@ -64,10 +73,15 @@ jobs:
CIBW_ARCHS_WINDOWS: auto64

# Configure environment variables
MACOSX_DEPLOYMENT_TARGET: "10.14"
MACOSX_DEPLOYMENT_TARGET: "10.9"

# verbosity
CIBW_BUILD_VERBOSITY: 1

# Test the wheels
# TBD
#CIBW_TEST_REQUIRES: "pytest pytest-regtest"
#CIBW_TEST_COMMAND: "pytest -v {project}/tests"
#CIBW_TEST_SKIP:

- name: Upload wheel artifacts
uses: actions/upload-artifact@v4
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@ Change Log
v0.3
----

v0.3.9 (2024-04-04)
^^^^^^^^^^^^^^^^^^^

*Added*

* Instructions for installation via PyPI and on Google Colab

*Changed*

* Updated minimal example notebook

*Fixed*

* Windows' PyPI wheels

.. *Deprecated*
.. *Removed*
v0.3.8 (2024-03-28)
^^^^^^^^^^^^^^^^^^^

Expand Down
100 changes: 100 additions & 0 deletions docs/source/colab.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
.. Copyright (c) 2023-2023 University of Vienna, Enrico Lattuada, Fabian Krautgasser, and Roberto Cerbino.
.. Part of FastDDM, released under the GNU GPL-3.0 License.
Installing in Google Colab
==========================

**FastDDM** can be installed in `Google Colab <https://colab.research.google.com/>`_, also with GPU
support. This allows to test the library without the need to install it locally on workstations.

.. tip::

To better understand what the different options imply, see :ref:`build` and
:ref:`install_sdist`.

Open a new notebook.
If you wish to use the GPU provided by the host server, change the ``runtime type``.
To do so, select from the toolbar ``Runtime > Change runtime type`` and select a GPU available from
the ``Hardware accelerator`` list.
As of today (3 April 2024), with the free plan, you should have access to the T4 GPU.
Save and go back to your notebook.

To check that the GPU is working, run the following command in a cell

.. code-block:: python
!nvidia-smi
From pip source distribution
----------------------------

To install the source distribution via ``pip``, run the command below

.. code-block:: python
!pip3 install --no-binary fastddm fastddm
From GitHub repository source code
----------------------------------

This is the preferred mode if you want to run the unit tests.
Clone the source code from the GitHub repository

.. code-block:: python
!git clone --depth 1 --branch <version_name> https://github.com/somexlab/fastddm.git
For example, to clone the version ``v0.3.8``, run

.. code-block:: python
!git clone --depth 1 --branch v0.3.8 https://github.com/somexlab/fastddm.git
Change directory to the source code one

.. code-block:: python
%cd fastddm
If you want to install the library with C++ support, run the following command in a cell

.. code-block:: python
%env ENABLE_CPP=ON
If you want to install the library with GPU (CUDA) support, run the following command in a cell

.. code-block:: python
%env ENABLE_CUDA=ON
(This also enables the C++ support.)

.. warning::

Due to the small amount of available RAM memory, we also warmly recommend to enable the single
precision calculation option::

%env SINGLE_PRECISION=ON

Finally, install **FastDDM**

.. code-block:: python
!python3 -m pip install .
.. tip::

To run unit tests, you need some additional libraries. Run::

!python3 -m pip install pytest pytest-regtest

Then, run the tests with::

!pytest -v

Now you can go back to your home directory and work with **FastDDM**!

.. code-block:: python
%cd ..
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
year = datetime.date.today().year
copyright = f"2023-{year}, Enrico Lattuada, Fabian Krautgasser, Roberto Cerbino"
author = "Enrico Lattuada, Fabian Krautgasser, Roberto Cerbino"
version = "0.3.2"
version = "0.3.9"
release = version

pygments_style = "friendly"
Expand Down
1 change: 1 addition & 0 deletions docs/source/getting-started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ Getting started
build
conda
pypi
colab
20 changes: 19 additions & 1 deletion docs/source/pypi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,24 @@
Installing from PyPI
====================

Install precompiled wheels
--------------------------

Precompiled wheels are available through `PyPI <https://pypi.org/project/fastddm/>`_ with C++
support for most OSs and Python versions.
The command below will install **FastDDM**

.. code-block:: bash
$ pip3 install fastddm
.. warning::

If wheels are not available for your system, ``pip`` will fall back to the installation of the
source distribution. Refer to the :ref:`build` section for more information.

.. _install_sdist:

Install source distribution
---------------------------

Expand All @@ -14,4 +32,4 @@ Run the following line in your terminal:

.. code-block:: bash
$ pip3 install --no-binary fastddm
$ pip3 install --no-binary fastddm fastddm
91 changes: 52 additions & 39 deletions examples/fastddm_examples.ipynb

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ dynamic = [ "license", "version" ]
keywords = [
"cuda",
"differential-dynamic-microscopy",
"digital-fourier-microscopy",
"gpu",
"image-analysis",
"microscopy",
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def build_extension(self, ext):
setup(
name="fastddm",
use_scm_version={
"fallback_version": "0.3.2",
"fallback_version": "0.3.9",
},
packages=find_packages(),
setup_requires=[
Expand Down
2 changes: 1 addition & 1 deletion src/python/make_install_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
name="fastddm",
use_scm_version={
"root": "${CMAKE_SOURCE_DIR}",
"fallback_version": "0.3.2",
"fallback_version": "0.3.9",
},
setup_requires=["setuptools_scm"],
packages=["fastddm"],
Expand Down

0 comments on commit baf445c

Please sign in to comment.