From 9526b2e8b126bf63b081de13cde3a6e652906405 Mon Sep 17 00:00:00 2001 From: Cedric Bouysset Date: Fri, 1 Mar 2024 15:43:11 +0000 Subject: [PATCH] docs: fix build taking too long --- CHANGELOG.md | 7 ++++++- docs/conf.py | 2 +- prolif/fingerprint.py | 4 ++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 29c4339..a6390ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,9 +11,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 Maintenance update: +### Added + +- `PROLIF_N_JOBS` environment variable to control multiprocessing during the + documentation build. + ### Changed -- Updated CI pipelines to test on Python 3.8, 3.10 and 3.12 +- Updated CI pipelines to test on Python 3.8, 3.10 and 3.12. ### Fixed diff --git a/docs/conf.py b/docs/conf.py index 2b7161a..d2a0862 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -54,7 +54,7 @@ ] nb_execution_allow_errors = False nb_execution_raise_on_error = True -nb_execution_timeout = 180 +nb_execution_timeout = 240 mathjax_path = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML" autosectionlabel_prefix_document = True diff --git a/prolif/fingerprint.py b/prolif/fingerprint.py index cb16f7d..4736bc4 100644 --- a/prolif/fingerprint.py +++ b/prolif/fingerprint.py @@ -24,6 +24,8 @@ fp = prolif.Fingerprint.from_pickle("fingerprint.pkl") """ + +import os import warnings from collections.abc import Sized from functools import wraps @@ -462,6 +464,8 @@ def run( raise ValueError("converter_kwargs must be a list of 2 dicts") converter_kwargs = converter_kwargs or ({}, {}) + if n_jobs is None: + n_jobs = os.environ.get("PROLIF_N_JOBS", n_jobs) if residues == "all": residues = list(Molecule.from_mda(prot, **converter_kwargs[1]).residues) if n_jobs != 1: