Skip to content

Commit

Permalink
Bump version to 0.19.0 (#232)
Browse files Browse the repository at this point in the history
Minor improvements
  • Loading branch information
david-zwicker authored May 2, 2022
1 parent c4a76fd commit 28f1474
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@
print("Example gallery will be excluded...")
toc_filter_exclude = ["gallery"]
else:
print("NORMAL DOC")
print("Example gallery will be included...")
toc_filter_exclude = []


Expand Down
3 changes: 1 addition & 2 deletions pde/tools/expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1099,8 +1099,7 @@ def evaluate(
# turn result into a proper field
result_rank = result_data.ndim - grid.num_axes
result_cls = DataFieldBase.get_class_by_rank(result_rank)
dtype = complex if expr.complex else float
return result_cls(grid, result_data, label=label, dtype=dtype)
return result_cls(grid, result_data, label=label)


__all__ = [
Expand Down
9 changes: 9 additions & 0 deletions pde/tools/tests/test_expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,15 @@ def test_evaluate_func_scalar():
res = evaluate("a - x", {"a": field})
np.testing.assert_almost_equal(res.data, 0)

field_c = ScalarField.from_expression(grid, "1 + 1j")
res = evaluate("c", {"c": field_c})
assert res.dtype == "complex"
np.testing.assert_almost_equal(res.data, field_c.data)

res = evaluate("abs(a)**2", {"a": field_c})
assert res.dtype == "float"
np.testing.assert_allclose(res.data, 2)


def test_evaluate_func_vector():
"""test the evaluate function with vector fields"""
Expand Down
2 changes: 1 addition & 1 deletion pde/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
.. codeauthor:: David Zwicker <david.zwicker@ds.mpg.de>
"""

__version__ = "0.18.0"
__version__ = "0.19.0"

0 comments on commit 28f1474

Please sign in to comment.