TL;DR
| Operation (Relative) | Class() |
obj.x |
obj.x = 42 |
obj.method |
|---|---|---|---|---|
attrs |
1.00x | 1.00x | 1.00x | 1.00x |
dataclass |
1.25x | 1.73x | 2.08x | 1.07x |
eqx.Module |
132.90x | 25.06x | - | 1121.94x |
| Operation (Relative) | Class() |
obj.x |
obj.x = 42 |
obj.method |
|---|---|---|---|---|
attrs |
1.00x | 1.00x | 1.00x | 1.00x |
dataclass |
1.25x | 1.73x | 2.08x | 1.07x |
eqx.Module |
132.90x | 25.06x | - | 1121.94x |
When working with JAX, especially when using jax.jit for performance, you might encounter some surprising behaviors if you’re not careful about how JAX “sees” and handles your objects. One such area is the interaction between jax.jit and Python’s @functools.cached_property. You might find that your property isn’t as “cached” as you expect within JIT-compiled functions.
#:schema https://json.schemastore.org/pyproject.json
# https://packaging.python.org/en/latest/specifications/pyproject-toml/
[build-system]
build-backend = "hatchling.build"
requires = ["hatch-vcs", "hatchling"]
[dependency-groups]
build = ["check-wheel-contents", "hatch", "twine"]
dev = []
docs = []
test = []
[project]
authors = [
{ email = "30631553+liblaf@users.noreply.github.com", name = "liblaf" },
]
classifiers = [
"Development Status :: 4 - Beta",
"License :: OSI Approved :: MIT License",
]
description = "Add your description here"
dynamic = ["version"]
keywords = []
license = "MIT"
name = "liblaf-grapes"
readme = "docs/README.md"
requires-python = ">=3.12"
dependencies = []
[project.urls]
"Changelog" = "https://github.com/liblaf/grapes/blob/main/CHANGELOG.md"
"Documentation" = "https://liblaf.github.io/grapes/"
"Homepage" = "https://github.com/liblaf/grapes"
"Issue Tracker" = "https://github.com/liblaf/grapes/issues"
"Release Notes" = "https://github.com/liblaf/grapes/releases"
"Source Code" = "https://github.com/liblaf/grapes"
[tool.check-wheel-contents]
ignore = ["W002"]
[tool.hatch.build.hooks.vcs]
version-file = "src/liblaf/grapes/_version.py"
[tool.hatch.build.targets.sdist]
only-include = ["src/"]
[tool.hatch.build.targets.wheel]
packages = ["src/liblaf"]
[tool.hatch.version]
source = "vcs"
| SubCommends | Fish Shell Completion | Colorful Help | Markdown Help | Options Reuse | |||||
|---|---|---|---|---|---|---|---|---|---|
| Typer | ✅ | dynamic | ✅ | ✅ | cumbersome | ||||
| cleo | |||||||||
| cyclopts | ✅ | ||||||||
| tyro | ✅ | ||||||||
| feud | ✅ |
In the world of Python development, optimizing import times and managing large codebases can be challenging. Two popular tools that aim to address these challenges are lazy-loader and etils.epy. This blog post will compare these two libraries, focusing on their capabilities for lazy loading and lazy API exports. We’ll explore their features, use cases, and how they can be integrated into your projects.