From a1dadec0fc96fa3df4c75df97b7938a4302edff0 Mon Sep 17 00:00:00 2001 From: Manav Malhotra Date: Mon, 20 Jul 2026 16:33:36 -0400 Subject: [PATCH] Fix Sphinx API documentation warnings --- docs/source/conf.py | 1 + src/pyprobound/aggregate.py | 4 ++-- src/pyprobound/base.py | 2 +- src/pyprobound/cooperativity.py | 4 ++-- src/pyprobound/layers/conv0d.py | 2 +- src/pyprobound/layers/conv1d.py | 4 +++- src/pyprobound/layers/psam.py | 2 +- src/pyprobound/mode.py | 2 +- src/pyprobound/rounds.py | 8 +++++--- 9 files changed, 17 insertions(+), 12 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 17ec1dc..e8fa180 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -39,6 +39,7 @@ add_module_names = False autodoc_member_order = "bysource" napoleon_google_docstring = True +napoleon_use_ivar = True autodoc_default_options = {"member-order": "bysource", "undoc-members": True} nb_execution_mode = "off" diff --git a/src/pyprobound/aggregate.py b/src/pyprobound/aggregate.py index d978d87..1b5d069 100644 --- a/src/pyprobound/aggregate.py +++ b/src/pyprobound/aggregate.py @@ -76,7 +76,7 @@ def components(self) -> Iterator[Binding]: yield self.binding @override - def unfreeze(self, parameter: unfreezable = "all") -> None: + def unfreeze(self, parameter: "Contribution.unfreezable" = "all") -> None: if parameter in ("activity", "all") and self.train_activity: if torch.isneginf(self.log_activity): raise ValueError( @@ -216,7 +216,7 @@ def _contributing(self) -> Iterator[Contribution]: yield ctrb @override - def unfreeze(self, parameter: unfreezable = "all") -> None: + def unfreeze(self, parameter: "Aggregate.unfreezable" = "all") -> None: if parameter in ("concentration", "all"): if self.train_concentration: self.log_target_concentration.requires_grad_() diff --git a/src/pyprobound/base.py b/src/pyprobound/base.py index f5e8f1f..1e5f43c 100644 --- a/src/pyprobound/base.py +++ b/src/pyprobound/base.py @@ -310,7 +310,7 @@ def freeze(self) -> None: for p in self.parameters(): p.requires_grad_(False) - def unfreeze(self, parameter: unfreezable = "all") -> None: + def unfreeze(self, parameter: "Component.unfreezable" = "all") -> None: """Turns on gradient calculation for the specified parameter. Args: diff --git a/src/pyprobound/cooperativity.py b/src/pyprobound/cooperativity.py index 6c32dd0..c98ffca 100644 --- a/src/pyprobound/cooperativity.py +++ b/src/pyprobound/cooperativity.py @@ -177,7 +177,7 @@ def components(self) -> Iterator[Component]: return iter(()) @override - def unfreeze(self, parameter: unfreezable = "all") -> None: + def unfreeze(self, parameter: "Spacing.unfreezable" = "all") -> None: if parameter in ("spacing", "all"): self.log_spacing.requires_grad_() if parameter != "spacing": @@ -672,7 +672,7 @@ def check_length_consistency(self) -> None: ) @override - def unfreeze(self, parameter: unfreezable = "all") -> None: + def unfreeze(self, parameter: "Cooperativity.unfreezable" = "all") -> None: if parameter in ("hill", "all") and self.train_hill: self.log_hill.requires_grad_() if parameter in ("posbias", "all") and self.train_posbias: diff --git a/src/pyprobound/layers/conv0d.py b/src/pyprobound/layers/conv0d.py index 77700a4..c7253d9 100644 --- a/src/pyprobound/layers/conv0d.py +++ b/src/pyprobound/layers/conv0d.py @@ -175,7 +175,7 @@ def check_length_consistency(self) -> None: ) @override - def unfreeze(self, parameter: unfreezable = "all") -> None: + def unfreeze(self, parameter: "Conv0d.unfreezable" = "all") -> None: if parameter in ("posbias", "all") and self.train_posbias: self.log_posbias.requires_grad_() if parameter != "posbias": diff --git a/src/pyprobound/layers/conv1d.py b/src/pyprobound/layers/conv1d.py index b5f86cf..ee51f6f 100644 --- a/src/pyprobound/layers/conv1d.py +++ b/src/pyprobound/layers/conv1d.py @@ -29,8 +29,10 @@ class Conv1d(Layer): :math:`-\log K^{rel}_{\text{D}}` of each sliding window. .. math:: + \log \frac{1}{K^{rel}_{\text{D}, a} (S_{i, x})} = \omega(x) + \sum_{\phi} \beta_\phi \mathbb{1}_\phi(S_{i, x}) + where :math:`\mathbb{1}_\phi(S_{i, x})` is the indicator function of when window :math:`x` of sequence :math:`i` contains feature :math:`\phi`. @@ -298,7 +300,7 @@ def check_length_consistency(self) -> None: ) @override - def unfreeze(self, parameter: unfreezable = "all") -> None: + def unfreeze(self, parameter: "Conv1d.unfreezable" = "all") -> None: if parameter in ("posbias", "all") and self.train_posbias: self.log_posbias.requires_grad_() if parameter != "posbias": diff --git a/src/pyprobound/layers/psam.py b/src/pyprobound/layers/psam.py index 27515cc..64ccec8 100644 --- a/src/pyprobound/layers/psam.py +++ b/src/pyprobound/layers/psam.py @@ -426,7 +426,7 @@ def _seed( torch.nn.init.constant_(parameter, val) @override - def unfreeze(self, parameter: unfreezable = "all") -> None: + def unfreeze(self, parameter: "PSAM.unfreezable" = "all") -> None: if self.train_betas: if parameter in ("monomer", "pairwise", "all"): if self.train_bias: diff --git a/src/pyprobound/mode.py b/src/pyprobound/mode.py index 865c802..59253a1 100644 --- a/src/pyprobound/mode.py +++ b/src/pyprobound/mode.py @@ -301,7 +301,7 @@ def check_length_consistency(self) -> None: ) @override - def unfreeze(self, parameter: unfreezable = "all") -> None: + def unfreeze(self, parameter: "Mode.unfreezable" = "all") -> None: if parameter in ("hill", "all") and self.train_hill: self.log_hill.requires_grad_() if parameter != "hill": diff --git a/src/pyprobound/rounds.py b/src/pyprobound/rounds.py index f4dc6fd..9a560b0 100644 --- a/src/pyprobound/rounds.py +++ b/src/pyprobound/rounds.py @@ -117,7 +117,7 @@ def __setattr__(self, name: str, value: Any) -> None: def components(self) -> Iterator[Aggregate]: ... @override - def unfreeze(self, parameter: unfreezable = "all") -> None: + def unfreeze(self, parameter: "BaseRound.unfreezable" = "all") -> None: if parameter in ("depth", "all") and self.train_depth: self.log_depth.requires_grad_() if parameter != "depth": @@ -532,7 +532,7 @@ def from_binding( ) @override - def unfreeze(self, parameter: unfreezable = "all") -> None: + def unfreeze(self, parameter: "RhoGammaRound.unfreezable" = "all") -> None: if parameter in ("rho", "all"): self.rho.requires_grad_() self.gamma.requires_grad_() @@ -683,7 +683,9 @@ def from_binding( ) @override - def unfreeze(self, parameter: unfreezable = "all") -> None: + def unfreeze( + self, parameter: "ExponentialRound.unfreezable" = "all" + ) -> None: if parameter in ("delta", "all") and self.train_delta: self.delta.requires_grad_() if parameter != "delta":