Wrenfold

Latest version: v0.2.2

Safety actively analyzes 696655 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 2

0.0.5

wrenfold can now be installed via:
bash
pip install wrenfold


There are no code changes from `v0.0.4` - the version number had to be incremented for PyPi.

0.0.4

This release primarily fixes bugs and improves documentation. The most significant bug was an issue where non-optional output arguments were not assigned correctly in generated Rust code (fixed by PR 228).

๐Ÿš€ Features

- build-wheels creates archive of all wheels
- PR: 217
- Add rust example to custom types docs, show how to customize constructor
- PR: 227
- Add an improved quick start guide
- PR: 231
- Add rosenbrock function to the examples
- PR: 233

๐Ÿ› Fixes

- Fix CI runner build parallelism specification
- PR: 223
- Fixes for gcc-14 compilation issues
- PR: 222
- Fix assignment to non-optional custom type output arguments in rust
- PR: 228
- Disable broken full-piv LU code path
- PR: 236
- Fix integer overflow in bspline example
- PR: 237

0.0.3

๐Ÿš€ Features

- Add inverse left Jacobian of SO(3) to geometry module
- PR: 195
- Simplify runtime library to two headers (merge span_eigen.h into span.h)
- PR: 196
- Unify the `subs` function interface (eliminate `subs_variables`)
- PR: 199
- Add parameter to `CppCodeGenerator.apply_preamble` to specify imports
- PR: 202
- Substitute visitor uses caching
- PR: 203
- Add `unique_symbols` method to the python wrapper
- PR: 204
- Add a diff test that checks rust_generation_test output code is up to date
- PR: 205
- Do not insert superfluous intermediate variables (more compact output)
- PR: 206
- Remove unused traits from the rust traits crate
- PR: 208
- Improve documentation
- PR: 215

๐Ÿ› Fixes

- Fix bug preventing nesting of vectors/matrices in custom types
- PR: 194
- Fix bug in to_rotation_vector, add more test coverage
- PR: 201

0.0.2

The second release of wrenfold focuses on improving the generated code, namely by reducing operation counts (sometimes meaningfully). This version will find additional opportunities to reduce operations by factorizing repeated sum-of-product expressions.

New features:
- Added a faster version of `Quaternion.to_rotation_vector` that can be used by passing `use_atan2=False`.
- Added `sym.unevaluated(...)` expression, which allows the user to prevent certain automatic simplifications. `sympy.UnevaluatedExpr` will now correctly convert to this when calling `from_sympy`.
- Added `code_generation.cse_function_description` function. This method allows the user to run their symbolic function through the CSE/simplifications steps, but then convert the result back to a series of symbolic expressions for easier inspection and debugging.
- Sympy operations `Min`, `Max` and `Heaviside` can now be converted to and from wrenfold.

Breaking changes:
- The type `RealScalar` from `type_annotations` is renamed to `FloatScalar`.

๐Ÿš€ Features

- Operation counts report maximum over all branches
- PR: 176
- Add missing SymPy conversions for `Min`, `Max`, and `Heaviside`
- PR: 177
- Add alternate `to_rotation_vector` implementation that uses acos
- PR: 179
- Add `eliminate_subexpressions` method for breaking down complex expressions
- PR: 180
- Add method for factorizing sums of products
- PR: 181
- Add ability to convert CSE outputs back to symbolic tree (from python)
- PR: 182
- Add `Unevaluated` expression type to avoid automatic simplifications
- PR: 183
- Speed up sum-of-product factorizer
- PR: 184
- Improve subexpression elimination (remove more operations)
- PR: 187
- Add missing annotations to `type_annotations.py` for Matrix2, Matrix3, etc
- PR: 191

๐Ÿ“ฆ Uncategorized

- Add logo to docs directory, add it to the readme and the sphinx output
- PR: 175
- Pin rust toolchain version to 1.77
- PR: 178
- Set rust version to 1.77 in `ci.yml`
- PR: 185
- Value does not use hash-set to store consumers
- PR: 186
- Remove non-deterministic hash from `custom_type`
- PR: 189
- Add missing `__hash__` and `__eq__` implementation to Quaternion type
- PR: 188
- Speed up ordering operator for scalar expressions
- PR: 190
- Rename RealScalar to FloatScalar to clarify type
- PR: 192

