Skip to content

Commit

Permalink
docs: fix typos in docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
rmnldwg committed Mar 18, 2024
1 parent a379316 commit 1b86d01
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
10 changes: 5 additions & 5 deletions lymph/models/bilateral.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def get_spread_params(
symmetric, the leading ``ipsi_`` or ``contra_`` is omitted, since it's valid
for both sides.
This is consistent with how the :py:meth:`~lymph.models.Bilteral.set_params`
This is consistent with how the :py:meth:`.set_params`
method expects the keyword arguments in case of the symmetry configurations.
>>> model = Bilateral(graph_dict={
Expand Down Expand Up @@ -564,7 +564,7 @@ def likelihood(
raise ValueError("Invalid mode. Must be either 'HMM' or 'BN'.")


def comp_posterior_joint_state_dist(
def posterior_joint_state_dist(
self,
given_params: types.ParamsType | None = None,
given_diagnoses: dict[str, types.DiagnoseType] | None = None,
Expand All @@ -573,7 +573,7 @@ def comp_posterior_joint_state_dist(
) -> np.ndarray:
"""Compute joint post. dist. over ipsi & contra states, ``given_diagnoses``.
The ``given_diagnoses`` is a dictionary storing a :py:class:`types.DiagnoseType`
The ``given_diagnoses`` is a dictionary storing a :py:obj:`.types.DiagnoseType`
for the ``"ipsi"`` and ``"contra"`` side of the neck.
Essentially, this is the risk for any possible combination of ipsi- and
Expand Down Expand Up @@ -630,7 +630,7 @@ def risk(
The parameters can be set via the ``given_params`` and ``given_params``, both
of which are passed to the :py:meth:`.set_params` method. The
``given_diagnoses`` must be a dictionary mapping the side of the neck to a
:py:class:`.types.DiagnoseType`.
:py:obj:`.types.DiagnoseType`.
Note:
The computation is much faster if no parameters are given, since then the
Expand All @@ -645,7 +645,7 @@ def risk(
only marginalizes over the states that match the involvement pattern.
"""
# TODO: test this method
posterior_state_probs = self.comp_posterior_joint_state_dist(
posterior_state_probs = self.posterior_joint_state_dist(
given_params=given_params,
given_diagnoses=given_diagnoses,
t_stage=t_stage,
Expand Down
3 changes: 2 additions & 1 deletion lymph/models/midline.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,8 @@ def get_params(
"""Return all the parameters of the model.
This includes the spread parameters from the call to :py:meth:`get_spread_params`
and the distribution parameters from the call to :py:meth:`get_distribution_params`.
and the distribution parameters from the call to
:py:meth:`~.diagnose_times.Composite.get_distribution_params`.
"""
params = {}
params["midext_prob"] = self.midext_prob
Expand Down
8 changes: 4 additions & 4 deletions lymph/models/unilateral.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ def state_dist(
which is essentially a marginalization of the evolution over the possible
states as computed by :py:meth:`.state_dist_evo` with the distribution
over diagnose times for the given T-stage from the dictionary returned by
:py:meth:`.get_all_dsitributions`.
:py:meth:`.get_all_distributions`.
Or, when ``mode`` is set to ``"BN"``, compute the distribution over states for
the Bayesian network. In that case, the ``t_stage`` parameter is ignored.
Expand Down Expand Up @@ -669,12 +669,12 @@ def obs_dist(
Returns an array of probabilities for each possible complete observation. This
entails multiplying the distribution over states as returned by the
:py:meth:`.state_dist` method with the :py:attr:`.observation_matrix`.
:py:meth:`.state_dist` method with the :py:meth:`.observation_matrix`.
Note that since the :py:attr:`.observation_matrix` can become very large, this
method is not very efficient for inference. Instead, we compute the
:py:attr:`.diagnose_matrices` from the :py:attr:`.observation_matrix` and
the :py:attr:`.data_matrices` and use these to compute the likelihood.
:py:meth:`.diagnose_matrix` from the :py:meth:`.observation_matrix` and
the :py:meth:`.data_matrix` and use these to compute the likelihood.
"""
state_dist = self.state_dist(t_stage=t_stage, mode=mode)
return state_dist @ self.observation_matrix()
Expand Down
2 changes: 1 addition & 1 deletion tests/binary_bilateral_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ def test_posterior_state_dist(self):
random_parameters = self.create_random_params()
random_diagnoses = self.create_random_diagnoses()

posterior = self.model.comp_posterior_joint_state_dist(
posterior = self.model.posterior_joint_state_dist(
given_params=random_parameters,
given_diagnoses=random_diagnoses,
)
Expand Down

0 comments on commit 1b86d01

Please sign in to comment.