diff --git a/README.rst b/README.rst index 394e5da..e1ef61a 100644 --- a/README.rst +++ b/README.rst @@ -163,6 +163,23 @@ wrapped with ``showerpipe``. More information on the API is available in the `documentation `__ +Note on FastJet compatibility +----------------------------- +``graphicle`` offers a function wrapper around ``fastjet`` to cluster +``MomentumArray`` objects using their optimised generalised-kT algorithm. +However, this library cannot build wheels for all systems, including Windows +and the latest macOS systems using ARM architectures. +Therefore, in order to use ``graphicle.select.fastjet_clusters()``, you must +install graphicle with ``fastjet`` as an optional dependency. +This enables users who don't want the ``fastjet`` wrapper to ignore it, and +still make the most of ``graphicle`` many other features. +Use the following to get started: + +.. code:: bash + + pip install "graphicle[fastjet]" + + .. |PyPI version| image:: https://img.shields.io/pypi/v/graphicle.svg :target: https://pypi.org/project/graphicle/ .. |Tests| image:: https://github.com/jacanchaplais/graphicle/actions/workflows/tests.yml/badge.svg diff --git a/graphicle/select.py b/graphicle/select.py index 4aeb71c..fd03252 100644 --- a/graphicle/select.py +++ b/graphicle/select.py @@ -11,7 +11,6 @@ import typing as ty import awkward as ak -import fastjet as fj import numpy as np import pandas as pd import scipy.optimize as opt @@ -120,6 +119,8 @@ def fastjet_clusters( cause undefined behaviour if you apply views on the underlying data in a ``MaskArray`` without copying it. """ + import fastjet as fj + if pt_cut is None: pt_cut = 0.0 elif pt_cut < 0.0: diff --git a/pyproject.toml b/pyproject.toml index b127f80..a409c0b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,7 +27,6 @@ dependencies = [ "mcpid", "typicle >=0.1.4", "networkx", - "fastjet >=3.4.1.2", "awkward", "rich", "deprecation", @@ -36,6 +35,11 @@ dependencies = [ "tabulate", ] +[project.optional-dependencies] +fastjet = [ + "fastjet >=3.4.1.2", +] + [project.urls] repository = "https://github.com/jacanchaplais/graphicle" documentation = "https://graphicle.readthedocs.io"