Changelog¶
Next release
[Feature] #436: The
Ga
constructor now allows algebras with only a single basis vector, via a trailing comma in the list of bases. This enables algebras like the complex (Ga('i,', g=[-1])
) and dual (Ga('delta,', g=[0])
) numbers to be used.[Feature] #450: ANSI printing can now be turned off with
Eprint(deriv=None, fct=None, base=None)
.[Feature] #454:
galgebra.lt.Lt
objects can now be used withGa
s that are not constructed with acoords
argument.[Bug] #448: Calling
galgebra.printer.Eprint()
no longer causes ansi escape codes to appear in the names of the coefficients ofga.mv('A', 'vector')
.[Support] #450: Many undocumented parts of
galgebra.printer.Eprint()
have been removed:The
debug
argument toEprint
, which just printed out the other arguments.The
on
argument toEprint
, which ifFalse
just made the call do nothing at all. Useif cond: Eprint(...)
instead ofEprint(..., on=cond)
.The overrideable default settings
Eprint.defaults
.The constant dictionaries
Eprint.ColorCode
andEprint.InvColorCode
.The class methods
Eprint.Base
,Eprint.Fct
,Eprint.Deriv
, andEprint.Strip
.The class attributes
Eprint.base
,Eprint.fct
,Eprint.deriv
, andEprint.normal
.
If you were relying on these details to implement your own ansi printing, it is recommended that you use a package like
colorama
instead.[Support] #454: The
l.coords
andl.X
attributes ofgalgebra.lt.Lt
objects are deprecated in favor of usingl.Ga.coords
andl.Ga.coord_vec
.
0.5.0 2020.06.05
[Feature] #326: The
galgebra.ga.Ga.make_grad()
function now accepts multivectors, not just vectors.[Feature] #243:
galgebra.mv.Mv.subs()
now accepts all the same arguments assympy.subs()
.[Feature] #252: (also #310) Many attributes of
Ga
instances are now _always_ present, rather than being conditionally present depending on the type of algebra. These include:Other properties that are still only meaningful for some algebras now exist but raise clearer error messages:
These lists are not exhaustive.
[Feature] #336: The scalar product \(a * b\) is now available via
galgebra.ga.Ga.scalar_product()
. Note that there is no operator overload on multivectors yet.[Feature] #364: The galgebra print customizations
Dmode
,Fmode
,fmt
, andMlt.lcnt
can now be set via:sympy.init_printing( omit_function_args=True, # Fmode omit_partial_derivative_fraction=True, # Dmode galgebra_mv_fmt=1, # fmt galgebra_mlt_lcnt=1, # lcnt )
These names are provisional, and may change in future.
[Feature] #364: The galgebra printer now respects the global
inv_trig_style
sympy print setting.[Feature]: Generally improved documentation, including:
The re-inclusion of missing code examples that were already referenced from the text (#293).
Faster and smaller pages with less MathJax loading time (#292, #296).
An adapted version of a notebook tutorial from Alan Bromborsky is now present in the docs, Introduction to using GAlgebra (#375).
Correction of curly quotes that led to invalid python syntax (#294).
[Feature] #212: Python 2.7 is no longer supported, allowing more features from Python 3.x to be used.
[Feature] #232: Python 3.8 is now supported and tested.
[Bug] #344:
galgebra.metric.collect()
no longer discards terms that were not requested.[Bug] #53: Calling
sympy.sympify()
(or any other sympy function) on aMv
instance no longer raisesRecursionError
, and instead raisesTypeError
with a helpful message.[Bug] #258: The result of simplifying sympy expressions is no longer dependent on whether
galgebra.printer.Format()
has been called.[Bug] #264:
Dop
no longer emits latex strings when printed in non-latex mode.[Bug] #319:
galgebra.ga.Ga.make_grad()
no longer crashes when called on an algebra with nocoords
.[Bug] #319:
galgebra.ga.Ga.make_grad()
no longer has a broken cache that ignorescmpflg
if both the left and right gradient operator are requested for the same vector[Bug] #319:
galgebra.mv.Mv.get_coefs()
now returns0
in the place of empty coefficients.[Bug] #320:
galgebra.lt.Mlt
no longer crashes at construction, arithmetic, or multiplication.[Bug] #323: (also #377, #340) Many non-
Mv
objects now render better in the default sympy printer. This bug manifested most often when usingMv.obj
, and would result in misrenderings like \(e^e_{xy}\) when \(e_x \wedge e_y\) was intended, or \(e_{x.y}\) when \(e_x \cdot e_y\) was intended.[Bug] #348:
galgebra.printer.Print_Function()
no longer emits code after the function body. Previously, examples had adef dummy(): pass
function to work around this.[Bug] #354:
galgebra.printer.oprint()
no longer strips the last)
fromsympy.Matrix
objects within lists.[Bug] #369: The
fmt
argument fo theFmt
method ofMv
,Dop
,Lt
,Mlt
no longer has side effects on subsequentprint
statements.[Bug] #369: (also #380) The
Fmt
method ofMv
,Dop
,Lt
,Mv
now works properly in both IPython (giving plaintext output) and Jupyter (giving LaTeX output).[Bug] #372: For scalar multivectors, the printed result is now mathematically equivalent in plaintext and latex mode.
[Bug] #378: (also #379) The post-processing performed by
galgebra.printer.tex()
is now better-behaved:It no longer translates
grad
into \(\nabla\) if it is part of a longer word likegradual
.It no longer mangles occurrences of
@@
.It no longer throws away
#
and%
symbols that appear in the middle of lines.It no longer injects stale information from previous lines into subsequent lines.
It now strips all leading and trailing whitespace before wrapping in
equation
oralign
.
[Bug] #382: The result of calling
galgebra.printer.latex()
on a multi-vector when the globalgalgebra_mv_fmt
setting is not 1 is now valid to use within math mode.[Bug] #387:
galgebra.printer.Print_Function()
no longer emits invalid LaTeX with an unwanted\\
[Bug] #391: Subtracting a scalar from a
Mv
instance no longer fails.[Bug] #431: Left and right contraction are no longer swapped on scalar
Expr
instances.[Support] #64: The following attributes have been deprecated in favor of using the new
flat
attribute:galgebra.ga.Ga.indexes_lst
→galgebra.ga.Ga.indexes
.flat
galgebra.ga.Ga.bases_lst
→galgebra.ga.Ga.bases
.flat
galgebra.ga.Ga.blades_lst
→galgebra.ga.Ga.blades
.flat
galgebra.ga.Ga.mv_blades_lst
→galgebra.ga.Ga.mv_blades
.flat
Since the replacement properties also include the scalar element,
ga.blades_lst
is equivalent toga.blades.flat[1:]
(and likewise for the other properties).[Support] #245: (also #248, #334) The following attributes have been deprecated to reduce the number of similar members in
Ga
.Unified into the
table_dict
attribute ofProductFunction
instances:galgebra.ga.Ga.wedge_table_dict
→wedge.table_dict
galgebra.ga.Ga.left_contract_table_dict
→left_contract.table_dict
galgebra.ga.Ga.right_contract_table_dict
→right_contract.table_dict
galgebra.ga.Ga.dot_table_dict
→hestenes_dot.table_dict
galgebra.ga.Ga.mul_table_dict
→mul.table_dict
galgebra.ga.Ga.basic_mul_table_dict
→basic_mul.table_dict
Unified into methods of
ProductFunction
instances:galgebra.ga.Ga.non_orthogonal_bases_products
→basic_mul.of_basis_bases
galgebra.ga.Ga.wedge_product_basis_blades
→wedge.of_basis_blades
galgebra.ga.Ga.geometric_product_basis_blades
→mul.of_basis_blades
galgebra.ga.Ga.dot_product_basis_blades
andgalgebra.ga.Ga.non_orthogonal_dot_product_basis_blades
→<some_dot_type>.of_basis_blades
. In future it will no longer be possible to call the non-ortho method for an orthogonal ga, or vice-versa.
Unified into
galgebra.ga.Ga.blade_expansion_dict
:galgebra.ga.Ga.blade_expansion
→blade_expansion_dict.items()
Unified into
galgebra.ga.Ga.base_expansion_dict
:galgebra.ga.Ga.base_expansion
→base_expansion_dict.items()
Unified into
galgebra.ga.Ga.basic_mul_table_dict
:galgebra.ga.Ga.basic_mul_table
→basic_mul_table_dict.items()
galgebra.ga.Ga.basic_mul_keys
→basic_mul_table_dict.keys()
galgebra.ga.Ga.basic_mul_values
→basic_mul_table_dict.values()
Unified into
galgebra.ga.Ga.indexes_to_bases_dict
:galgebra.ga.Ga.indexes_to_bases
→indexes_to_bases_dict.items()
galgebra.ga.Ga.bases_to_indexes
→indexes_to_bases_dict.inverse.items()
galgebra.ga.Ga.bases_to_indexes_dict
→indexes_to_bases_dict.inverse
Unified into
galgebra.ga.Ga.indexes_to_bases_dict
:galgebra.ga.Ga.indexes_to_blades
→indexes_to_blades_dict.items()
galgebra.ga.Ga.blades_to_indexes
→indexes_to_blades_dict.inverse.items()
galgebra.ga.Ga.blades_to_indexes_dict
→indexes_to_blades_dict.inverse
[Support] #280: The
galgebra.utils
module, which provided Python 2 compatibility helpers, has been deprecated.[Support] #335: The undocumented method
galgebra.ga.Ga.X()
(the same ascoords_vec
) has been deprecated.[Support] #338: The undocumented and mispelt static method
galgebra.lt.Mlt.extact_basis_indexes()
(which just computed a value equivalent togalgebra.ga.Ga.basis_super_scripts
) has been deprecated.[Support] #202:
Pdop
andSdop
instance are no longer associated with a Ga. As a result, their.Ga
attribute no longer exists, and thepdop()
andsdop()
methods ofGa
are deprecated in favor of calling the constructors directly. For Ga-aware operators, continue to useDop
.[Support] #216:
galgebra.metric.test_init_slots
has been removed. The functionality this provided is superseded by the language feature of keyword-only arguments.[Support] #252: (also #310) The
inverse_metric()
andderivatives_of_g()
methods ofMetric
are deprecated, as the properties they computed (g_inv
anddg
) are now computed automatically.[Support] #259:
galgebra.printer.oprint
now aligns results in columns[Support] #284: (also #317)
galgebra.lt.Lt.setup()
has been deprecated, along with the attributes it populatedgalgebra.ga.Ga.lt_x
(the same ascoords_vec
) andgalgebra.ga.Ga.lt_coords
(the same ascoords
).[Support] #286: The
galgebra.deprecated
module, which provides old-style APIs, now emitsDeprecationWarning
s.[Support] #320: The following attributes of
galgebra.ga.Ga
have been removed:a
[Support] #349:
galgebra.printer.Get_Program()
is deprecated. This function used to have to be called beforegalgebra.printer.Print_Function()
, but now all it does is act as an enable/disable flag for the latter, such thatGet_Program(True); Print_Function()
was a no-op.[Support] #358:
galgebra.printer.find_executable
has been removed, as the functionality is provided byshutil.which()
.[Support] #367: (also #364, #369) The following properties of
GaLatexPrinter
andGaPrinter
have been removed:fmt
prev_fmt
dop_fmt
prev_dop_fmt
lt_fmt
prev_lt_fmt
Dmode
Fmode
inv_trig_style
dop
[Support] #367: The
fmt_dop
argument to anddop_fmt
attribute ofgalgebra.mv.Dop
have been removed, as they had no effect.[Support] #376: (also #258, #371) The
repr()
andstr()
of bothgalgebra
andsympy
objects will no longer ever return latex strings, instead always returning plaintext strings. If you want latex strings, usegalgebra.printer.latex()
. Note that this does not affect support forprint(sympy_object)
, which continues to print latex representations providedgalgebra.printer.Format()
has been called.[Support] #384: The
dop
argument toFormat()
, along with the corresponding static member ofLatexPrinter
, has been removed, as had no effect.[Support] #385:
galgebra.printer.print_replace
has been removed.[Support] #386: The
title
attribute ofDop
has been removed. as it was alwaysNone
.[Support] #393:
galgebra.dop.Sdop.str_mode
has been removed, as it was alwaysFalse
.
0.4.5 2019.12.31
[Feature] #50: (also #51, #56) Improve documentation formatting:
LaTeX and code samples are now appropriately formatted
Attributes of classes now have permalinks
[Feature] #66: The
mul_table_dict
table, and the equivalent tables for the other products, are now computed lazily when indexed. These are now all documented too.[Feature] #66: Remove unused or unusable code in the public API:
Ga.mul_table
,Ga.wedge_table
,Ga.dot_table
,Ga.left_contract_table
, andGa.right_contract_table
, all of which were the empty list,[]
.galgebra.mv.modules
, a string which served no purpose (#71).__add_ab__
,__sub_ab__
,__mul_ab__
, and__div_ab__
, none of are real magic method names (#67). No code should be calling these directly anyway.Dop.flatten_one_level
which is better speltitertools.chain.from_iterable
(#175).Dop.basic
, which was a non-working version ofgrads()
(#185).Pdop.setGa
,Sdop.setGa
,Dop.setGa
, all of which rely on dangerous global state - use thega
keyword argument of the constructors of these types instead (#163).
[Feature] #78:
grads()
now raises a better error when it fails, and is faster.[Feature] #164: (and #169, #170) Sympy 1.5 is officially supported and tested.
[Feature] #172:
galgebra.__version__
has been added, which contains the version string.[Feature] #195: Deprecate confusing parts of the public API:
galgebra.ga.Ga.mv_I()
, which was a bad way to spellgalgebra.ga.Ga.E()
.galgebra.ga.Ga.mv_x()
, which was a bad way to create a vector with a weird name.Pdop(None)
, which is better speltPdop({})
, the latter of which has always worked (#187).galgebra.ga.Ga.Pdop_identity()
, which is better speltga.pdop({})
(#194).galgebra.ga.Ga.Pdiffs()
, which is better speltga.pdop(x)
(#194).galgebra.ga.Ga.sPds()
, which is better speltga.sdop(x)
(#194).
[Bug] #60: (also #141) Make the following operations on
galgebra.mv.Mv
non-mutating:diff()
expand()
print(mv)
Any code relying on this behavior will need to change from
x.method()
tox = x.method()
. Note that the latter syntax was always supported even before this change.[Bug] #61: Make contraction and Hestenes dot products thread-safe. Previously these relied on the
dot_mode
setting not being changed mid-operation. Thedot()
method still respects this setting, but is no longer used internally.[Bug] #80: (also #57, #58, #97) The
galgebra.mv.Mv
constructor no longer silently accepts illegal arguments, and produces better error messages.[Bug] #81: (also #180) Passing coefficients as
Mv(coefs, 'odd', ga=ga)
is forbidden.[Bug] #90:
galgebra.ga.Ga.blades
,galgebra.ga.Ga.bases
, andgalgebra.ga.Ga.indices
now reference the scalarS(0)
as the single grade-0 object. Previously they listed no grade 0 objects.[Bug] #134:
dot_table_dict
now contains correct values (zero) for scalar keys[Bug] #151: (also #150)
Dop
,Sdop
, andPdop
no longer have mutating methods. This fixed issues where not only would the laplacian be sometimes calculated incorrectly, but its correctness would vary depending on whether it had been printed![Bug] #165:
galgebra.metric.linear_expand()
no longer accepts a mode argument, as this did not work properly. For the old behavior oflinear_expand(x, mode=True)
, uselinear_expand_terms(x)
instead.[Bug] #177:
Dop
objects that evaluate to0
no longer raise crypticValueError
s when operated on.[Bug] #151:
Dop([], ga=ga)
andSdop([], ga=ga)
now evaluate to multiplication by zero, not by one. Multiplication by one can as always be speltDop([(S(1), Pdop({}, ga=ga}))], ga=ga)
.[Bug] #157: Adding an
Sdop
instance to a scalar now works as intended, rather than crashing.[Bug] #183:
op1 == op2
now works correctly forSdop
andDop
instances.[Bug] #187:
Pdop
no longer silently accepts extra arguments.[Bug] #187:
Sdop(x)
now functions as intended as an alias ofSdop([(S(1), Pdop({x: 1}))])
, which previously crashed.[Bug] #188: Passing a
ga
keyword-argument tosm()
,mv()
, andlt()
is now an error, previously it was silently ignored.[Bug] #188:
pdop()
andsdop()
are now transparent aliases toPdop
andSdop
, respectively. Previously, they would crash.[Support] #46: (also #69) Remove unnecessary executable bit from importable python files, and the corresponding no-op code that would be run.
[Support] #55: Rename
*kargs
to*args
internally, to match convention. This has no effect on callers, but makes the docs and source easier to read.[Support] #59: (also #65) Make internal attributes and helper functions private. All of the following have been made private by being renamed:
Mv.make_grad
(#59).Mv.make_scalar
(#59).Mv.make_vector
(#59).Mv.make_bivector
(#59).Mv.make_pseudo_scalar
(#59).Mv.make_multivector
(#59).Mv.make_spinor
(#59).Mv.make_odd
(#59).Ga.build_bases()
(#65).Ga.basis_product_tables()
(#65).Ga.build_reciprocal_basis()
(#65).Ga.build_connection()
(#65).Ga.non_orthogonal_mul_table()
(#65).Ga.base_blade_conversions()
(#65).Ga.init_connect_flg()
(#65).Ga.derivatives_of_basis()
(#65).Ga.lt_flg
(#65).Ga.agrads
(#65).Ga.dbases
(#65).Ga.XOX
(#195).
[Support] #72: Other internal cleanup.
[Support] #167: Python 3.4 is no longer supported.
[Support] #83: This is the last release to support Python 2.7.
0.4.4 2019.09.30
[Feature] #9: Documentation now available at https://galgebra.readthedocs.io/
[Feature] #17: Fix examples under both Python 2 & 3
Fix examples/* and verify them in CI using nbval
Test coverage increased from 48.89% to 66.52%
Add README for test and examples
[Bug] #31: Freeze the depended version of SymPy to 1.3
[Bug] #32: Fix calculation of reciprocal basis for non-orthogonal basis
[Bug] #30: Fix bugs of using LaTeX as symbol name
[Bug] #29: Fix that sometimes plain text is printed with or instead of LaTeX in Jupyter Notebooks
[Bug] #27: Fix broken class MV
[Bug] #26: Fix calculation of the Christoffel symbols
[Bug] #18: Fix TypeError of unicode string, use BytesIO instead of StringIO
[Bug] #15: Fix printing of some products and inverses of multivectors
[Support] #17: Setup Circle CI to build more Python versions faster
TravisCI build for PRs is now removed
0.4.3 2018.02.18
[Feature] #2: Support Python 3
Convert code to be Python 3 compatible
Pass tests under both Python 2 & 3
Support installing from PyPI instead of setting pth
Support importing with from galgebra.<package name> import *
[Bug] #2: Fixes brombo/galgebra#20: Incorrect LaTeX output in test_derivatives_in_spherical_coordinates
[Bug] #2: Fixes brombo/galgebra#19: Failures in test_noneuclidian_distance_calculation
[Support] #2: Clean up obsolete code in setup.py and make it simple
[Support] #2: Remove .pyc files and add standard .gitignore for python
[Support] #8: Remove NumPy dependency
[Support] #8: Validate existing Jupyter notebooks using nbval
[Support] #8: Add test coverage in CI using using pytest and CodeCov
[Support] #2: Setup Travis CI