Skip to content

Commit

Permalink
Merge branch 'qutip:master' into bosonic_fitting
Browse files Browse the repository at this point in the history
  • Loading branch information
gsuarezr authored Jul 24, 2024
2 parents 421b475 + bacf463 commit faabd06
Show file tree
Hide file tree
Showing 139 changed files with 7,476 additions and 2,773 deletions.
28 changes: 14 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ jobs:
OVERRIDE_VERSION: ${{ github.event.inputs.override_version }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
name: Install Python
with:
# For the sdist we should be as conservative as possible with our
# Python version. This should be the lowest supported version. This
# means that no unsupported syntax can sneak through.
python-version: '3.9'
python-version: '3.10'

- name: Install pip build
run: |
Expand Down Expand Up @@ -90,7 +90,7 @@ jobs:
zip "$zipfile" -r "$stem"
rm -r "$stem"
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: sdist
path: |
Expand All @@ -107,21 +107,21 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
env:
# Set up wheels matrix. This is CPython 3.9--3.12 for all OS targets.
CIBW_BUILD: "cp3{9,10,11,12}-*"
# Set up wheels matrix. This is CPython 3.10--3.12 for all OS targets.
CIBW_BUILD: "cp3{10,11,12}-*"
# Numpy and SciPy do not supply wheels for i686 or win32 for
# Python 3.10+, so we skip those:
CIBW_SKIP: "*-musllinux* cp3{10,11,12}-manylinux_i686 cp3{10,11,12}-win32"
OVERRIDE_VERSION: ${{ github.event.inputs.override_version }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
name: Install Python
with:
# This is about the build environment, not the released wheel version.
python-version: '3.9'
python-version: '3.10'

- name: Install cibuildwheel
run: |
Expand All @@ -137,7 +137,7 @@ jobs:
if [[ ! -z "$OVERRIDE_VERSION" ]]; then echo "$OVERRIDE_VERSION" > VERSION; fi
python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: wheels
path: ./wheelhouse/*.whl
Expand All @@ -160,17 +160,17 @@ jobs:

steps:
- name: Download build artifacts to local runner
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4

- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.9'
python-version: '3.10'

- name: Verify this is not a dev version
shell: bash
run: |
python -m pip install wheels/*-cp39-cp39-manylinux*.whl
python -m pip install wheels/*-cp310-cp310-manylinux*.whl
python -c 'import qutip; print(qutip.__version__); assert "dev" not in qutip.__version__; assert "+" not in qutip.__version__'
# We built the zipfile for convenience distributing to Windows users on
Expand All @@ -193,17 +193,17 @@ jobs:

steps:
- name: Download build artifacts to local runner
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4

- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.9'
python-version: '3.10'

- name: Verify this is not a dev version
shell: bash
run: |
python -m pip install wheels/*-cp39-cp39-manylinux*.whl
python -m pip install wheels/*-cp310-cp310-manylinux*.whl
python -c 'import qutip; print(qutip.__version__); assert "dev" not in qutip.__version__; assert "+" not in qutip.__version__'
# We built the zipfile for convenience distributing to Windows users on
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/build_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.8'
python-version: '3.11'

- name: Install documentation dependencies
run: |
Expand All @@ -27,7 +27,7 @@ jobs:
run: |
# Build without build isolation so that we use the build
# dependencies already installed from doc/requirements.txt.
python -m pip install -e .[full] --no-build-isolation
python -m pip install -e .[full] --no-build-isolation --config-settings editable_mode=compat
# Install in editable mode so it doesn't matter if we import from
# inside the installation directory, otherwise we can get some errors
# because we're importing from the wrong location.
Expand All @@ -43,7 +43,7 @@ jobs:
# -T : display a full traceback if a Python exception occurs
- name: Upload built PDF files
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: qutip_pdf_docs
path: doc/_build/latex/*
Expand All @@ -59,7 +59,7 @@ jobs:
# -T : display a full traceback if a Python exception occurs
- name: Upload built HTML files
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: qutip_html_docs
path: doc/_build/html/*
Expand Down
177 changes: 105 additions & 72 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,96 +29,102 @@ jobs:
# matrix size; make sure to test all supported versions in some form.
python-version: ["3.11"]
case-name: [defaults]
numpy-requirement: [">=1.22"]
scipy-requirement: [">=1.8"]
# Version 2 not yet available on conda's default channel
condaforge: [1]
numpy-build: [""]
numpy-requirement: [""]
scipy-requirement: [">=1.9"]
coverage-requirement: ["==6.5"]
# Extra special cases. In these, the new variable defined should always
# be a truth-y value (hence 'nomkl: 1' rather than 'mkl: 0'), because
# the lack of a variable is _always_ false-y, and the defaults lack all
# the special cases.
include:
# Python 3.9, Scipy 1.7, numpy 1.22
# On more version than suggested by SPEC 0
# https://scientific-python.org/specs/spec-0000/
# There are deprecation warnings when using cython 0.29.X
- case-name: Old setup
- case-name: p312 numpy 2
os: ubuntu-latest
python-version: "3.9"
scipy-requirement: ">=1.8,<1.9"
numpy-requirement: ">=1.22,<1.23"
condaforge: 1
oldcython: 1
pytest-extra-options: "-W ignore:dep_util:DeprecationWarning"

# Python 3.10, no mkl, scipy 1.9, numpy 1.23
# Scipy 1.9 did not support cython 3.0 yet.
# cython#17234
- case-name: no mkl
os: ubuntu-latest
python-version: "3.10"
scipy-requirement: ">=1.9,<1.10"
numpy-requirement: ">=1.23,<1.24"
condaforge: 1
oldcython: 1
nomkl: 1
pytest-extra-options: "-W ignore:dep_util:DeprecationWarning"
python-version: "3.12"
numpy-build: ">=2.0.0"
numpy-requirement: ">=2.0.0"
pypi: 1

# Python 3.10, no cython, scipy 1.10, numpy 1.24
- case-name: no cython
- case-name: p310 numpy 1.22
os: ubuntu-latest
python-version: "3.10"
numpy-build: ">=1.22.0,<1.23.0"
numpy-requirement: ">=1.22.0,<1.23.0"
scipy-requirement: ">=1.10,<1.11"
numpy-requirement: ">=1.24,<1.25"
nocython: 1

# Python 3.11 and recent numpy
# Use conda-forge to provide Python 3.11 and latest numpy
# Ignore deprecation of the cgi module in Python 3.11 that is
# still imported by Cython.Tempita. This was addressed in
# https://github.com/cython/cython/pull/5128 but not backported
# to any currently released version.
- case-name: Python 3.11
os: ubuntu-latest
python-version: "3.11"
condaforge: 1
scipy-requirement: ">=1.11,<1.12"
numpy-requirement: ">=1.25,<1.26"
conda-extra-pkgs: "suitesparse" # for compiling cvxopt
semidefinite: 1
oldcython: 1
pypi: 1
pytest-extra-options: "-W ignore:dep_util:DeprecationWarning -W \"ignore:The 'renderer' parameter of do_3d_projection\""

# Python 3.12 and latest numpy
# Use conda-forge to provide Python 3.11 and latest numpy
- case-name: Python 3.12
- case-name: p312, numpy fallback
os: ubuntu-latest
python-version: "3.12"
scipy-requirement: ">=1.12,<1.13"
numpy-requirement: ">=1.26,<1.27"
scipy-requirement: ">=1.11,<1.12"
condaforge: 1
pytest-extra-options: "-W ignore:datetime:DeprecationWarning"
# Install mpi4py to test mpi_pmap
# Should be enough to include this in one of the runs
includempi: 1

# Python 3.10, no mkl, scipy 1.9, numpy 1.23
# Scipy 1.9 did not support cython 3.0 yet.
# cython#17234
- case-name: p310 no mkl
os: ubuntu-latest
python-version: "3.10"
numpy-requirement: ">=1.23,<1.24"
scipy-requirement: ">=1.9,<1.10"
semidefinite: 1
condaforge: 1
oldcython: 1
nomkl: 1
pytest-extra-options: "-W ignore:dep_util:DeprecationWarning -W \"ignore:The 'renderer' parameter of do_3d_projection\""

# Mac
# Mac has issues with MKL since september 2022.
- case-name: macos
os: macos-latest
# setup-miniconda not compatible with macos-latest presently.
# https://github.com/conda-incubator/setup-miniconda/issues/344
os: macos-12
python-version: "3.12"
numpy-build: ">=2.0.0"
numpy-requirement: ">=2.0.0"
condaforge: 1
nomkl: 1

- case-name: macos - numpy fallback
os: macos-12
python-version: "3.11"
numpy-build: ">=2.0.0"
numpy-requirement: ">=1.25,<1.26"
condaforge: 1
nomkl: 1

# Windows. Once all tests pass without special options needed, this
# can be moved to the main os list in the test matrix. All the tests
# that fail currently seem to do so because mcsolve uses
# multiprocessing under the hood. Windows does not support fork()
# well, which makes transfering objects to the child processes
# error prone. See, e.g., https://github.com/qutip/qutip/issues/1202
- case-name: Windows
os: windows-latest
python-version: "3.11"
numpy-build: ">=2.0.0"
numpy-requirement: ">=2.0.0"
pypi: 1

- case-name: Windows - numpy fallback
os: windows-latest
python-version: "3.10"
numpy-build: ">=2.0.0"
numpy-requirement: ">=1.24,<1.25"
semidefinite: 1
oldcython: 1
nocython: 1
condaforge: 1
pytest-extra-options: "-W ignore:dep_util:DeprecationWarning -W \"ignore:The 'renderer' parameter of do_3d_projection\""

steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
Expand All @@ -128,23 +134,28 @@ jobs:
# In the run, first we handle any special cases. We do this in bash
# rather than in the GitHub Actions file directly, because bash gives us
# a proper programming language to use.
# We install without build isolation so qutip is compiled with the
# version of cython, scipy, numpy in the test matrix, not a temporary
# version use in the installation virtual environment.
run: |
QUTIP_TARGET="tests,graphics,semidefinite,ipython,extras"
if [[ -z "${{ matrix.nocython }}" ]]; then
QUTIP_TARGET="$QUTIP_TARGET,runtime_compilation"
fi
if [[ "${{ matrix.oldcython }}" ]]; then
pip install cython==0.29.36
fi
export CI_QUTIP_WITH_OPENMP=${{ matrix.openmp }}
if [[ -z "${{ matrix.nomkl }}" ]]; then
conda install blas=*=mkl "numpy${{ matrix.numpy-requirement }}" "scipy${{ matrix.scipy-requirement }}"
# Install the extra requirement
python -m pip install pytest>=5.2 pytest-rerunfailures # tests
python -m pip install ipython # ipython
python -m pip install loky tqdm # extras
python -m pip install "coverage${{ matrix.coverage-requirement }}" chardet
python -m pip install pytest-cov coveralls pytest-fail-slow
if [[ "${{ matrix.pypi }}" ]]; then
pip install "numpy${{ matrix.numpy-build }}"
pip install "scipy${{ matrix.scipy-requirement }}"
elif [[ -z "${{ matrix.nomkl }}" ]]; then
conda install blas=*=mkl "numpy${{ matrix.numpy-build }}" "scipy${{ matrix.scipy-requirement }}"
elif [[ "${{ matrix.os }}" =~ ^windows.*$ ]]; then
# Conda doesn't supply forced nomkl builds on Windows, so we rely on
# pip not automatically linking to MKL.
pip install "numpy${{ matrix.numpy-requirement }}" "scipy${{ matrix.scipy-requirement }}"
pip install "numpy${{ matrix.numpy-build }}" "scipy${{ matrix.scipy-requirement }}"
else
conda install nomkl "numpy${{ matrix.numpy-requirement }}" "scipy${{ matrix.scipy-requirement }}"
conda install nomkl "numpy${{ matrix.numpy-build }}" "scipy${{ matrix.scipy-requirement }}"
fi
if [[ -n "${{ matrix.conda-extra-pkgs }}" ]]; then
conda install "${{ matrix.conda-extra-pkgs }}"
Expand All @@ -153,9 +164,31 @@ jobs:
# Use openmpi because mpich causes problems. Note, environment variable names change in v5
conda install "openmpi<5" mpi4py
fi
python -m pip install -e .[$QUTIP_TARGET]
python -m pip install "coverage${{ matrix.coverage-requirement }}"
python -m pip install pytest-cov coveralls pytest-fail-slow
if [[ "${{ matrix.oldcython }}" ]]; then
python -m pip install cython==0.29.36 filelock matplotlib==3.5
else
python -m pip install cython filelock
fi
python -m pip install -e . -v --no-build-isolation
if [[ "${{ matrix.nocython }}" ]]; then
python -m pip uninstall cython -y
fi
if [[ "${{ matrix.pypi }}" ]]; then
python -m pip install "numpy${{ matrix.numpy-requirement }}"
elif [[ -z "${{ matrix.nomkl }}" ]]; then
conda install "numpy${{ matrix.numpy-requirement }}"
elif [[ "${{ matrix.os }}" =~ ^windows.*$ ]]; then
python -m pip install "numpy${{ matrix.numpy-requirement }}"
else
conda install nomkl "numpy${{ matrix.numpy-requirement }}"
fi
if [[ -n "${{ matrix.semidefinite }}" ]]; then
python -m pip install cvxpy>=1.0 cvxopt
fi
python -m pip install matplotlib>=1.2.1 # graphics
- name: Package information
run: |
Expand Down Expand Up @@ -226,7 +259,7 @@ jobs:
name: Verify Towncrier entry added
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

You are most welcome to contribute to QuTiP development by forking this repository and sending pull requests, or filing bug reports at the [issues page](https://github.com/qutip/qutip/issues).
You can also help out with users' questions, or discuss proposed changes in the [QuTiP discussion group](https://groups.google.com/g/qutip).
All code contributions are acknowledged in the [contributors](https://qutip.org/docs/latest/contributors.html) section in the documentation.
All code contributions are acknowledged in the [contributors](https://qutip.readthedocs.io/en/stable/contributors.html) section in the documentation.

For more information, including technical advice, please see the ["contributing to QuTiP development" section of the documentation](https://qutip.org/docs/latest/development/contributing.html).
For more information, including technical advice, please see the ["contributing to QuTiP development" section of the documentation](https://qutip.readthedocs.io/en/stable/development/contributing.html).
Loading

0 comments on commit faabd06

Please sign in to comment.