stubs.common

General functions: array manipulation, data i/o, etc

Functions

append_meshfunction_to_meshdomains(mesh, ...)

bmesh_to_parent(bmesh_emap_0, index)

color_print(full_text, color)

insert_dataframe_col(df, columnName[, ...])

pandas requires some weird manipulation to insert some things, e.g.

interp_limit_dy(t, y, max_dy[, interp_type])

Interpolates t and y such that dy between time points is never greater than max_dy Maintains all original t and y

json_to_ObjectContainer(json_str[, data_type])

Converts a json_str (either a string of the json itself, or a filepath to the json)

mesh_vertex_to_dof(V, species_index, index)

nan_to_none(df)

np_smart_hstack(x1, x2)

Quality of life function.

read_smodel(filepath)

round_to_n(x, n)

Rounds to n sig figs

submesh_dof_to_mesh_dof(Vsubmesh, submesh, ...)

Takes dof indices (single index or a list) on a submesh of a boundarymesh of a mesh and returns the dof indices of the original mesh.

submesh_dof_to_vertex(Vsubmesh, species_index)

submesh_to_bmesh(submesh, index)

sum_discrete_signals(ty1, ty2[, max_dy])

ty1: Numpy array of size N1 x 2 where the first column is time and the second column is the first signal ty2: Numpy array of size N2 x 2 where the first column is time and the second column is the second signal

write_smodel(filepath, pdf, sdf, cdf, rdf)

Takes a ParameterDF, SpeciesDF, CompartmentDF, and ReactionDF, and generates a .smodel file (a convenient concatenation of .json files with syntax similar to .xml)

Classes

ref(obj)

Pandas dataframe doesn't play nice with dolfin indexed functions since it will try to take the length but dolfin will not return anything.