Skip to content

Commit 443feb0

Browse files
committed
doc: private / public / fix references
* Exclude private members from the sphinx documentation * Make some supposed-to-be-private members private * Fix references To be continued...
1 parent 6b3bf83 commit 443feb0

File tree

14 files changed

+405
-409
lines changed

14 files changed

+405
-409
lines changed

doc/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ def install_doxygen():
207207
"inherited-members": True,
208208
"undoc-members": True,
209209
"ignore-module-all": False,
210+
"imported-members": True,
210211
}
211212

212213
# sphinx-autodoc-typehints

doc/examples/example_presimulation/ExampleExperimentalConditions.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@
211211
"source": [
212212
"# Retrieve model output names and formulae from AssignmentRules and remove the respective rules\n",
213213
"observables = amici.assignment_rules_to_observables(\n",
214-
" sbml_importer.sbml, # the libsbml model object\n",
214+
" sbml_importer.sbml_model, # the libsbml model object\n",
215215
" filter_function=lambda variable: variable.getName() == \"pPROT\",\n",
216216
")\n",
217217
"print(\"Observables:\")\n",

python/sdist/amici/__init__.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""
2-
The AMICI Python module provides functionality for importing SBML or PySB
3-
models and turning them into C++ Python extensions.
2+
Top-level module.
43
"""
54

65
import contextlib
@@ -133,12 +132,16 @@ def get_model_dir(model_id: str | None = None, jax: bool = False) -> Path:
133132

134133
# Initialize AMICI paths
135134
#: absolute root path of the amici repository or Python package
135+
#: :meta private:
136136
amici_path = _get_amici_path()
137137
#: absolute path of the amici swig directory
138+
#: :meta private:
138139
amiciSwigPath = os.path.join(amici_path, "swig")
139140
#: absolute path of the amici source directory
141+
#: :meta private:
140142
amiciSrcPath = os.path.join(amici_path, "src")
141143
#: absolute root path of the amici module
144+
#: :meta private:
142145
amiciModulePath = os.path.dirname(__file__)
143146

144147

@@ -165,6 +168,8 @@ class add_path:
165168
"""Context manager for temporarily changing PYTHONPATH.
166169
167170
Add a path to the PYTHONPATH for the duration of the context manager.
171+
172+
:meta private:
168173
"""
169174

170175
def __init__(self, path: str | Path):
@@ -183,6 +188,8 @@ class set_path:
183188
"""Context manager for temporarily changing PYTHONPATH.
184189
185190
Set the PYTHONPATH to a given path for the duration of the context manager.
191+
192+
:meta private:
186193
"""
187194

188195
def __init__(self, path: str | Path):
@@ -226,7 +233,7 @@ def import_model_module(
226233
module_name: str, module_path: Path | str
227234
) -> ModelModule:
228235
"""
229-
Import Python module of an AMICI model
236+
Import Python module of an AMICI model.
230237
231238
:param module_name:
232239
Name of the python package of the model

python/sdist/amici/exporters/sundials/de_export.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def __init__(
218218
# include/amici/model.h for details)
219219
self.model: DEModel = de_model
220220
self._code_printer.known_functions.update(
221-
splines.spline_user_functions(
221+
splines._spline_user_functions(
222222
self.model._splines, self._get_index("p")
223223
)
224224
)

python/sdist/amici/importers/antimony/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,10 @@ def antimony2sbml(ant_model: str | Path) -> str:
5151
def antimony2amici(ant_model: str | Path, *args, **kwargs):
5252
"""Convert Antimony model to AMICI model.
5353
54-
Converts the Antimony model provided as string of file to SBML and then imports it into AMICI.
54+
Converts the Antimony model provided as string or file to SBML and then
55+
imports it into AMICI.
5556
56-
For documentation see :meth:`amici.sbml_import.SbmlImporter.sbml2amici`.
57+
For documentation see :meth:`amici.importers.sbml.SbmlImporter.sbml2amici`.
5758
"""
5859
from amici.importers.sbml import SbmlImporter
5960

python/sdist/amici/importers/petab/_petab_importer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,7 @@ def __init__(self, petab_problem: v2.Problem):
11071107
if not isinstance(petab_problem.model, PySBModel):
11081108
raise ValueError("Only SBML models are supported.")
11091109
model = petab_problem.model.model
1110-
compartment_ids = {c.name for c in model.compartments}
1110+
compartment_ids = {c.name for c in model._compartments}
11111111
if compartment_ids and any(
11121112
change.target_id in compartment_ids
11131113
for cond in petab_problem.conditions

python/sdist/amici/importers/petab/v1/sbml_import.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ def import_model_sbml(
332332
sbml_model,
333333
discard_annotations=discard_sbml_annotations,
334334
)
335-
sbml_model = sbml_importer.sbml
335+
sbml_model = sbml_importer.sbml_model
336336

337337
allow_n_noise_pars = (
338338
not petab.lint.observable_table_has_nontrivial_noise_formula(

python/sdist/amici/importers/pysb/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,8 @@ def ode_model_from_pysb_importer(
325325
Creates an :class:`amici.DEModel` instance from a :class:`pysb.Model`
326326
instance.
327327
328+
:meta private:
329+
328330
:param model:
329331
see :func:`amici.importers.pysb.pysb2amici`
330332
@@ -1468,6 +1470,8 @@ def has_fixed_parameter_ic(
14681470
:meth:`de_export.DEModel.state_has_fixed_parameter_initial_condition`
14691471
from a pysb specie/model arguments
14701472
1473+
:meta private:
1474+
14711475
:param specie:
14721476
pysb species
14731477
@@ -1506,6 +1510,8 @@ def extract_monomers(
15061510
Constructs a list of monomer names contained in complex patterns.
15071511
Multiplicity of names corresponds to the stoichiometry in the complex.
15081512
1513+
:meta private:
1514+
15091515
:param complex_patterns:
15101516
(list of) complex pattern(s)
15111517

0 commit comments

Comments
 (0)