Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: pygae/clifford
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.3.0
Choose a base ref
...
head repository: pygae/clifford
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Jun 2, 2020

  1. Fix compatibility with numba 0.50.0 (#323)

    Note that our Python 3.5 conda CI still exercises an old version of numba.
    eric-wieser authored Jun 2, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e080fa6 View commit details
  2. Bump version on master to start development on 1.4.0

    This means that users installing from master will have a more useful version number.
    eric-wieser committed Jun 2, 2020
    Copy the full SHA
    4da4f7d View commit details
  3. Merge in numba fixes

    eric-wieser committed Jun 2, 2020
    Copy the full SHA
    96d7e11 View commit details
  4. Copy the full SHA
    7d0727b View commit details

Commits on Jun 3, 2020

  1. Copy the full SHA
    c07db7d View commit details

Commits on Jun 9, 2020

  1. Copy the full SHA
    49a7a1d View commit details
  2. Merge pull request #327 from hugohadfield/cherrypick_linear_op_matrix

    Improve speed of linear_operator_to_matrix
    hugohadfield authored Jun 9, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    bf74bad View commit details
  3. ENH: Add numba extension types for MultiVector and Layout

    This enables just enough to get started:
    
    * mv.layout
    * mv.value
    * MultiVector(layout, value)
    
    The approach used to box and unbox layout is taken from `numba_passthru`, and essentially just smuggles a PyObject pointer.
    eric-wieser committed Jun 9, 2020
    Copy the full SHA
    439e905 View commit details
  4. Add support for constant multivectors in jitted functions.

    This changes the approach for storing `Layout` objects to be using globals via `add_dynamic_addr`.
    This will disable numba caching, but we don't use that anyway.
    eric-wieser committed Jun 9, 2020
    Copy the full SHA
    0a63cf4 View commit details
  5. Copy the full SHA
    9013c6f View commit details
  6. Do not incur the cost of pickle when unboxing

    This seems to allow a natively jitted `generate_translation_rotor` to win out vs our current wrapper approach.
    eric-wieser committed Jun 9, 2020
    Copy the full SHA
    8f4f247 View commit details

Commits on Jun 10, 2020

  1. Merge pull request #189 from eric-wieser/numba-extension

    Add primitive numba support for Layout and MultiVector
    eric-wieser authored Jun 10, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    d45b964 View commit details
  2. Copy the full SHA
    da6b355 View commit details
  3. Copy the full SHA
    4923d3f View commit details
  4. Copy the full SHA
    b01b663 View commit details
  5. Introduce a private helper function to get the short name for a layout

    We already need this in two places, and the numba extension will likely want it too.
    eric-wieser committed Jun 10, 2020
    Copy the full SHA
    b676395 View commit details
  6. numba: Change layout to be stored in the type itself

    This means we have access to the multiplication functions at jit-time.
    Note that this makes `MultiVector._numba_type_` a bit slower, as it has cache based on both the layout and the dtype.
    eric-wieser committed Jun 10, 2020
    Copy the full SHA
    bdd0276 View commit details
  7. Merge pull request #331 from eric-wieser/layout-in-type

    numba: Change layout to be stored in type itself
    eric-wieser authored Jun 10, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6bbd6cd View commit details
  8. numba: provide jit overloads for basic multivector binary operators (#…

    …332)
    
    This provides all of the `-+*^|` operators.
    hugohadfield authored Jun 10, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    2550e83 View commit details

Commits on Jun 11, 2020

  1. numba: Add support for some more operators (#333)

    This adds:
    * MultiVector / scalar
    * -MultiVector
    * +MultiVector
    * ~MultiVector
    eric-wieser authored Jun 11, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1881dac View commit details
  2. tools.g3c: Remove the _val variables

    These are no longer necessary, we can use .value in numba
    eric-wieser committed Jun 11, 2020
    Copy the full SHA
    0457c8b View commit details
  3. tools.g3c: Add jit decorators to all of the val_ function wrappers

    This means there is no longer any reason to call the `val` versions from other code.
    eric-wieser committed Jun 11, 2020
    Copy the full SHA
    2803619 View commit details

Commits on Jun 18, 2020

  1. tools.g3c: Invert the relationship between func and val_func func…

    …tions (#329)
    
    This changes all the algorithms to be implemented using the numba overloading syntax.
    This isn't exhaustive, but hits most of the cases.
    
    We can't remove the `val_func` functions until we remove all the callers.
    eric-wieser authored Jun 18, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    bb0e2d1 View commit details

Commits on Jun 19, 2020

  1. numba: Add support for the projection operator

    Numba does not make it easy to overload `__call__` at the moment.
    We should follow up with numba to see if they can make it easier in future.
    eric-wieser committed Jun 19, 2020
    Copy the full SHA
    12c978a View commit details
  2. Copy the full SHA
    581a135 View commit details
  3. Merge pull request #336 from eric-wieser/project-jit

    numba: Add support for the projection operator
    eric-wieser authored Jun 19, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a00a872 View commit details
  4. numba: Add support for abs(mv) and mv.norm (#337)

    This makes the `norm` and `normalised` functions from tools.g3c unnecessary.
    Conveniently, we can mostly reuse the pure-python implementations here, as these functions are trivial.
    eric-wieser authored Jun 19, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3d42601 View commit details

Commits on Jun 20, 2020

  1. doc: fix broken resources links

    It seems docutils doesn't allow mixing custom link text and out-of-line urls
    eric-wieser committed Jun 20, 2020
    Copy the full SHA
    f36b7af View commit details
  2. Copy the full SHA
    51e4b2c View commit details
  3. doc: Use citations for a bunch of papers instead of plaintext

    This is far from exhaustive, but covers the frequently-repeated ones.
    eric-wieser committed Jun 20, 2020
    Copy the full SHA
    c8b113d View commit details
  4. Copy the full SHA
    22de209 View commit details
  5. Copy the full SHA
    77366e3 View commit details
  6. Copy the full SHA
    3ed204d View commit details

Commits on Jun 22, 2020

  1. Merge pull request #339 from eric-wieser/citations

    Use sphinxcontrib-bibtex
    eric-wieser authored Jun 22, 2020
    Copy the full SHA
    e378723 View commit details

Commits on Jun 23, 2020

  1. Do not convert gradeList back and forth between list and ndarray (#340)

    This should be a marginal performance boost, but the main goal is to reduce the amount of similar state in `Layout`.
    eric-wieser authored Jun 23, 2020
    Copy the full SHA
    3bcbbdb View commit details

Commits on Jun 30, 2020

  1. Deprecate the sequence-like methods of MultiVector (#346)

    Closes gh-344, closes gh-345.
    
    In my opinion it is wrong to say that a multivector _is_ a sequence of coefficients - it happens to _have_ a sequence of coefficients, and if you want to access these you get all the sequence behavior through `.value`.
    
    This also remove all but one use of these methods - the last one is internal to numpy, and will stop emitting warnings once we conclude the deprecation anyway.
    eric-wieser authored Jun 30, 2020
    Copy the full SHA
    bb5ac25 View commit details

Commits on Jul 1, 2020

  1. Added the start of support for N-d arrays of multivectors (#343)

    Previously only 1d arrays of multivectors were supported.
    
    Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
    hugohadfield and eric-wieser authored Jul 1, 2020
    Copy the full SHA
    823c170 View commit details

Commits on Jul 2, 2020

  1. Copy the full SHA
    23052e9 View commit details

Commits on Jul 20, 2020

  1. numba: Fix pickling

    Fixes #349, by not saving the cache.
    
    Objects that are round-tripped through pickle probably still have issues, but this at least prevents it crashing immediately.
    eric-wieser committed Jul 20, 2020
    Copy the full SHA
    62db78d View commit details
  2. numba: Fix pickling of LayoutType(#350)

    Fixes #349, by not saving the contents of the `_cache` attribute.
    
    Objects that are round-tripped through pickle probably still have issues, but this at least prevents it crashing immediately.
    eric-wieser authored Jul 20, 2020
    Copy the full SHA
    6659f44 View commit details
  3. Copy the full SHA
    2a634ae View commit details
  4. numba: Add support for .conjugate() and .gradeInvol() in jitted code

    Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
    hugohadfield and eric-wieser committed Jul 20, 2020
    Copy the full SHA
    252aff6 View commit details
  5. Add the closed form inverse for total dimension <= 5

    Implements the inverse given in:
    
    > Multivector and multivector matrix inverses in real Clifford algebras
    > Eckhard Hitzer, Stephen Sangwine (2017)
    
    This method is a speed up over the linear algebra method even without JITing.
    
    Note this does not do the higher dimension inverses based on clifford-valued matrix isomorphism described in the paper.
    
    Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
    hugohadfield and eric-wieser committed Jul 20, 2020
    Copy the full SHA
    6ffc230 View commit details
  6. Copy the full SHA
    3110c20 View commit details

Commits on Jul 22, 2020

  1. Copy the full SHA
    79404e4 View commit details
  2. Use layout.scalar in test

    Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
    hugohadfield and eric-wieser authored Jul 22, 2020
    Copy the full SHA
    7682bff View commit details
  3. Merge pull request #338 from hugohadfield/hitzer-inverse

    Add the closed form inverse for total dimension <= 5
    eric-wieser authored Jul 22, 2020
    Copy the full SHA
    e371de6 View commit details
  4. Copy the full SHA
    a1ad717 View commit details
  5. Copy the full SHA
    1e6e85c View commit details
  6. Add missing math prefix to pi and e

    The rest of this notebook already uses this style.
    
    Also tidies some whitespace.
    eric-wieser committed Jul 22, 2020
    Copy the full SHA
    7e8ee67 View commit details
Showing with 3,753 additions and 1,784 deletions.
  1. +177 −0 .github/workflows/python-package.yml
  2. +19 −0 .mailmap
  3. +6 −1 .readthedocs.yml
  4. +0 −143 .travis.yml
  5. +5 −5 .zenodo.json
  6. +27 −0 CITATION.md
  7. +16 −26 README.md
  8. +0 −15 azure-pipelines.yml
  9. +81 −92 clifford/__init__.py
  10. +3 −2 clifford/_bit_helpers.py
  11. +1 −1 clifford/_blademap.py
  12. +2 −2 clifford/_conformal_layout.py
  13. +144 −74 clifford/_layout.py
  14. +8 −1 clifford/_layout_helpers.py
  15. +143 −48 clifford/_multivector.py
  16. +56 −18 clifford/_mvarray.py
  17. +16 −33 clifford/_numba_utils.py
  18. +3 −3 clifford/_parser.py
  19. +1 −1 clifford/_version.py
  20. +6 −6 clifford/cga.py
  21. +1 −1 clifford/dg3c.py
  22. +3 −3 clifford/dpga.py
  23. +5 −1 clifford/io.py
  24. +122 −0 clifford/numba/__init__.py
  25. +111 −0 clifford/numba/_layout.py
  26. +437 −0 clifford/numba/_multivector.py
  27. +107 −0 clifford/numba/_overload_call.py
  28. +8 −0 clifford/pga2d.py
  29. +164 −0 clifford/taylor_expansions.py
  30. +8 −0 clifford/test/__init__.py
  31. +20 −6 clifford/test/test_algebra_initialisation.py
  32. +0 −2 clifford/test/test_cga.py
  33. +129 −36 clifford/test/test_clifford.py
  34. +114 −0 clifford/test/test_complex.py
  35. +1 −3 clifford/test/test_degenerate.py
  36. +17 −18 clifford/test/test_dg3c.py
  37. +7 −11 clifford/test/test_dpga.py
  38. +15 −0 clifford/test/test_function_cache.py
  39. +274 −280 clifford/test/test_g3c_tools.py
  40. +10 −18 clifford/test/test_io.py
  41. +56 −0 clifford/test/test_multivector_inverse.py
  42. +286 −0 clifford/test/test_numba_extensions.py
  43. +38 −43 clifford/test/test_tools.py
  44. +5 −5 clifford/test/test_tools_classify.py
  45. +86 −0 clifford/test/test_trig_functions.py
  46. +80 −78 clifford/tools/__init__.py
  47. +1 −1 clifford/tools/classify.py
  48. +14 −11 clifford/tools/g3/__init__.py
  49. +1 −1 clifford/tools/g3c/GAOnline.py
  50. +423 −419 clifford/tools/g3c/__init__.py
  51. +10 −11 clifford/tools/g3c/cost_functions.py
  52. +2 −2 clifford/tools/g3c/cuda.py
  53. +3 −3 clifford/tools/g3c/object_fitting.py
  54. +8 −14 clifford/tools/g3c/rotor_estimation.py
  55. +23 −33 clifford/tools/g3c/rotor_parameterisation.py
  56. +2 −2 clifford/transformations.py
  57. +2 −0 docs/api/index.rst
  58. +1 −0 docs/api/numba.rst
  59. +1 −0 docs/api/taylor_expansions.rst
  60. +5 −0 docs/bibliography.rst
  61. +180 −133 docs/changelog.rst
  62. +9 −1 docs/conf.py
  63. +2 −1 docs/index.rst
  64. +0 −6 docs/installation.rst
  65. +3 −0 docs/predefined-algebras.rst
  66. +137 −0 docs/refs.bib
  67. +6 −6 docs/requirements.txt
  68. +3 −7 docs/resources.rst
  69. +1 −2 docs/tutorials/InterfacingOtherMathSystems.ipynb
  70. +1 −1 docs/tutorials/apollonius-cga-augmented.ipynb
  71. 0 docs/tutorials/cga/{clustering.ipynb → clustering.ipynb.bak}
  72. +2 −3 docs/tutorials/cga/index.ipynb
  73. +1 −3 docs/tutorials/cga/interpolation.ipynb
  74. +1 −3 docs/tutorials/cga/visualization-tools.ipynb
  75. +51 −21 docs/tutorials/euler-angles.ipynb
  76. +21 −42 docs/tutorials/g2-quick-start.ipynb
  77. +15 −17 docs/tutorials/g3-algebra-of-space.ipynb
  78. +1 −1 docs/tutorials/linear-transformations.ipynb
  79. +1 −1 docs/tutorials/space-time-algebra.ipynb
  80. +2 −3 setup.cfg
  81. +2 −3 setup.py
  82. +0 −57 travis_install_conda.sh
177 changes: 177 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
name: Python package

on:
push:
branches: [ master ]
tags: [ 'v*' ] # run when pushing v1.2.3-style tags
pull_request:
branches: [ master ]
release:
types: [ created ]

jobs:
lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.11]
name: "lint | Python ${{ matrix.python-version }}"
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
pip install .
- name: Setup flake8 annotations
uses: rbialon/flake8-annotations@v1
- name: Run flake8
run: |
flake8 clifford --show-source --statistics
test:
defaults:
run:
# conda needs this to activate environments properly
shell: bash -l {0}
needs: lint
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
# fastest jobs first
- python-version: 3.11
name: without JIT
disable_jit: 1
- python-version: 3.11
name: doctests
mode: doctests
# really slow job next, so it runs in parallel with the others
- python-version: 3.11
name: slow tests
mode: very_slow
- python-version: 3.8
name: default
- python-version: 3.11
name: default
- python-version: 3.12
name: default
#- python-version: 3.11
# name: conda
# conda: true
- python-version: 3.11
name: benchmarks
mode: bench

name: "build | ${{ matrix.name }} | Python ${{matrix.python-version}}"
steps:
- uses: actions/checkout@v4

# python / pip
- name: Set up Python ${{ matrix.python-version }}
if: "!matrix.conda"
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
if: "!matrix.conda"
run: |
python -m pip install --upgrade pip;
pip install . --prefer-binary;
# test dependencies
pip install --upgrade pytest pytest-cov pytest-benchmark IPython
# conda
- name: Set up Python ${{ matrix.python-version }} (conda)
if: matrix.conda
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
- name: Install dependencies (conda)
if: matrix.conda
run: |
echo $CONDA/bin >> $GITHUB_PATH;
conda install \
"numpy>=1.17.0" \
scipy \
pip \
IPython \
h5py;
conda install -c conda-forge sparse;
conda install -c numba "numba>=0.45.1";
# make sure in conda we do not overwrite dependencies with pip
python setup.py develop --no-deps;
# test dependencies
python -m pip install --upgrade pytest pytest-cov pytest-benchmark;
- name: Test with pytest
env:
MODE: ${{ matrix.mode }}
NUMBA_DISABLE_JIT: ${{ matrix.disable_jit }}
run: |
PYTEST_ARGS=();
if [[ "${MODE}" == "bench" ]]; then
PYTEST_ARGS+=(--benchmark-only);
else
PYTEST_ARGS+=(--benchmark-skip);
fi;
if [[ "${MODE}" == "very_slow" ]]; then
PYTEST_ARGS+=(-m "veryslow");
else
PYTEST_ARGS+=(-m "not veryslow");
fi;
if [[ "${MODE}" == "doctests" ]]; then
PYTEST_ARGS+=(--doctest-modules --ignore clifford/test);
fi;
# `python -m` ensures we dispatch to conda if appropriate
python -m pytest \
--pyargs clifford \
"${PYTEST_ARGS[@]}" \
--color=yes \
-o junit_family=legacy \
--junitxml=junit/test-results.xml \
--durations=25 \
--cov=clifford \
--cov-branch;
# This only publishes result for the last run right now
# - name: Publish Test Report
# uses: mikepenz/action-junit-report@v2
# if: ${{ always() }}
# with:
# report_paths: 'junit/test-results.xml'
- uses: codecov/codecov-action@v5

deploy:
needs: test
runs-on: ubuntu-latest
# Specifying a GitHub environment is optional, but strongly encouraged
environment: pypi
permissions:
# IMPORTANT: this permission is mandatory for Trusted Publishing
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: "Install"
run: |
python -m pip install --upgrade pip;
python -m pip install build
python -m build --sdist --wheel --outdir dist/
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist
- name: Publish to PyPI (tags only)
if: startsWith(github.ref, 'refs/tags/v')
uses: pypa/gh-action-pypi-publish@release/v1
19 changes: 19 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Prevent git from showing duplicate names with commands like "git shortlog"
# See the manpage of git-shortlog for details.
# The syntax is:
# Name that should be used <email that should be used> Bad name <bad email>
#
# You can skip Bad name if it is the same as the one that should be used, and is unique.
#
# This file is up-to-date if the command git log --format="%aN <%aE>" | sort -u
# gives no duplicates.

Hugo Hadfield <hadfield.hugo@gmail.com> hugo hadfield <hadfield.hugo@gmail.com>
Hugo Hadfield <hadfield.hugo@gmail.com> hugohadfield <hadfield.hugo@gmail.com>
Hugo Hadfield <hadfield.hugo@gmail.com> Hugo <hadfield.hugo@gmail.com>

Alex Arsenovic <alexanderarsenovic@gmail.com> alex arsenovic <alexanderarsenovic@gmail.com>
Alex Arsenovic <alexanderarsenovic@gmail.com> alex arsenovic <arsenovic@virginia.edu>
Alex Arsenovic <alexanderarsenovic@gmail.com> arsenovic <alexanderarsenovic@gmail.com>

Robert Kern <robert.kern@gmail.com> root <root@Sacrilege.local>
7 changes: 6 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -5,6 +5,12 @@
# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.9"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py
@@ -15,7 +21,6 @@ formats: all

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.8
install:
- method: pip
path: .
143 changes: 0 additions & 143 deletions .travis.yml

This file was deleted.

10 changes: 5 additions & 5 deletions .zenodo.json
Original file line number Diff line number Diff line change
@@ -3,11 +3,6 @@
"id": "BSD-3-Clause"
},
"creators": [
{
"affiliation": "810 Labs",
"name": "Alex Arsenovic",
"orcid": "0000-0002-8599-5873"
},
{
"affiliation": "University of Cambridge",
"name": "Hugo Hadfield",
@@ -18,6 +13,11 @@
"name": "Eric Wieser",
"orcid": "0000-0003-0412-4978"
},
{
"affiliation": "810 Labs",
"name": "Alex Arsenovic",
"orcid": "0000-0002-8599-5873"
},
{
"affiliation": "Enthought, Inc.",
"name": "Robert Kern"
Loading