semvec/pypi-packages huggingface dataset:
agjax 0.3.7
A jax wrapper for autograd-differentiable functions.
Requires Python: >=3.7
Keywords: autograd, jax, python, wrapper, gradient

# Agjax - jax wrapper for autograd-differentiable functions.
[![Docs](https://img.shields.io/badge/Docs-blue.svg)](https://invrs-io.github.io/agjax/)
[![Continuous integration](https://github.com/invrs-io/agjax/actions/workflows/build-ci.yml/badge.svg)](https://github.com/invrs-io/agjax/actions)
[![PyPI version](https://img.shields.io/pypi/v/agjax)](https://pypi.org/project/agjax/)

Agjax allows existing code built with autograd to be used with the jax framework.

In particular, `agjax.wrap_for_jax` allows arbitrary autograd functions ot be differentiated using `jax.grad`. Several other function transformations (e.g. compilation via `jax.jit`) are not supported.

Meanwhile, `agjax.experimental.wrap_for_jax` supports `grad`, `jit`, `vmap`, and `jacrev`. However, it depends on certain under-the-hood behavior by jax, which is not guaranteed to remain unchanged. It also is more restrictive in terms of the valid function signatures of functions to be wrapped: all arguments and outputs must be convertible to valid jax types. (`agjax.wrap_for_jax` also supports non-jax inputs and outputs, e.g. strings.)

## Installation
```
pip install agjax
```

## Usage
Basic usage is as follows:
```python
@agjax.wrap_for_jax
def fn(x, y):
  return x * npa.cos(y)

jax.grad(fn, argnums=(0,  1))(1.0, 0.0)

# (Array(1., dtype=float32), Array(0., dtype=float32))
```

The experimental wrapper is similar, but requires that the function outputs and datatypes be specified, simiilar to `jax.pure_callback`.
```python
wrapped_fn = agjax.experimental.wrap_for_jax(
  lambda x, y: x * npa.cos(y),
  result_shape_dtypes=jnp.ones((5,)),
)

jax.jacrev(wrapped_fn, argnums=0)(jnp.arange(5, dtype=float), jnp.arange(5, 10, dtype=float))

# [[ 0.28366217  0.          0.          0.          0.        ]
#  [ 0.          0.96017027  0.          0.          0.        ]
#  [ 0.          0.          0.75390226  0.          0.        ]
#  [ 0.          0.          0.         -0.14550003  0.        ]
#  [ 0.          0.          0.          0.         -0.91113025]]
```

Agjax wrappers are intended to be quite general, and can support functions with multiple inputs and outputs as well as functions that have nondifferentiable outputs or arguments that cannot be differentiated with respect to. These should be specified using `nondiff_argnums` and `nondiff_outputnums` arguments. In the experimental wrapper, these must still be jax-convertible types, while in the standard wrapper they may have arbitrary types.

```python
@functools.partial(
  agjax.wrap_for_jax, nondiff_argnums=(2,), nondiff_outputnums=(1,)
)
def fn(x, y, string_arg):
  return x * npa.cos(y), string_arg * 2

(value, aux), grad = jax.value_and_grad(
  fn, argnums=(0, 1), has_aux=True
)(1.0, 0.0, "test")

print(f"value = {value}")
print(f"  aux = {aux}")
print(f" grad = {grad}")
```
```
value = 1.0
  aux = testtest
 grad = (Array(1., dtype=float32), Array(0., dtype=float32))
```
pwconn 0.6.0
Manage Pipewire connections via a TUI
Requires Python: >=3.11

# pwconn -- manage Pipewire connections via TUI

`pwconn` serves the same basic function as `qpwgraph`: it allows
you to view, create, and remove connections between Pipewire
apps. It is a UI wrapper on the command-line utils `pw-cli`,
`pw-link`, and `aconnect`.

It is under development and not that pretty yet, but if you want
to play around with it most of the functionality is there.

<img width="1227" height="757" alt="pwconn-screenshot" src="https://github.com/user-attachments/assets/9b51e74b-c285-4504-a1fb-c2ef20df0310" />

Requirements:
* ['uv'](https://github.com/astral-sh/uv) for build/install (I
  wanted to give it a try, seems ok but jury is still out)
* `alsa-tools` from your Linux distribution, for the
  `aconnect` tool
* `pw-utils` from your Linux distribution, for the `pw-cli` and
  `pw-link` tools.


#### Build/install

The options are:

* Install latest release from PyPI: `pip install pwconn`
* Launch the project from the source tree with `uv run pwconn`
* Install from source locally
    * Build wheel with `uv build`
    * Optional: create and activate a virtualenv for the install
        * `python3 -m venv <destination>`
        * `. <destination>/bin/activate`
    * Install the wheel with `pip install dist/pwconn-0.1.0-py3-none-any.whl`
    * Launch as `pwconn`


#### Usage

* The main UI is a list of Pipewire devices of a single kind
(audio, JACK MIDI, ALSA MIDI, or video).

* Select a line in the list by up and down arrow keys or mouse click

* Keyboard commands are listed at the bottom of the screen

* The keys `[`, `]`, `{`, and `}` expand and collapse. Devices
expand to show ports, and ports expand to show connections

* The keys "a", "j", "m", and "v" switch which kind of device is
displayed

* When a port is selected, the space key will "mark" it.

* To make one or more connections, mark all of the connection
  endpoints and press "c". If there are multiple ins and outs
  selected it will make a reasonable choice of connections which
  is generally OK. If not, make the connections one at a time.

* To disconnect, select a link (from either "end") and type "d"

* If a "connect" or "disconnect" action does not appear to do anything,
  this is probably an error in the underlying operation that isn't reflected
  in the UI. In particular, ALSA MIDI connections may not be deleteable by
  a process that did not create them.