Add remove-cell tags

release/4.3a0
p-zach 2025-04-14 18:55:36 -04:00
parent 04bba9156c
commit db8ead2c9a
16 changed files with 73 additions and 32 deletions

View File

@ -45,7 +45,10 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"id": "bayesnet_pip_code" "id": "bayesnet_pip_code",
"tags": [
"remove-cell"
]
}, },
"outputs": [], "outputs": [],
"source": [ "source": [

View File

@ -50,7 +50,10 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"id": "bayestree_pip_code" "id": "bayestree_pip_code",
"tags": [
"remove-cell"
]
}, },
"outputs": [], "outputs": [],
"source": [ "source": [

View File

@ -35,7 +35,10 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"id": "clustertree_pip_code" "id": "clustertree_pip_code",
"tags": [
"remove-cell"
]
}, },
"outputs": [], "outputs": [],
"source": [ "source": [

View File

@ -56,7 +56,10 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"id": "conditional_pip_code" "id": "conditional_pip_code",
"tags": [
"remove-cell"
]
}, },
"outputs": [], "outputs": [],
"source": [ "source": [

View File

@ -33,11 +33,14 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"id": "dotwriter_pip_code" "id": "dotwriter_pip_code",
"tags": [
"remove-cell"
]
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
"%pip install gtsam graphviz" "%pip install gtsam"
] ]
}, },
{ {

View File

@ -31,7 +31,10 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"id": "edgekey_pip_code" "id": "edgekey_pip_code",
"tags": [
"remove-cell"
]
}, },
"outputs": [], "outputs": [],
"source": [ "source": [

View File

@ -37,7 +37,10 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"id": "etree_pip_code" "id": "etree_pip_code",
"tags": [
"remove-cell"
]
}, },
"outputs": [], "outputs": [],
"source": [ "source": [

View File

@ -44,7 +44,10 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"id": "factor_pip_code" "id": "factor_pip_code",
"tags": [
"remove-cell"
]
}, },
"outputs": [], "outputs": [],
"source": [ "source": [

View File

@ -46,7 +46,10 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"id": "fg_pip_code" "id": "fg_pip_code",
"tags": [
"remove-cell"
]
}, },
"outputs": [], "outputs": [],
"source": [ "source": [

View File

@ -35,7 +35,10 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"id": "isam_pip_code" "id": "isam_pip_code",
"tags": [
"remove-cell"
]
}, },
"outputs": [], "outputs": [],
"source": [ "source": [

View File

@ -37,7 +37,10 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"id": "jtree_pip_code" "id": "jtree_pip_code",
"tags": [
"remove-cell"
]
}, },
"outputs": [], "outputs": [],
"source": [ "source": [

View File

@ -31,7 +31,10 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"id": "key_pip_code" "id": "key_pip_code",
"tags": [
"remove-cell"
]
}, },
"outputs": [], "outputs": [],
"source": [ "source": [

View File

@ -31,7 +31,10 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"id": "lsymbol_pip_code" "id": "lsymbol_pip_code",
"tags": [
"remove-cell"
]
}, },
"outputs": [], "outputs": [],
"source": [ "source": [

View File

@ -33,7 +33,10 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"id": "ordering_pip_code" "id": "ordering_pip_code",
"tags": [
"remove-cell"
]
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
@ -42,7 +45,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 4, "execution_count": 1,
"metadata": { "metadata": {
"id": "ordering_import_code" "id": "ordering_import_code"
}, },
@ -96,7 +99,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 7, "execution_count": null,
"metadata": { "metadata": {
"colab": { "colab": {
"base_uri": "https://localhost:8080/" "base_uri": "https://localhost:8080/"
@ -106,21 +109,14 @@
}, },
"outputs": [ "outputs": [
{ {
"name": "stdout", "ename": "TypeError",
"output_type": "stream", "evalue": "Colamd(): incompatible function arguments. The following argument types are supported:\n 1. (variableIndex: gtsam::VariableIndex) -> gtsam.gtsam.Ordering\n\nInvoked with: kwargs: graph=SymbolicFactorGraph \nsize: 7\nfactor 0: x0\nfactor 1: x0 x1\nfactor 2: x1 x2\nfactor 3: x0 l1\nfactor 4: x1 l1\nfactor 5: x1 l2\nfactor 6: x2 l2\n",
"text": [
"COLAMD Ordering: Position 0: l1, x0, x1, l2, x2\n"
]
},
{
"ename": "AttributeError",
"evalue": "type object 'gtsam.gtsam.Ordering' has no attribute 'ColamdConstrainedLast'",
"output_type": "error", "output_type": "error",
"traceback": [ "traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mAttributeError\u001b[0m Traceback (most recent call last)", "\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[1;32mIn[7], line 17\u001b[0m\n\u001b[0;32m 14\u001b[0m colamd_ordering\u001b[38;5;241m.\u001b[39mprint(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mCOLAMD Ordering: \u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m 16\u001b[0m \u001b[38;5;66;03m# Constrained COLAMD (force x0 and x2 to be eliminated last)\u001b[39;00m\n\u001b[1;32m---> 17\u001b[0m constrained_ordering \u001b[38;5;241m=\u001b[39m \u001b[43mOrdering\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mColamdConstrainedLast\u001b[49m(graph, gtsam\u001b[38;5;241m.\u001b[39mKeyVector([X(\u001b[38;5;241m0\u001b[39m), X(\u001b[38;5;241m2\u001b[39m)]))\n\u001b[0;32m 18\u001b[0m constrained_ordering\u001b[38;5;241m.\u001b[39mprint(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mConstrained COLAMD (x0, x2 last): \u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m 20\u001b[0m \u001b[38;5;66;03m# METIS ordering (if GTSAM was built with METIS support)\u001b[39;00m\n", "Cell \u001b[1;32mIn[3], line 13\u001b[0m\n\u001b[0;32m 10\u001b[0m graph\u001b[38;5;241m.\u001b[39mpush_factor(X(\u001b[38;5;241m2\u001b[39m), L(\u001b[38;5;241m2\u001b[39m))\n\u001b[0;32m 12\u001b[0m \u001b[38;5;66;03m# COLAMD (Column Approximate Minimum Degree) ordering\u001b[39;00m\n\u001b[1;32m---> 13\u001b[0m colamd_ordering \u001b[38;5;241m=\u001b[39m \u001b[43mOrdering\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mColamd\u001b[49m\u001b[43m(\u001b[49m\u001b[43mgraph\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mgraph\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 14\u001b[0m colamd_ordering\u001b[38;5;241m.\u001b[39mprint(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mCOLAMD Ordering: \u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m 16\u001b[0m \u001b[38;5;66;03m# Constrained COLAMD (force x0 and x2 to be eliminated last)\u001b[39;00m\n",
"\u001b[1;31mAttributeError\u001b[0m: type object 'gtsam.gtsam.Ordering' has no attribute 'ColamdConstrainedLast'" "\u001b[1;31mTypeError\u001b[0m: Colamd(): incompatible function arguments. The following argument types are supported:\n 1. (variableIndex: gtsam::VariableIndex) -> gtsam.gtsam.Ordering\n\nInvoked with: kwargs: graph=SymbolicFactorGraph \nsize: 7\nfactor 0: x0\nfactor 1: x0 x1\nfactor 2: x1 x2\nfactor 3: x0 l1\nfactor 4: x1 l1\nfactor 5: x1 l2\nfactor 6: x2 l2\n"
] ]
} }
], ],
@ -137,7 +133,7 @@
"graph.push_factor(X(2), L(2))\n", "graph.push_factor(X(2), L(2))\n",
"\n", "\n",
"# COLAMD (Column Approximate Minimum Degree) ordering\n", "# COLAMD (Column Approximate Minimum Degree) ordering\n",
"colamd_ordering = Ordering.Colamd(VariableIndex(graph))\n", "colamd_ordering = Ordering.Colamd(graph)\n",
"colamd_ordering.print(\"COLAMD Ordering: \")\n", "colamd_ordering.print(\"COLAMD Ordering: \")\n",
"\n", "\n",
"# Constrained COLAMD (force x0 and x2 to be eliminated last)\n", "# Constrained COLAMD (force x0 and x2 to be eliminated last)\n",

View File

@ -31,7 +31,10 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"id": "symbol_pip_code" "id": "symbol_pip_code",
"tags": [
"remove-cell"
]
}, },
"outputs": [], "outputs": [],
"source": [ "source": [

View File

@ -33,7 +33,10 @@
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"id": "vindex_pip_code" "id": "vindex_pip_code",
"tags": [
"remove-cell"
]
}, },
"outputs": [], "outputs": [],
"source": [ "source": [