Skip to content

Commit

Permalink
Merge pull request #57 from RangamaniLabUCSD/dokken/deprecated_unused…
Browse files Browse the repository at this point in the history
…_functions

Add deprecation notice
  • Loading branch information
emmetfrancis authored Mar 1, 2023
2 parents 49bcfc3 + d4bb91a commit 7575ae8
Show file tree
Hide file tree
Showing 11 changed files with 351 additions and 560 deletions.
4 changes: 1 addition & 3 deletions docs/_pythonapi/stubs.common.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
convert_xml_to_hdf5
cube_condition
data_path
empty_sbmodel
face_topology
facet_topology
find_steady_state
insert_dataframe_col
interp_limit_dy
Expand All @@ -33,7 +32,6 @@
read_hdf5
read_sbmodel
round_to_n
sbmodel_from_locals
stubs_expressions
sub
submesh_dof_to_mesh_dof
Expand Down
66 changes: 10 additions & 56 deletions examples/example1/example1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,18 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"id": "cc398816",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Authorization required, but no authorization protocol specified\n",
"Authorization required, but no authorization protocol specified\n"
]
}
],
"outputs": [],
"source": [
"import os\n",
"\n",
"import dolfin as d\n",
"import sympy as sym\n",
"\n",
"from stubs import unit, config, common, mesh, model\n",
"from stubs.model_assembly import Compartment, Parameter, Reaction, Species"
"from stubs.model_assembly import Compartment, Parameter, Reaction, Species, sbmodel_from_locals"
]
},
{
Expand All @@ -59,7 +50,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"id": "4f4023cf",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -87,7 +78,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"id": "09079b17",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -164,7 +155,7 @@
" # =============================================================================================\n",
" # Gather all parameters, species, compartments and reactions\n",
" # =============================================================================================\n",
" return common.sbmodel_from_locals(locals().values())"
" return sbmodel_from_locals(locals().values())"
]
},
{
Expand All @@ -178,48 +169,11 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"id": "fe56e162",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[32m[2023-01-20 time=02:35:42] Creating dolfin object for space-dependent initial condition R1\u001b[0m \u001b[97m\u001b[0m\n",
"\n",
"\u001b[35m!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\u001b[0m\n",
"\u001b[35m!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\u001b[0m\n",
"\u001b[35m!!!!!\u001b[0m \u001b[31m[2023-01-20 time=02:35:42] Warning! Pre-integrating parameter j1pulse. Make sure that expressions j1pulse appears in have no other time-dependent variables.\u001b[0m \u001b[35m!!!!!\u001b[0m\n",
"\u001b[35m!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\u001b[0m\n",
"\u001b[35m!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\u001b[0m\n",
"\n",
"\n",
"\u001b[35m!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\u001b[0m\n",
"\u001b[35m!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\u001b[0m\n",
"\u001b[35m!!!!!\u001b[0m \u001b[31m[2023-01-20 time=02:35:42] Warning! Pre-integrating parameter j1pulse. Make sure that expressions j1pulse appears in have no other time-dependent variables.\u001b[0m \u001b[35m!!!!!\u001b[0m\n",
"\u001b[35m!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\u001b[0m\n",
"\u001b[35m!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\u001b[0m\n",
"\n",
"\u001b[32m[2023-01-20 time=02:35:42] Time-dependent parameter j1pulse evaluated from expression.\u001b[0m \u001b[97m\u001b[0m\n",
"HDF5 mesh, \"parent_mesh\", successfully loaded from file: mesh/DemoCuboidsMesh.h5!\n",
"Object `config.solver.update` not found.\n"
]
},
{
"ename": "AttributeError",
"evalue": "'SolverConfig' object has no attribute 'update'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[4], line 25\u001b[0m\n\u001b[1;32m 23\u001b[0m model \u001b[39m=\u001b[39m model\u001b[39m.\u001b[39mModel(pc, sc, cc, rc, config, parent_mesh)\n\u001b[1;32m 24\u001b[0m get_ipython()\u001b[39m.\u001b[39mrun_line_magic(\u001b[39m'\u001b[39m\u001b[39mpinfo\u001b[39m\u001b[39m'\u001b[39m, \u001b[39m'\u001b[39m\u001b[39mconfig.solver.update\u001b[39m\u001b[39m'\u001b[39m)\n\u001b[0;32m---> 25\u001b[0m config\u001b[39m.\u001b[39;49msolver\u001b[39m.\u001b[39;49mupdate(\n\u001b[1;32m 26\u001b[0m {\n\u001b[1;32m 27\u001b[0m \u001b[39m\"\u001b[39m\u001b[39mfinal_t\u001b[39m\u001b[39m\"\u001b[39m: \u001b[39m1\u001b[39m,\n\u001b[1;32m 28\u001b[0m \u001b[39m\"\u001b[39m\u001b[39minitial_dt\u001b[39m\u001b[39m\"\u001b[39m: \u001b[39m0.01\u001b[39m,\n\u001b[1;32m 29\u001b[0m \u001b[39m\"\u001b[39m\u001b[39mtime_precision\u001b[39m\u001b[39m\"\u001b[39m: \u001b[39m6\u001b[39m,\n\u001b[1;32m 30\u001b[0m \u001b[39m\"\u001b[39m\u001b[39muse_snes\u001b[39m\u001b[39m\"\u001b[39m: \u001b[39mTrue\u001b[39;00m,\n\u001b[1;32m 31\u001b[0m \u001b[39m\"\u001b[39m\u001b[39mprint_assembly\u001b[39m\u001b[39m\"\u001b[39m: \u001b[39mFalse\u001b[39;00m,\n\u001b[1;32m 32\u001b[0m }\n\u001b[1;32m 33\u001b[0m )\n\u001b[1;32m 35\u001b[0m model\u001b[39m.\u001b[39minitialize(initialize_solver\u001b[39m=\u001b[39m\u001b[39mFalse\u001b[39;00m)\n\u001b[1;32m 36\u001b[0m model\u001b[39m.\u001b[39minitialize_discrete_variational_problem_and_solver()\n",
"\u001b[0;31mAttributeError\u001b[0m: 'SolverConfig' object has no attribute 'update'"
]
}
],
"outputs": [],
"source": [
"\n",
"pc, sc, cc, rc = make_model()\n",
"\n",
"# =============================================================================================\n",
Expand Down Expand Up @@ -281,7 +235,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "b54d28ca",
"id": "644b1304",
"metadata": {},
"outputs": [],
"source": []
Expand All @@ -294,7 +248,7 @@
"notebook_metadata_filter": "-all"
},
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand Down
12 changes: 10 additions & 2 deletions examples/example2/example2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"import numpy as np\n",
"\n",
"from stubs import unit, config, common, mesh, model\n",
"from stubs.model_assembly import Compartment, Parameter, Reaction, Species"
"from stubs.model_assembly import Compartment, Parameter, Reaction, Species, sbmodel_from_locals"
]
},
{
Expand Down Expand Up @@ -113,7 +113,7 @@
" # =============================================================================================\n",
" # Gather all parameters, species, compartments and reactions\n",
" # =============================================================================================\n",
" return common.sbmodel_from_locals(locals().values())"
" return sbmodel_from_locals(locals().values())"
]
},
{
Expand Down Expand Up @@ -187,6 +187,14 @@
" if modelCur.t >= modelCur.final_t:\n",
" break"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "4fe15da8",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
2 changes: 1 addition & 1 deletion examples/misc/rabona/test_different_step_size_err.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

errors = []
for dt in [0.012, 0.01, 0.008, 0.006, 0.004, 0.002]:
pc, sc, cc, rc = stubs.common.read_sbmodel('model.sbmodel')
pc, sc, cc, rc = stubs.model_assembly.read_sbmodel('model.sbmodel')

# Define solvers
mps = stubs.solvers.MultiphysicsSolver('iterative')
Expand Down
2 changes: 1 addition & 1 deletion stubs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
"common",
"mesh",
"unit",
"post_process"
"post_process",
]
Loading

0 comments on commit 7575ae8

Please sign in to comment.