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
4 changes: 2 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"sympy": ("https://docs.sympy.org/dev/", None),
"typing_extensions":
("https://typing-extensions.readthedocs.io/en/latest/", None),
"immutabledict":
("https://immutabledict.corenting.fr/", None)
"constantdict":
("https://matthiasdiener.github.io/constantdict/", None)
}
autodoc_type_aliases = {
"Expression": "Expression",
Expand Down
8 changes: 4 additions & 4 deletions pymbolic/mapper/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
)
from warnings import warn

from immutabledict import immutabledict
from constantdict import constantdict
from typing_extensions import ParamSpec, TypeIs

import pymbolic.primitives as p
Expand Down Expand Up @@ -200,7 +200,7 @@
else:
return self.handle_unsupported_expression(expr, *args, **kwargs)
else:
return self.map_foreign(expr, *args, **kwargs)

Check warning on line 203 in pymbolic/mapper/__init__.py

View workflow job for this annotation

GitHub Actions / Pytest on Py3.10

List found in expression graph. This is deprecated and will stop working in 2025. Use tuples instead.

Check warning on line 203 in pymbolic/mapper/__init__.py

View workflow job for this annotation

GitHub Actions / Pytest on Py3.10

List found in expression graph. This is deprecated and will stop working in 2025. Use tuples instead.

Check warning on line 203 in pymbolic/mapper/__init__.py

View workflow job for this annotation

GitHub Actions / Pytest on Py3.10

List found in expression graph. This is deprecated and will stop working in 2025. Use tuples instead.

Check warning on line 203 in pymbolic/mapper/__init__.py

View workflow job for this annotation

GitHub Actions / Pytest on Py3.10

List found in expression graph. This is deprecated and will stop working in 2025. Use tuples instead.

Check warning on line 203 in pymbolic/mapper/__init__.py

View workflow job for this annotation

GitHub Actions / Pytest on Py3.10

List found in expression graph. This is deprecated and will stop working in 2025. Use tuples instead.

Check warning on line 203 in pymbolic/mapper/__init__.py

View workflow job for this annotation

GitHub Actions / Pytest on Py3.10

List found in expression graph. This is deprecated and will stop working in 2025. Use tuples instead.

rec = __call__

Expand Down Expand Up @@ -413,7 +413,7 @@
# Must add 'type(expr)', to differentiate between python scalar types.
# In Python, the following conditions are true: "hash(4) == hash(4.0)"
# and "4 == 4.0", but their traversal results cannot be re-used.
return (type(expr), expr, args, immutabledict(kwargs))
return (type(expr), expr, args, constantdict(kwargs))

def __call__(self,
expr: Expression,
Expand Down Expand Up @@ -760,7 +760,7 @@
parameters = tuple([
self.rec(child, *args, **kwargs) for child in expr.parameters
])
kw_parameters: Mapping[str, Expression] = immutabledict({
kw_parameters: Mapping[str, Expression] = constantdict({
key: self.rec(val, *args, **kwargs)
for key, val in expr.kw_parameters.items()})

Expand Down Expand Up @@ -1517,7 +1517,7 @@
ccd = self._cse_cache_dict = {}

key: tuple[Expression, P.args, P.kwargs] = (
expr, args, immutabledict(kwargs))
expr, args, constantdict(kwargs))
try:
return ccd[key]
except KeyError:
Expand Down
4 changes: 2 additions & 2 deletions pymbolic/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from sys import intern
from typing import TYPE_CHECKING, ClassVar, TypeAlias

from immutabledict import immutabledict
from constantdict import constantdict

import pytools.lex
from pytools import memoize_method
Expand Down Expand Up @@ -348,7 +348,7 @@ def parse_postfix(self, pstate, min_precedence, left_exp):

if kwargs:
left_exp = primitives.CallWithKwargs(
left_exp, args, immutabledict(kwargs))
left_exp, args, constantdict(kwargs))
else:
left_exp = primitives.Call(left_exp, args)

Expand Down
9 changes: 4 additions & 5 deletions pymbolic/primitives.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
)
from warnings import warn

from immutabledict import immutabledict
from constantdict import constantdict
from typing_extensions import TypeIs, dataclass_transform

from pytools import module_getattr_for_deprecations
Expand Down Expand Up @@ -621,8 +621,7 @@ def __pos__(self) -> ArithmeticExpression:

def __call__(self, *args, **kwargs) -> Call | CallWithKwargs:
if kwargs:
from immutabledict import immutabledict
return CallWithKwargs(self, args, immutabledict(kwargs))
return CallWithKwargs(self, args, constantdict(kwargs))
else:
return Call(self, args)

Expand Down Expand Up @@ -1216,10 +1215,10 @@ def __post_init__(self):
warn("CallWithKwargs created with non-hashable kw_parameters. "
"This is deprecated and will stop working in 2025. "
"If you need an immutable mapping, "
"try the :mod:`immutabledict` package.",
"try the :mod:`constantdict` package.",
DeprecationWarning, stacklevel=3
)
object.__setattr__(self, "kw_parameters", immutabledict(self.kw_parameters))
object.__setattr__(self, "kw_parameters", constantdict(self.kw_parameters))


@expr_dataclass()
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ classifiers = [
"Topic :: Utilities",
]
dependencies = [
"immutabledict",
"constantdict",
"pytools>=2024.1.16",
# for dataclass_transform, TypeAlias, deprecated
"typing-extensions>=4.5",
Expand Down
Loading