Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/rtd_environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ dependencies:
- jupyterlab

# gettsim dependencies
- astor
- dags>=0.3.0
- ipywidgets
- networkx
Expand Down
32 changes: 2 additions & 30 deletions pixi.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ classifiers = [
# Dependencies and requirements
requires-python = ">=3.11"
dependencies = [
"astor",
"dags>=0.3.0",
"ipywidgets",
"networkx",
Expand Down Expand Up @@ -110,7 +109,6 @@ pandas = ">=2.1"
numpy_groupies = "*"
numpydoc = "*"
openpyxl = "*"
astor = "*"
ipywidgets = "*"
jupyterlab = "*"
networkx = "*" # Remove once dags is a proper dependency
Expand Down
6 changes: 2 additions & 4 deletions src/ttsim/vectorization.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
from collections.abc import Callable
from importlib import import_module

import astor

from ttsim.config import numpy_or_jax

BACKEND_TO_MODULE = {"jax": "jax.numpy", "numpy": "numpy"}
Expand Down Expand Up @@ -71,7 +69,7 @@ def make_vectorizable_source(func: Callable, backend: str) -> str:

module = _module_from_backend(backend)
tree = _make_vectorizable_ast(func, module=module)
return astor.code_gen.to_source(tree)
return ast.unparse(tree)


def _make_vectorizable_ast(func: Callable, module: str) -> ast.Module:
Expand Down Expand Up @@ -370,7 +368,7 @@ def _disallowed_operation_error_message(node: ast.AST, func_loc: str) -> str:


def _node_to_formatted_source(node: ast.AST) -> str:
source = astor.code_gen.to_source(node)
source = ast.unparse(node)
return " > " + source[:-1].replace("\n", "\n > ")


Expand Down
Loading