Skip to content

Commit 3715c7d

Browse files
committed
Rename sympy/symengine switching from "backend" to "symbolic API"
1 parent 07ffa56 commit 3715c7d

27 files changed

+80
-85
lines changed

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,16 @@ TEST_CMD=-m unittest discover -s test/ -p *_test.py -v
8686
GEN_FILES=test/*codegen*.py
8787

8888
test_symengine:
89-
$(TEST_ENV) SYMFORCE_BACKEND=symengine $(PYTHON) $(TEST_CMD)
89+
$(TEST_ENV) SYMFORCE_SYMBOLIC_API=symengine $(PYTHON) $(TEST_CMD)
9090

9191
test_sympy:
92-
$(TEST_ENV) SYMFORCE_BACKEND=sympy $(PYTHON) $(TEST_CMD)
92+
$(TEST_ENV) SYMFORCE_SYMBOLIC_API=sympy $(PYTHON) $(TEST_CMD)
9393

9494
test: test_symengine test_sympy
9595

9696
# Generic target to run a SymEngine codegen test with --update
9797
update_%:
98-
$(TEST_ENV) SYMFORCE_BACKEND=symengine $(PYTHON) test/$*.py --update
98+
$(TEST_ENV) SYMFORCE_SYMBOLIC_API=symengine $(PYTHON) test/$*.py --update
9999

100100
# All SymForce codegen tests, formatted as update_my_codegen_test targets
101101
GEN_FILES_UPDATE_TARGETS=$(shell \
@@ -106,7 +106,7 @@ test_update: $(GEN_FILES_UPDATE_TARGETS)
106106

107107
# Generic target to run a SymPy codegen test with --update --run_slow_tests
108108
sympy_update_%:
109-
$(TEST_ENV) SYMFORCE_BACKEND=sympy $(PYTHON) test/$*.py --update --run_slow_tests
109+
$(TEST_ENV) SYMFORCE_SYMBOLIC_API=sympy $(PYTHON) test/$*.py --update --run_slow_tests
110110

111111
# All SymForce codegen tests, formatted as sympy_update_my_codegen_test targets
112112
GEN_FILES_SYMPY_UPDATE_TARGETS=$(shell \

docs/development.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,11 @@ Much of the core functionality of SymForce is in generating code using the `Jinj
9595
For example template files, see ``symforce/codegen/cpp_templates``.
9696

9797
*************************************************
98-
Symbolic Backends
98+
Symbolic API
9999
*************************************************
100-
SymForce uses the `SymPy <https://www.sympy.org/en/index.html>`_ API, but supports two backend implementations of it. The SymPy backend is pure Python, whereas the `SymEngine <https://github.com/symengine/symengine>`_ backend is wrapped C++. It can be 100-200 times faster for many operations, but is less fully featured and requires a C++ build.
100+
SymForce uses the `SymPy <https://www.sympy.org/en/index.html>`_ API, but supports two implementations of it. The SymPy implementation is pure Python, whereas the `SymEngine <https://github.com/symengine/symengine>`_ implementation is wrapped C++. It can be 100-200 times faster for many operations, but is less fully featured and requires a C++ build.
101101

102-
To set the backend, you can either use :func:`symforce.set_backend()` before any other imports, or use the ``SYMFORCE_BACKEND`` environment variable with the options ``sympy`` or ``symengine``. By default SymEngine will be used if found, otherwise SymPy.
102+
To set the symbolic API, you can either use :func:`symforce.set_symbolic_api()` before any other imports, or use the ``SYMFORCE_SYMBOLIC_API`` environment variable with the options ``sympy`` or ``symengine``. By default SymEngine will be used if found, otherwise SymPy.
103103

104104
*************************************************
105105
Building wheels

notebooks/storage_D_tangent.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"source": [
99
"import symforce\n",
1010
"\n",
11-
"symforce.set_backend(\"sympy\")\n",
11+
"symforce.set_symbolic_api(\"sympy\")\n",
1212
"symforce.set_log_level(\"warning\")\n",
1313
"\n",
1414
"from symforce import geo\n",

notebooks/symbolic_computation_speedups.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"# Setup\n",
2424
"import symforce\n",
2525
"\n",
26-
"symforce.set_backend(\"sympy\")\n",
26+
"symforce.set_symbolic_api(\"sympy\")\n",
2727
"\n",
2828
"from symforce import geo\n",
2929
"from symforce import sympy as sm\n",

notebooks/tangent_D_storage.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"source": [
99
"import symforce\n",
1010
"\n",
11-
"symforce.set_backend(\"sympy\")\n",
11+
"symforce.set_symbolic_api(\"sympy\")\n",
1212
"symforce.set_log_level(\"warning\")\n",
1313
"\n",
1414
"from symforce import geo\n",

notebooks/tutorials/cameras_tutorial.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"# Setup\n",
2424
"import symforce\n",
2525
"\n",
26-
"symforce.set_backend(\"sympy\")\n",
26+
"symforce.set_symbolic_api(\"sympy\")\n",
2727
"symforce.set_log_level(\"warning\")\n",
2828
"\n",
2929
"from symforce.notebook_util import display\n",

notebooks/tutorials/codegen_tutorial.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"import os\n",
3737
"import symforce\n",
3838
"\n",
39-
"symforce.set_backend(\"symengine\")\n",
39+
"symforce.set_symbolic_api(\"symengine\")\n",
4040
"symforce.set_log_level(\"warning\")\n",
4141
"\n",
4242
"from symforce import codegen\n",

notebooks/tutorials/geometry_tutorial.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"# Setup\n",
2626
"import symforce\n",
2727
"\n",
28-
"symforce.set_backend(\"sympy\")\n",
28+
"symforce.set_symbolic_api(\"sympy\")\n",
2929
"symforce.set_log_level(\"warning\")\n",
3030
"\n",
3131
"from symforce.notebook_util import display\n",

notebooks/tutorials/ops_tutorial.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"# Setup\n",
2828
"import symforce\n",
2929
"\n",
30-
"symforce.set_backend(\"sympy\")\n",
30+
"symforce.set_symbolic_api(\"sympy\")\n",
3131
"symforce.set_log_level(\"warning\")\n",
3232
"\n",
3333
"from symforce.notebook_util import display\n",

notebooks/tutorials/sympy_tutorial.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"# Configuration (optional)\n",
2525
"import symforce\n",
2626
"\n",
27-
"symforce.set_backend(\"sympy\")\n",
27+
"symforce.set_symbolic_api(\"sympy\")\n",
2828
"symforce.set_log_level(\"warning\")\n",
2929
"from symforce.notebook_util import display, print_expression_tree"
3030
]
@@ -33,7 +33,7 @@
3333
"cell_type": "markdown",
3434
"metadata": {},
3535
"source": [
36-
"Always import the SymPy API through SymForce, because symforce can switch out the backend implementation of the API and adds a few minor but important augmentations. Let's define some algebraic symbols:"
36+
"Always import the SymPy API through SymForce, because symforce can switch out the symbolic implementation of the API and adds a few minor but important augmentations. Let's define some algebraic symbols:"
3737
]
3838
},
3939
{

0 commit comments

Comments
 (0)