semvec/pypi-packages huggingface dataset:
flax_orbax 0.1.4
A package for saving JAX-compatible dataclasses with Orbax
Requires Python: >=3.10

## Orbax 🤝 Dataclasses

A convenient way to serialize dataclasses (and for orbax) in an easier to read way (avoid Pickle!)

Usage:

It's pretty common to store parameters and model information in the same object in Jax scripts, e.g.

```python
@jax.tree_util.register_dataclass
@dataclasses.dataclass
class Model:
    module: nn.Module = dataclasses.field(metadata=dict(static=True))
    params: dict

# or e.g. a flax.training.train_state.TrainState
```

If we try saving it using standard Orbax:
```python
ckptr = ocp.StandardCheckpointer()
ckptr.save('/tmp/checkpoint', model)
ckptr.restore('/tmp/checkpoint') # -> we'll get a dict: {'params': ...} back, the object is lost
```

The idea of this library is to be able to seamlessly store the full object
```python
ckptr = flax_orbax.Checkpointer()
ckptr.save('/tmp/checkpoint', model)
ckptr.restore('/tmp/checkpoint') # -> we will get a Model() back
```

## A few sharp edges

Some things in a typical JAX workflow are not serializable -- e.g. the optax transformation. `flax_orbax.wrap` handles this:

```python
# instead of optax.adam(1e-3), do:
tx = flax_orbax.wrap(optax.adam)(1e-3)
```

If you want to restore on a different device (with a different sharding):

```python
ckptr = flax_orbax.Checkpointer()
ckptr.restore(args=flax_orbax.RestoreArgs(sharding=sharding))
```
emanate 8.0.4
Symlink files from one directory to another, similary to Effuse and Stow.
Requires Python: >=3.9

# emanate [![Build Status][build-status-link]][build-status-img] ![PyPI](https://img.shields.io/pypi/v/emanate) [![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/2916/badge)](https://bestpractices.coreinfrastructure.org/projects/2916)

Symlink files from one directory into another directory.

Inspired by [effuse](https://github.com/programble/effuse) and
[stow](https://www.gnu.org/software/stow/manual/stow.html).

[build-status-link]: https://api.cirrus-ci.com/github/duckinator/emanate.svg
[build-status-img]: https://cirrus-ci.com/github/duckinator/emanate

## Installation

```
$ pip3 install emanate
```

Or find the [latest release](https://github.com/duckinator/emanate/releases)
and grab the `emanate-<version>.pyz` file. This should work as a
standalone executable. If it doesn't, try `python3 emanate-<version>.pyz`.

Emanate version numbers follow the [semantic versioning] convention.
A [PEP 440] version specification for [compatible releases], like `~= 7.0`,
is the recommended way to select appropriate versions.

[semantic versioning]: https://semver.org/
[PEP 440]: https://www.python.org/dev/peps/pep-0440/
[compatible releases]: https://www.python.org/dev/peps/pep-0440/#compatible-release


## Usage

```
~$ cat ~/.bashrc
cat: /home/pup/.bashrc: No such file or directory
~$ pip3 install emanate
~$ cd ~/dotfiles
~/dotfiles$ ls -al
drwxr-xr-x.  9 pup pup 4096 Jun  3 12:06 ./
drwx------. 74 pup pup 4096 Jun  3 12:06 ../
drwxr-xr-x.  2 pup pup 4096 Jun  3 11:59 bin/
drwxr-xr-x.  6 pup pup 4096 Jun  3 11:59 .config/
drwxr-xr-x.  8 pup pup 4096 Jun  3 12:10 .git/
-rw-r--r--.  1 pup pup  486 Jun  3 11:59 .bash_aliases
-rw-r--r--.  1 pup pup   78 Jun  3 11:59 .bash_env
-rw-r--r--.  1 pup pup 1987 Jun  3 11:59 .bashrc
-rw-r--r--.  1 pup pup  163 Jun  3 12:06 README.md
~/dotfiles$ cat .bashrc
# TODO: Write .bashrc.
~/dotfiles$ echo '{"ignore": ["README.md"]}' > emanate.json
~/dotfiles$ emanate
~/dotfiles$ cat ~/.bashrc
# TODO: Write .bashrc.
```

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/duckinator/emanate.
Please report security problems to the normal issue tracker.

When adding new functionality, please add tests. Mention @duckinator if you
need assistance with adding tests.

## License

The project is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).

## Code of Conduct

Everyone interacting in the emanate project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/duckinator/emanate/blob/main/CODE_OF_CONDUCT.md).