utils.py¶
make_dataframe
¶
Convert a dictionary into a pandas dataframe to prettify it.
The keys becomes the "index" column. The dictionary values become a column labeled "value".
Parameters:
Returns:
-
DataFrame–dataframe conversion
Source code in .venv/lib/python3.14/site-packages/langevin/base/utils.py
make_multisim_title
¶
Define a title string to use when annotating plots.
Parameters:
-
(p¶dict) –parameters dictionary
-
(analysis¶dict) –analysis dictionary
-
(a_range¶tuple[float, float] | None) –span of values of linear coefficient "a"
Returns:
-
str–title string
Source code in .venv/lib/python3.14/site-packages/langevin/base/utils.py
make_name_title
¶
make_name_title(
field_name: str,
p: dict,
analysis: dict,
t_total: float | None = None,
a_range: tuple[float, float] | None = None,
do_multisim: bool = False,
) -> tuple[str, str]
Define (file) name and (plot) title strings.
Parameters:
-
(p¶dict) –parameters dictionary
-
(analysis¶dict) –analysis dictionary
-
(t_total¶float | None, default:None) –time span of simulation
-
(a_range¶tuple[float, float] | None, default:None) –span of values of linear coefficient "a"
-
(do_multisim¶bool, default:False) –flag if doing multiple simulations
Returns:
Source code in .venv/lib/python3.14/site-packages/langevin/base/utils.py
make_sim_title
¶
Define a title string to use when annotating plots.
Parameters:
-
(p¶dict) –parameters dictionary
-
(analysis¶dict) –analysis dictionary
-
(module¶Any) –dplvn or other class module
-
(do_omit_a¶bool, default:False) –skip linear coefficient "a" in string
Returns:
-
str–title string
Source code in .venv/lib/python3.14/site-packages/langevin/base/utils.py
set_name
¶
set_name(
p: dict,
a: dict,
field_name: str | None = None,
suffix: str = "",
t_epoch: float | None = None,
do_parent: bool = False,
do_dir: bool = False,
) -> str
Define a simulation name string that includes model parameters for info.
Parameters:
-
(p¶dict) –parameters dictionary
-
(a¶dict) –analysis dictionary
-
(field_name¶str | None, default:None) –name (e.g. 'ρ') of Langevin field variable
-
(suffix¶str, default:'') –optional
-
(t_epoch¶float | None, default:None) –time slice of sim
-
(do_parent¶bool, default:False) –generate a 'parent' folder name
-
(do_dir¶bool, default:False) –generate a detailed folder name
Returns:
-
str–name string