0.0.1

This is the very first set of wrenfold wheels! ๐ŸŽ‰

Documentation is live at [wrenfold.org](https://wrenfold.org). The username and password is in `README.md`.

Select the wheel file appropriate for your OS and python version. For example:
- Windows w/ Python 3.11 on AMD64: `wrenfold-0.0.1-cp311-cp311-win_amd64.whl`
- OSX w/ Python 3.9 on ARM64: `wrenfold-0.0.1-cp39-cp39-macosx_11_0_arm64.whl`

0.0

Derivatives with respect to derivatives of symbolic functions

Derivatives can now be taken with respect to the _derivative expression_ of a symbolic function invocation. For instance, this can be used when computing the Euler-Lagrange equations of a system:

python
from wrenfold import sym
t = sym.symbols('t')
x = sym.Function("x")(t) x is the generalized coordinate of our system
x_dot = x.diff(t)
print(x_dot) prints: Derivative(x(t), t)

L = ... omitted, we compute the Lagrangian `L` wrt `x` and `x_dot`
Then compute the canonical momenta by taking the derivative wrt `x_dot`.
q_x = L.diff(x_dot)


The `stop_derivative` expression type

The [new `sym.stop_derivative`](https://github.com/wrenfold/wrenfold/pull/290) expression is conceptually similar to [`tf.stop_gradient`](https://www.tensorflow.org/api_docs/python/tf/stop_gradient) and can be used to truncate derivatives:

python
from wrenfold import sym
x, y = sym.symbols('x, y')
f = sym.stop_derivative(x * y) * sym.sin(x)
f.diff(x) prints: cos(x)*StopDerivative(x*y), x*y does not influence the gradient
f.diff(y) prints: 0


This is useful if you want to evaluate a residual function without incorporating additional terms in the derivative - for example to evaluate the weighting function of a robust norm.

New Examples

Three new examples have been added:
- An example implementation of the [Kannala-Brandt](https://oulu3dvision.github.io/calibgeneric/Kannala_Brandt_calibration.pdf) camera model that [compiles via `jax.jit`](https://github.com/wrenfold/wrenfold/blob/main/examples/jax_camera_model/jax_camera_model.py).
- Generating C99 by [implementing a custom code generator](https://github.com/wrenfold/wrenfold/blob/main/examples/c_generation/c_code_generator.py).
- Deriving and generating the dynamics of a [cart-pole system with a double pendulum](https://github.com/wrenfold/wrenfold/blob/main/examples/cart_pole/cart_pole_dynamics.py).

Performance improvements

Changes 279 and 284 improved the performance of symbolic expression manipulations.

Code coverage ๐Ÿ”

As of 296, the project is now using `gcov` and `lcov` to generate weekly coverage reports. These will be used to ameliorate places with insufficient coverage.

๐Ÿš€ Features

- Add stack allocator implementation for use with addition/multiplication
- PR: 279
- Support taking derivative wrt the derivative of a symbolic function
- PR: 283
- Add `convert_ternaries` option to allow conditionals to remain in ternary form
- PR: 285
- Add `stop_derivative` expression type
- PR: 290
- Add C99 generation example + an example of Kannala-Brandt camera model
- PR: 291
- Add Python code generation for PyTorch, JAX, and NumPy
- PR: 288
- Add example of generating KB camera model and invoking it w/ JAX
- PR: 294
- Add code coverage github action
- PR: 296
- Add cart-pole/double-pendulum to the examples
- PR: 300

๐Ÿ› Fixes

- Remove unnecessary parentheses around numeric negative literals in code generation
- PR: 287
- Fix bug where nested matrix in custom type resulted in segfault
- PR: 292

๐Ÿ“š Documentation

- Add basic contributing.md
- PR: 295

๐Ÿงน Cleanup

- Update scikit-build-core version
- PR: 280
- Update pre-commit and clang-format versions
- PR: 281

Note: Due to a silly mistake this version incremented the minor digit but did not reset the patch digit, hence there is no `v0.2.0`. Rather than edit the git history in a confusing way I have opted to skip that version. In future I will add some tooling to avoid this sort of gaffe.

Page 2 of 2

ยฉ 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.