* refactor(mypy): un-ignore 5 easy-tier modules
Fix each module's single pre-existing type error with a pure annotation
or setattr change (no behavior change) and remove it from the
[[tool.mypy.overrides]] ignore_errors list:
- callbacks/train_logging: loss_trackers: dict[str, MeanMetric]
- callbacks/metrics_logging: seen_examples: set[str]
- common: setattr(wrapper, "_has_run", True) for the @wraps wrapper
- hydra/resolvers: attribute_path: str | None (body already guards)
- inference_engines/base: base_overrides: dict[str, Any]
13 modules remain on the ignore list. mypy now type-checks the 5
newly-included modules cleanly.
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
* refactor(mypy): un-ignore 7 medium-tier modules
Resolve the type errors in and remove from the [[tool.mypy.overrides]]
ignore_errors list. Mostly narrowing / annotation fixes; two deliberate
type-honesty fixes flagged below.
- utils/weights: lowercase `any` -> `Any` in _PatternPolicyMixin (4x);
assert-narrow fallback_policy at the call site (matches get_policy idiom)
- model/layers/blocks: class-level w/b: torch.Tensor for the registered
buffers (avoids nn.Module's Tensor | Module __getattr__ fallback)
- utils/components: is-None narrowing + tip_names local in get_name_mask's
TIP branch (exists() can't narrow for mypy); drop orphaned exists import
- utils/logging: str(field) for the tree key; assign to a new hparams local
rather than reassigning the typed cfg param
- foundry_cli/download_checkpoints: guard on `hasher is not None`;
total_size = 0.0 for the float accumulation
- training/schedulers: SchedulerConfig.scheduler is now a required field
(was = None, but documented required and assumed non-None everywhere)
- utils/xpu/xpu_accelerator: name @property -> @staticmethod to match
lightning's Accelerator ABC
6 hard-tier modules remain on the ignore list.
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
* refactor(mypy): un-ignore metrics/metric module
Fix the 11 type errors in foundry.metrics.metric and remove it from the
[tool.mypy.overrides] ignore_errors list (5 hard-tier modules remain).
- str(name) coercion of DictConfig.items() keys (str|bytes|int|... union)
- exists() -> 'is not None' narrowing; drop orphaned atomworks import
- widen compute_from_kwargs -> dict|list and kwargs_to_compute_args -> dict|None
to match the actual returns / documented contract (callers already handle them)
- three type: ignore[arg-type] on nested_dict.get/getitem for an upstream
atomworks annotation bug (param typed dict[tuple,...] but navigated as nested
dict[str,Any]); warn_unused_ignores will flag them if upstream is fixed
No behavior change. All gates green (ruff, mypy 41 files, pytest 27 passed).
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
* refactor(mypy): un-ignore utils/{ddp,rigid,datasets}
Clear the three remaining foundry.utils.* modules off the mypy ignore_errors list (47 errors: ddp 12, rigid 16, datasets 19). Type-honesty and annotation fixes only, no behavior change: narrow DictConfig|dict params to DictConfig where attribute access requires it (item access kept where a plain-dict default is real), honest int|None / Tensor|None widenings, variable renames to avoid type-reuse, str() coercion of DictConfig keys, the file's own if/elif/else narrowing pattern, and documented type: ignore / cast for genuine torch and atomworks stub limitations. Two hard-tier modules remain (callbacks/health_logging, trainers/fabric).
Co-authored-by: lyskov-ai <277346777+lyskov-ai@users.noreply.github.com>
* refactor(mypy): un-ignore callbacks/health_logging
Clear foundry.callbacks.health_logging off the mypy ignore_errors list
by fixing its 23 type errors (annotation / type-honesty only, no
behavior change):
- import the stdlib 'types' module directly instead of relying on
'from typing import types' (worked at runtime but fragile/untyped)
- replace 'callable'-used-as-a-type with Mapping[str, Callable[..., Any]]
on the stat/histogram dict params and Callable[..., bool] | None on the
filter params; annotate the two MappingProxyType default constants to
match
- annotate the _hooks / _temp_cache / _cache instance vars
- make implicit-Optional defaults explicit (... | None) on the two
plot_tensor_* helpers, matching their is-not-None guards
- in plot_tensor_hist, replace two type-changing param reassignments with
equivalent always-set locals (display_values, step_labels)
Only trainers/fabric remains on the ignore list.
Co-authored-by: lyskov-ai <277346777+lyskov-ai@users.noreply.github.com>
* refactor(mypy): un-ignore trainers/fabric (ratchet complete)
Clear foundry.trainers.fabric (the last and largest module) off the
mypy ignore_errors list and remove the now-empty override block. The
ratchet ignore list is now empty: all of src/foundry + src/foundry_cli
type-checks with no per-module exemptions.
Fixes are annotation / type-honesty only, no behavior change:
- annotate self.state as dict[str, Any] (a heterogeneous, dynamically-
keyed training-state bag, also merged with arbitrary checkpoint keys);
this collapses ~69 union-attr/operator/arg-type errors. Also annotate
default_state and declare _current_train_return (set by subclass
training_step implementations).
- dataloader types: Fabric.setup_dataloaders is stub-typed to return
DataLoader | list[DataLoader], so cast its single-loader results to
DataLoader and change train_loop/validation_loop params from
_FabricDataLoader to DataLoader (drop the now-unused import).
- precision: widen the param to str | int | None (the body sets it None
when an XPU plugin takes over), cast to the guarded Literal at the
XPUMixedPrecision call, and add one documented type: ignore[arg-type]
where our public API is wider than Fabric's precision Literal.
- narrow the parameter-freezing guard to direct attribute access; type
get_latest_checkpoint as Path | None (matching its returns) with a
cast at the single caller; drop a stale type: ignore.
Co-authored-by: lyskov-ai <277346777+lyskov-ai@users.noreply.github.com>
* chore(mypy): bring models/rfd3 into scope behind an ignore_errors ratchet
Add models/rfd3/src/rfd3 to [tool.mypy].files so the rfd3 model package
is type-checked by the standard gate (mypy now covers 99 files: foundry +
rfd3). Seed a fresh [[tool.mypy.overrides]] ignore_errors ratchet listing
the 32 rfd3 modules with pre-existing type errors (194 total), mirroring
the original src/foundry bootstrap; the 26 already-clean rfd3 modules are
type-checked immediately. Modules are cleared from the ratchet one slice
at a time in follow-up work.
Config only, no code changes. rfd3 is an editable install, so imports
resolve without an added mypy_path.
Co-authored-by: lyskov-ai <277346777+lyskov-ai@users.noreply.github.com>
* refactor(mypy): clear 8 easy rfd3 modules off the ignore ratchet
First slice of clearing the models/rfd3 mypy ratchet: the 8 modules with
a single error each (32 -> 24 remaining on the ignore_errors list). mypy
now type-checks 34 rfd3 modules.
Annotation / type-honesty only, no behavior change:
- block_utils: -> torch.LongTensor -> torch.Tensor (.long() is stub-typed
Tensor; sibling helpers already return Tensor)
- hbonds_hbplus: corrected calculate_hbonds's stale return annotation to
match the actual (AtomArray, list[dict], int) return
- inference/parsing: malformed pydantic np.ndarray[np.bool_] ->
np.ndarray[Any, np.dtype[np.bool_]]
- chunked_pairwise: assert _sm_cached is not None in the cache fast path
(populated together with the already-narrowed _sl_cached)
- rasa: documented type: ignore[list-item] (atomworks Transform types
requires_previous_transforms as list[str]; class refs are accepted)
- ncaa_transforms / design_metrics / testing_utils: var-annotated dicts
(+ a missing 'from typing import Any')
Co-authored-by: lyskov-ai <277346777+lyskov-ai@users.noreply.github.com>
---------
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
Co-authored-by: Hope Woods <hope.woods@omsf.io>
* refactor(mypy): un-ignore 5 easy-tier modules
Fix each module's single pre-existing type error with a pure annotation
or setattr change (no behavior change) and remove it from the
[[tool.mypy.overrides]] ignore_errors list:
- callbacks/train_logging: loss_trackers: dict[str, MeanMetric]
- callbacks/metrics_logging: seen_examples: set[str]
- common: setattr(wrapper, "_has_run", True) for the @wraps wrapper
- hydra/resolvers: attribute_path: str | None (body already guards)
- inference_engines/base: base_overrides: dict[str, Any]
13 modules remain on the ignore list. mypy now type-checks the 5
newly-included modules cleanly.
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
* refactor(mypy): un-ignore 7 medium-tier modules
Resolve the type errors in and remove from the [[tool.mypy.overrides]]
ignore_errors list. Mostly narrowing / annotation fixes; two deliberate
type-honesty fixes flagged below.
- utils/weights: lowercase `any` -> `Any` in _PatternPolicyMixin (4x);
assert-narrow fallback_policy at the call site (matches get_policy idiom)
- model/layers/blocks: class-level w/b: torch.Tensor for the registered
buffers (avoids nn.Module's Tensor | Module __getattr__ fallback)
- utils/components: is-None narrowing + tip_names local in get_name_mask's
TIP branch (exists() can't narrow for mypy); drop orphaned exists import
- utils/logging: str(field) for the tree key; assign to a new hparams local
rather than reassigning the typed cfg param
- foundry_cli/download_checkpoints: guard on `hasher is not None`;
total_size = 0.0 for the float accumulation
- training/schedulers: SchedulerConfig.scheduler is now a required field
(was = None, but documented required and assumed non-None everywhere)
- utils/xpu/xpu_accelerator: name @property -> @staticmethod to match
lightning's Accelerator ABC
6 hard-tier modules remain on the ignore list.
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
* refactor(mypy): un-ignore metrics/metric module
Fix the 11 type errors in foundry.metrics.metric and remove it from the
[tool.mypy.overrides] ignore_errors list (5 hard-tier modules remain).
- str(name) coercion of DictConfig.items() keys (str|bytes|int|... union)
- exists() -> 'is not None' narrowing; drop orphaned atomworks import
- widen compute_from_kwargs -> dict|list and kwargs_to_compute_args -> dict|None
to match the actual returns / documented contract (callers already handle them)
- three type: ignore[arg-type] on nested_dict.get/getitem for an upstream
atomworks annotation bug (param typed dict[tuple,...] but navigated as nested
dict[str,Any]); warn_unused_ignores will flag them if upstream is fixed
No behavior change. All gates green (ruff, mypy 41 files, pytest 27 passed).
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
* refactor(mypy): un-ignore utils/{ddp,rigid,datasets}
Clear the three remaining foundry.utils.* modules off the mypy ignore_errors list (47 errors: ddp 12, rigid 16, datasets 19). Type-honesty and annotation fixes only, no behavior change: narrow DictConfig|dict params to DictConfig where attribute access requires it (item access kept where a plain-dict default is real), honest int|None / Tensor|None widenings, variable renames to avoid type-reuse, str() coercion of DictConfig keys, the file's own if/elif/else narrowing pattern, and documented type: ignore / cast for genuine torch and atomworks stub limitations. Two hard-tier modules remain (callbacks/health_logging, trainers/fabric).
Co-authored-by: lyskov-ai <277346777+lyskov-ai@users.noreply.github.com>
* refactor(mypy): un-ignore callbacks/health_logging
Clear foundry.callbacks.health_logging off the mypy ignore_errors list
by fixing its 23 type errors (annotation / type-honesty only, no
behavior change):
- import the stdlib 'types' module directly instead of relying on
'from typing import types' (worked at runtime but fragile/untyped)
- replace 'callable'-used-as-a-type with Mapping[str, Callable[..., Any]]
on the stat/histogram dict params and Callable[..., bool] | None on the
filter params; annotate the two MappingProxyType default constants to
match
- annotate the _hooks / _temp_cache / _cache instance vars
- make implicit-Optional defaults explicit (... | None) on the two
plot_tensor_* helpers, matching their is-not-None guards
- in plot_tensor_hist, replace two type-changing param reassignments with
equivalent always-set locals (display_values, step_labels)
Only trainers/fabric remains on the ignore list.
Co-authored-by: lyskov-ai <277346777+lyskov-ai@users.noreply.github.com>
* refactor(mypy): un-ignore trainers/fabric (ratchet complete)
Clear foundry.trainers.fabric (the last and largest module) off the
mypy ignore_errors list and remove the now-empty override block. The
ratchet ignore list is now empty: all of src/foundry + src/foundry_cli
type-checks with no per-module exemptions.
Fixes are annotation / type-honesty only, no behavior change:
- annotate self.state as dict[str, Any] (a heterogeneous, dynamically-
keyed training-state bag, also merged with arbitrary checkpoint keys);
this collapses ~69 union-attr/operator/arg-type errors. Also annotate
default_state and declare _current_train_return (set by subclass
training_step implementations).
- dataloader types: Fabric.setup_dataloaders is stub-typed to return
DataLoader | list[DataLoader], so cast its single-loader results to
DataLoader and change train_loop/validation_loop params from
_FabricDataLoader to DataLoader (drop the now-unused import).
- precision: widen the param to str | int | None (the body sets it None
when an XPU plugin takes over), cast to the guarded Literal at the
XPUMixedPrecision call, and add one documented type: ignore[arg-type]
where our public API is wider than Fabric's precision Literal.
- narrow the parameter-freezing guard to direct attribute access; type
get_latest_checkpoint as Path | None (matching its returns) with a
cast at the single caller; drop a stale type: ignore.
Co-authored-by: lyskov-ai <277346777+lyskov-ai@users.noreply.github.com>
* chore(mypy): bring models/rfd3 into scope behind an ignore_errors ratchet
Add models/rfd3/src/rfd3 to [tool.mypy].files so the rfd3 model package
is type-checked by the standard gate (mypy now covers 99 files: foundry +
rfd3). Seed a fresh [[tool.mypy.overrides]] ignore_errors ratchet listing
the 32 rfd3 modules with pre-existing type errors (194 total), mirroring
the original src/foundry bootstrap; the 26 already-clean rfd3 modules are
type-checked immediately. Modules are cleared from the ratchet one slice
at a time in follow-up work.
Config only, no code changes. rfd3 is an editable install, so imports
resolve without an added mypy_path.
Co-authored-by: lyskov-ai <277346777+lyskov-ai@users.noreply.github.com>
---------
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
Co-authored-by: Hope Woods <hope.woods@omsf.io>
* refactor(mypy): un-ignore 5 easy-tier modules
Fix each module's single pre-existing type error with a pure annotation
or setattr change (no behavior change) and remove it from the
[[tool.mypy.overrides]] ignore_errors list:
- callbacks/train_logging: loss_trackers: dict[str, MeanMetric]
- callbacks/metrics_logging: seen_examples: set[str]
- common: setattr(wrapper, "_has_run", True) for the @wraps wrapper
- hydra/resolvers: attribute_path: str | None (body already guards)
- inference_engines/base: base_overrides: dict[str, Any]
13 modules remain on the ignore list. mypy now type-checks the 5
newly-included modules cleanly.
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
* refactor(mypy): un-ignore 7 medium-tier modules
Resolve the type errors in and remove from the [[tool.mypy.overrides]]
ignore_errors list. Mostly narrowing / annotation fixes; two deliberate
type-honesty fixes flagged below.
- utils/weights: lowercase `any` -> `Any` in _PatternPolicyMixin (4x);
assert-narrow fallback_policy at the call site (matches get_policy idiom)
- model/layers/blocks: class-level w/b: torch.Tensor for the registered
buffers (avoids nn.Module's Tensor | Module __getattr__ fallback)
- utils/components: is-None narrowing + tip_names local in get_name_mask's
TIP branch (exists() can't narrow for mypy); drop orphaned exists import
- utils/logging: str(field) for the tree key; assign to a new hparams local
rather than reassigning the typed cfg param
- foundry_cli/download_checkpoints: guard on `hasher is not None`;
total_size = 0.0 for the float accumulation
- training/schedulers: SchedulerConfig.scheduler is now a required field
(was = None, but documented required and assumed non-None everywhere)
- utils/xpu/xpu_accelerator: name @property -> @staticmethod to match
lightning's Accelerator ABC
6 hard-tier modules remain on the ignore list.
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
* refactor(mypy): un-ignore metrics/metric module
Fix the 11 type errors in foundry.metrics.metric and remove it from the
[tool.mypy.overrides] ignore_errors list (5 hard-tier modules remain).
- str(name) coercion of DictConfig.items() keys (str|bytes|int|... union)
- exists() -> 'is not None' narrowing; drop orphaned atomworks import
- widen compute_from_kwargs -> dict|list and kwargs_to_compute_args -> dict|None
to match the actual returns / documented contract (callers already handle them)
- three type: ignore[arg-type] on nested_dict.get/getitem for an upstream
atomworks annotation bug (param typed dict[tuple,...] but navigated as nested
dict[str,Any]); warn_unused_ignores will flag them if upstream is fixed
No behavior change. All gates green (ruff, mypy 41 files, pytest 27 passed).
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
* refactor(mypy): un-ignore utils/{ddp,rigid,datasets}
Clear the three remaining foundry.utils.* modules off the mypy ignore_errors list (47 errors: ddp 12, rigid 16, datasets 19). Type-honesty and annotation fixes only, no behavior change: narrow DictConfig|dict params to DictConfig where attribute access requires it (item access kept where a plain-dict default is real), honest int|None / Tensor|None widenings, variable renames to avoid type-reuse, str() coercion of DictConfig keys, the file's own if/elif/else narrowing pattern, and documented type: ignore / cast for genuine torch and atomworks stub limitations. Two hard-tier modules remain (callbacks/health_logging, trainers/fabric).
Co-authored-by: lyskov-ai <277346777+lyskov-ai@users.noreply.github.com>
* refactor(mypy): un-ignore callbacks/health_logging
Clear foundry.callbacks.health_logging off the mypy ignore_errors list
by fixing its 23 type errors (annotation / type-honesty only, no
behavior change):
- import the stdlib 'types' module directly instead of relying on
'from typing import types' (worked at runtime but fragile/untyped)
- replace 'callable'-used-as-a-type with Mapping[str, Callable[..., Any]]
on the stat/histogram dict params and Callable[..., bool] | None on the
filter params; annotate the two MappingProxyType default constants to
match
- annotate the _hooks / _temp_cache / _cache instance vars
- make implicit-Optional defaults explicit (... | None) on the two
plot_tensor_* helpers, matching their is-not-None guards
- in plot_tensor_hist, replace two type-changing param reassignments with
equivalent always-set locals (display_values, step_labels)
Only trainers/fabric remains on the ignore list.
Co-authored-by: lyskov-ai <277346777+lyskov-ai@users.noreply.github.com>
* refactor(mypy): un-ignore trainers/fabric (ratchet complete)
Clear foundry.trainers.fabric (the last and largest module) off the
mypy ignore_errors list and remove the now-empty override block. The
ratchet ignore list is now empty: all of src/foundry + src/foundry_cli
type-checks with no per-module exemptions.
Fixes are annotation / type-honesty only, no behavior change:
- annotate self.state as dict[str, Any] (a heterogeneous, dynamically-
keyed training-state bag, also merged with arbitrary checkpoint keys);
this collapses ~69 union-attr/operator/arg-type errors. Also annotate
default_state and declare _current_train_return (set by subclass
training_step implementations).
- dataloader types: Fabric.setup_dataloaders is stub-typed to return
DataLoader | list[DataLoader], so cast its single-loader results to
DataLoader and change train_loop/validation_loop params from
_FabricDataLoader to DataLoader (drop the now-unused import).
- precision: widen the param to str | int | None (the body sets it None
when an XPU plugin takes over), cast to the guarded Literal at the
XPUMixedPrecision call, and add one documented type: ignore[arg-type]
where our public API is wider than Fabric's precision Literal.
- narrow the parameter-freezing guard to direct attribute access; type
get_latest_checkpoint as Path | None (matching its returns) with a
cast at the single caller; drop a stale type: ignore.
Co-authored-by: lyskov-ai <277346777+lyskov-ai@users.noreply.github.com>
---------
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
Co-authored-by: Hope Woods <hope.woods@omsf.io>
* refactor(mypy): un-ignore 5 easy-tier modules
Fix each module's single pre-existing type error with a pure annotation
or setattr change (no behavior change) and remove it from the
[[tool.mypy.overrides]] ignore_errors list:
- callbacks/train_logging: loss_trackers: dict[str, MeanMetric]
- callbacks/metrics_logging: seen_examples: set[str]
- common: setattr(wrapper, "_has_run", True) for the @wraps wrapper
- hydra/resolvers: attribute_path: str | None (body already guards)
- inference_engines/base: base_overrides: dict[str, Any]
13 modules remain on the ignore list. mypy now type-checks the 5
newly-included modules cleanly.
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
* refactor(mypy): un-ignore 7 medium-tier modules
Resolve the type errors in and remove from the [[tool.mypy.overrides]]
ignore_errors list. Mostly narrowing / annotation fixes; two deliberate
type-honesty fixes flagged below.
- utils/weights: lowercase `any` -> `Any` in _PatternPolicyMixin (4x);
assert-narrow fallback_policy at the call site (matches get_policy idiom)
- model/layers/blocks: class-level w/b: torch.Tensor for the registered
buffers (avoids nn.Module's Tensor | Module __getattr__ fallback)
- utils/components: is-None narrowing + tip_names local in get_name_mask's
TIP branch (exists() can't narrow for mypy); drop orphaned exists import
- utils/logging: str(field) for the tree key; assign to a new hparams local
rather than reassigning the typed cfg param
- foundry_cli/download_checkpoints: guard on `hasher is not None`;
total_size = 0.0 for the float accumulation
- training/schedulers: SchedulerConfig.scheduler is now a required field
(was = None, but documented required and assumed non-None everywhere)
- utils/xpu/xpu_accelerator: name @property -> @staticmethod to match
lightning's Accelerator ABC
6 hard-tier modules remain on the ignore list.
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
* refactor(mypy): un-ignore metrics/metric module
Fix the 11 type errors in foundry.metrics.metric and remove it from the
[tool.mypy.overrides] ignore_errors list (5 hard-tier modules remain).
- str(name) coercion of DictConfig.items() keys (str|bytes|int|... union)
- exists() -> 'is not None' narrowing; drop orphaned atomworks import
- widen compute_from_kwargs -> dict|list and kwargs_to_compute_args -> dict|None
to match the actual returns / documented contract (callers already handle them)
- three type: ignore[arg-type] on nested_dict.get/getitem for an upstream
atomworks annotation bug (param typed dict[tuple,...] but navigated as nested
dict[str,Any]); warn_unused_ignores will flag them if upstream is fixed
No behavior change. All gates green (ruff, mypy 41 files, pytest 27 passed).
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
* refactor(mypy): un-ignore utils/{ddp,rigid,datasets}
Clear the three remaining foundry.utils.* modules off the mypy ignore_errors list (47 errors: ddp 12, rigid 16, datasets 19). Type-honesty and annotation fixes only, no behavior change: narrow DictConfig|dict params to DictConfig where attribute access requires it (item access kept where a plain-dict default is real), honest int|None / Tensor|None widenings, variable renames to avoid type-reuse, str() coercion of DictConfig keys, the file's own if/elif/else narrowing pattern, and documented type: ignore / cast for genuine torch and atomworks stub limitations. Two hard-tier modules remain (callbacks/health_logging, trainers/fabric).
Co-authored-by: lyskov-ai <277346777+lyskov-ai@users.noreply.github.com>
* refactor(mypy): un-ignore callbacks/health_logging
Clear foundry.callbacks.health_logging off the mypy ignore_errors list
by fixing its 23 type errors (annotation / type-honesty only, no
behavior change):
- import the stdlib 'types' module directly instead of relying on
'from typing import types' (worked at runtime but fragile/untyped)
- replace 'callable'-used-as-a-type with Mapping[str, Callable[..., Any]]
on the stat/histogram dict params and Callable[..., bool] | None on the
filter params; annotate the two MappingProxyType default constants to
match
- annotate the _hooks / _temp_cache / _cache instance vars
- make implicit-Optional defaults explicit (... | None) on the two
plot_tensor_* helpers, matching their is-not-None guards
- in plot_tensor_hist, replace two type-changing param reassignments with
equivalent always-set locals (display_values, step_labels)
Only trainers/fabric remains on the ignore list.
Co-authored-by: lyskov-ai <277346777+lyskov-ai@users.noreply.github.com>
---------
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
Co-authored-by: Hope Woods <hope.woods@omsf.io>
* refactor(mypy): un-ignore 5 easy-tier modules
Fix each module's single pre-existing type error with a pure annotation
or setattr change (no behavior change) and remove it from the
[[tool.mypy.overrides]] ignore_errors list:
- callbacks/train_logging: loss_trackers: dict[str, MeanMetric]
- callbacks/metrics_logging: seen_examples: set[str]
- common: setattr(wrapper, "_has_run", True) for the @wraps wrapper
- hydra/resolvers: attribute_path: str | None (body already guards)
- inference_engines/base: base_overrides: dict[str, Any]
13 modules remain on the ignore list. mypy now type-checks the 5
newly-included modules cleanly.
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
* refactor(mypy): un-ignore 7 medium-tier modules
Resolve the type errors in and remove from the [[tool.mypy.overrides]]
ignore_errors list. Mostly narrowing / annotation fixes; two deliberate
type-honesty fixes flagged below.
- utils/weights: lowercase `any` -> `Any` in _PatternPolicyMixin (4x);
assert-narrow fallback_policy at the call site (matches get_policy idiom)
- model/layers/blocks: class-level w/b: torch.Tensor for the registered
buffers (avoids nn.Module's Tensor | Module __getattr__ fallback)
- utils/components: is-None narrowing + tip_names local in get_name_mask's
TIP branch (exists() can't narrow for mypy); drop orphaned exists import
- utils/logging: str(field) for the tree key; assign to a new hparams local
rather than reassigning the typed cfg param
- foundry_cli/download_checkpoints: guard on `hasher is not None`;
total_size = 0.0 for the float accumulation
- training/schedulers: SchedulerConfig.scheduler is now a required field
(was = None, but documented required and assumed non-None everywhere)
- utils/xpu/xpu_accelerator: name @property -> @staticmethod to match
lightning's Accelerator ABC
6 hard-tier modules remain on the ignore list.
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
* refactor(mypy): un-ignore metrics/metric module
Fix the 11 type errors in foundry.metrics.metric and remove it from the
[tool.mypy.overrides] ignore_errors list (5 hard-tier modules remain).
- str(name) coercion of DictConfig.items() keys (str|bytes|int|... union)
- exists() -> 'is not None' narrowing; drop orphaned atomworks import
- widen compute_from_kwargs -> dict|list and kwargs_to_compute_args -> dict|None
to match the actual returns / documented contract (callers already handle them)
- three type: ignore[arg-type] on nested_dict.get/getitem for an upstream
atomworks annotation bug (param typed dict[tuple,...] but navigated as nested
dict[str,Any]); warn_unused_ignores will flag them if upstream is fixed
No behavior change. All gates green (ruff, mypy 41 files, pytest 27 passed).
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
* refactor(mypy): un-ignore utils/{ddp,rigid,datasets}
Clear the three remaining foundry.utils.* modules off the mypy ignore_errors list (47 errors: ddp 12, rigid 16, datasets 19). Type-honesty and annotation fixes only, no behavior change: narrow DictConfig|dict params to DictConfig where attribute access requires it (item access kept where a plain-dict default is real), honest int|None / Tensor|None widenings, variable renames to avoid type-reuse, str() coercion of DictConfig keys, the file's own if/elif/else narrowing pattern, and documented type: ignore / cast for genuine torch and atomworks stub limitations. Two hard-tier modules remain (callbacks/health_logging, trainers/fabric).
Co-authored-by: lyskov-ai <277346777+lyskov-ai@users.noreply.github.com>
---------
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
Co-authored-by: Hope Woods <hope.woods@omsf.io>
* refactor(mypy): un-ignore 5 easy-tier modules
Fix each module's single pre-existing type error with a pure annotation
or setattr change (no behavior change) and remove it from the
[[tool.mypy.overrides]] ignore_errors list:
- callbacks/train_logging: loss_trackers: dict[str, MeanMetric]
- callbacks/metrics_logging: seen_examples: set[str]
- common: setattr(wrapper, "_has_run", True) for the @wraps wrapper
- hydra/resolvers: attribute_path: str | None (body already guards)
- inference_engines/base: base_overrides: dict[str, Any]
13 modules remain on the ignore list. mypy now type-checks the 5
newly-included modules cleanly.
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
* refactor(mypy): un-ignore 7 medium-tier modules
Resolve the type errors in and remove from the [[tool.mypy.overrides]]
ignore_errors list. Mostly narrowing / annotation fixes; two deliberate
type-honesty fixes flagged below.
- utils/weights: lowercase `any` -> `Any` in _PatternPolicyMixin (4x);
assert-narrow fallback_policy at the call site (matches get_policy idiom)
- model/layers/blocks: class-level w/b: torch.Tensor for the registered
buffers (avoids nn.Module's Tensor | Module __getattr__ fallback)
- utils/components: is-None narrowing + tip_names local in get_name_mask's
TIP branch (exists() can't narrow for mypy); drop orphaned exists import
- utils/logging: str(field) for the tree key; assign to a new hparams local
rather than reassigning the typed cfg param
- foundry_cli/download_checkpoints: guard on `hasher is not None`;
total_size = 0.0 for the float accumulation
- training/schedulers: SchedulerConfig.scheduler is now a required field
(was = None, but documented required and assumed non-None everywhere)
- utils/xpu/xpu_accelerator: name @property -> @staticmethod to match
lightning's Accelerator ABC
6 hard-tier modules remain on the ignore list.
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
* refactor(mypy): un-ignore metrics/metric module
Fix the 11 type errors in foundry.metrics.metric and remove it from the
[tool.mypy.overrides] ignore_errors list (5 hard-tier modules remain).
- str(name) coercion of DictConfig.items() keys (str|bytes|int|... union)
- exists() -> 'is not None' narrowing; drop orphaned atomworks import
- widen compute_from_kwargs -> dict|list and kwargs_to_compute_args -> dict|None
to match the actual returns / documented contract (callers already handle them)
- three type: ignore[arg-type] on nested_dict.get/getitem for an upstream
atomworks annotation bug (param typed dict[tuple,...] but navigated as nested
dict[str,Any]); warn_unused_ignores will flag them if upstream is fixed
No behavior change. All gates green (ruff, mypy 41 files, pytest 27 passed).
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
---------
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
Co-authored-by: Hope Woods <hope.woods@omsf.io>
* refactor(mypy): un-ignore 5 easy-tier modules
Fix each module's single pre-existing type error with a pure annotation
or setattr change (no behavior change) and remove it from the
[[tool.mypy.overrides]] ignore_errors list:
- callbacks/train_logging: loss_trackers: dict[str, MeanMetric]
- callbacks/metrics_logging: seen_examples: set[str]
- common: setattr(wrapper, "_has_run", True) for the @wraps wrapper
- hydra/resolvers: attribute_path: str | None (body already guards)
- inference_engines/base: base_overrides: dict[str, Any]
13 modules remain on the ignore list. mypy now type-checks the 5
newly-included modules cleanly.
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
* refactor(mypy): un-ignore 7 medium-tier modules
Resolve the type errors in and remove from the [[tool.mypy.overrides]]
ignore_errors list. Mostly narrowing / annotation fixes; two deliberate
type-honesty fixes flagged below.
- utils/weights: lowercase `any` -> `Any` in _PatternPolicyMixin (4x);
assert-narrow fallback_policy at the call site (matches get_policy idiom)
- model/layers/blocks: class-level w/b: torch.Tensor for the registered
buffers (avoids nn.Module's Tensor | Module __getattr__ fallback)
- utils/components: is-None narrowing + tip_names local in get_name_mask's
TIP branch (exists() can't narrow for mypy); drop orphaned exists import
- utils/logging: str(field) for the tree key; assign to a new hparams local
rather than reassigning the typed cfg param
- foundry_cli/download_checkpoints: guard on `hasher is not None`;
total_size = 0.0 for the float accumulation
- training/schedulers: SchedulerConfig.scheduler is now a required field
(was = None, but documented required and assumed non-None everywhere)
- utils/xpu/xpu_accelerator: name @property -> @staticmethod to match
lightning's Accelerator ABC
6 hard-tier modules remain on the ignore list.
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
---------
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
* test: bootstrap mypy + pytest + coverage CI gates
Wire up the tooling the upcoming test/annotation/refactor work depends on:
- Add mypy>=1.13 to [dev] and a lenient [tool.mypy] config scoped to
src/foundry + src/foundry_cli (ignore_missing_imports, no
disallow_untyped_defs). The 14 modules with pre-existing type errors
are pinned via [[tool.mypy.overrides]] ignore_errors=true and listed
as the ratchet target — fix and remove, never add.
- Add [tool.pytest.ini_options] (testpaths=["tests"], --strict-markers
--strict-config) and [tool.coverage.*] (source = src/foundry +
src/foundry_cli, branch = true) for opt-in gap finding.
- Add .github/workflows/test.yaml with mypy and pytest jobs running on
the same triggers as lint_production.yaml. Top-level tests/ only;
per-model tests under models/*/tests/ may require GPU and checkpoints
and stay out of CI for now.
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
* test(mypy): extend ignore list with 4 modules CI surfaced
Local sanity-check ran mypy without foundry installed, so torch /
lightning resolved to `Any` and errors that depend on knowing those
types stayed invisible. First CI run installed the full deps and
surfaced 6 errors in 4 additional modules:
foundry.model.layers.blocks
foundry.training.schedulers
foundry.utils.logging
foundry.utils.xpu.xpu_accelerator
Same ratchet contract as the original 14: do not add, only remove
(after fixing the errors and removing `ignore_errors = true`).
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
* style: ruff format 2 pre-existing files unrelated to bootstrap
These files have been failing `ruff format --check` on production HEAD
(merged via #275 and #281 without a pre-commit run). They block the
existing `lint_production` workflow on every PR, including this
bootstrap. Strictly out of scope for 0001 — kept in a separate commit
so it can be cherry-picked or reverted cleanly.
models/rfd3/src/rfd3/inference/input_parsing.py
models/rfd3/tests/test_partial_diffusion.py
No semantic changes — `ruff format` output only.
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
* ci: run test workflow on all pull requests
Drop the base-branch filter on the pull_request trigger so PRs targeting
stacked task branches are gated too, not only PRs into the mainline branches.
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
* test: unit tests for foundry geometry utils (alignment, rotation augmentation)
Pin the numeric behaviour of weighted_rigid_align/get_rmsd and the
rotation/centre/augment helpers used across the diffusion models:
exact recovery of known rigid transforms, mask/weight exclusion from
the fit, proper-rotation invariants, global-centroid centring, and
distance-preserving augmentation. CPU-only, float32, 18 tests.
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
* fix: make weighted_rigid_align dtype-agnostic (accept float64)
The determinant-correction matrix F was built with torch.eye's default
dtype (float32), so float64 coordinate inputs raised at U @ F @ V. Pass
dtype=X_L.dtype so F follows the input. Add a float64 regression test.
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
* Add test for float64 coords with float32 weights
Add test for float64 coordinates with float32 weights to ensure correct output dtype and alignment.
* Add additional blank line before functions
Fix formatting by adding blank line before functions in test_alignment
---------
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
Co-authored-by: Hope Woods <hope.woods@omsf.io>
* test: bootstrap mypy + pytest + coverage CI gates
Wire up the tooling the upcoming test/annotation/refactor work depends on:
- Add mypy>=1.13 to [dev] and a lenient [tool.mypy] config scoped to
src/foundry + src/foundry_cli (ignore_missing_imports, no
disallow_untyped_defs). The 14 modules with pre-existing type errors
are pinned via [[tool.mypy.overrides]] ignore_errors=true and listed
as the ratchet target — fix and remove, never add.
- Add [tool.pytest.ini_options] (testpaths=["tests"], --strict-markers
--strict-config) and [tool.coverage.*] (source = src/foundry +
src/foundry_cli, branch = true) for opt-in gap finding.
- Add .github/workflows/test.yaml with mypy and pytest jobs running on
the same triggers as lint_production.yaml. Top-level tests/ only;
per-model tests under models/*/tests/ may require GPU and checkpoints
and stay out of CI for now.
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
* test(mypy): extend ignore list with 4 modules CI surfaced
Local sanity-check ran mypy without foundry installed, so torch /
lightning resolved to `Any` and errors that depend on knowing those
types stayed invisible. First CI run installed the full deps and
surfaced 6 errors in 4 additional modules:
foundry.model.layers.blocks
foundry.training.schedulers
foundry.utils.logging
foundry.utils.xpu.xpu_accelerator
Same ratchet contract as the original 14: do not add, only remove
(after fixing the errors and removing `ignore_errors = true`).
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
* style: ruff format 2 pre-existing files unrelated to bootstrap
These files have been failing `ruff format --check` on production HEAD
(merged via #275 and #281 without a pre-commit run). They block the
existing `lint_production` workflow on every PR, including this
bootstrap. Strictly out of scope for 0001 — kept in a separate commit
so it can be cherry-picked or reverted cleanly.
models/rfd3/src/rfd3/inference/input_parsing.py
models/rfd3/tests/test_partial_diffusion.py
No semantic changes — `ruff format` output only.
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
* ci: run test workflow on all pull requests
Drop the base-branch filter on the pull_request trigger so PRs targeting
stacked task branches are gated too, not only PRs into the mainline branches.
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
* test: unit tests for foundry geometry utils (alignment, rotation augmentation)
Pin the numeric behaviour of weighted_rigid_align/get_rmsd and the
rotation/centre/augment helpers used across the diffusion models:
exact recovery of known rigid transforms, mask/weight exclusion from
the fit, proper-rotation invariants, global-centroid centring, and
distance-preserving augmentation. CPU-only, float32, 18 tests.
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
---------
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
Co-authored-by: Hope Woods <hope.woods@omsf.io>
* test: bootstrap mypy + pytest + coverage CI gates
Wire up the tooling the upcoming test/annotation/refactor work depends on:
- Add mypy>=1.13 to [dev] and a lenient [tool.mypy] config scoped to
src/foundry + src/foundry_cli (ignore_missing_imports, no
disallow_untyped_defs). The 14 modules with pre-existing type errors
are pinned via [[tool.mypy.overrides]] ignore_errors=true and listed
as the ratchet target — fix and remove, never add.
- Add [tool.pytest.ini_options] (testpaths=["tests"], --strict-markers
--strict-config) and [tool.coverage.*] (source = src/foundry +
src/foundry_cli, branch = true) for opt-in gap finding.
- Add .github/workflows/test.yaml with mypy and pytest jobs running on
the same triggers as lint_production.yaml. Top-level tests/ only;
per-model tests under models/*/tests/ may require GPU and checkpoints
and stay out of CI for now.
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
* test(mypy): extend ignore list with 4 modules CI surfaced
Local sanity-check ran mypy without foundry installed, so torch /
lightning resolved to `Any` and errors that depend on knowing those
types stayed invisible. First CI run installed the full deps and
surfaced 6 errors in 4 additional modules:
foundry.model.layers.blocks
foundry.training.schedulers
foundry.utils.logging
foundry.utils.xpu.xpu_accelerator
Same ratchet contract as the original 14: do not add, only remove
(after fixing the errors and removing `ignore_errors = true`).
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
* style: ruff format 2 pre-existing files unrelated to bootstrap
These files have been failing `ruff format --check` on production HEAD
(merged via #275 and #281 without a pre-commit run). They block the
existing `lint_production` workflow on every PR, including this
bootstrap. Strictly out of scope for 0001 — kept in a separate commit
so it can be cherry-picked or reverted cleanly.
models/rfd3/src/rfd3/inference/input_parsing.py
models/rfd3/tests/test_partial_diffusion.py
No semantic changes — `ruff format` output only.
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
* ci: run test workflow on all pull requests
Drop the base-branch filter on the pull_request trigger so PRs targeting
stacked task branches are gated too, not only PRs into the mainline branches.
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
* Update test.yaml to remove pull_request_target
Removed pull_request_target event from workflow.
---------
Co-authored-by: Sergey Lyskov <sergey.lyskov@jhu.edu>
Co-authored-by: Sergey Lyskov <3302736+lyskov@users.noreply.github.com>
fix(rfd3): respect ori_token and center on diffused-region COM in partial diffusion
`_set_origin` for partial diffusion previously hard-coded `ori_token=None`
and `infer_ori_strategy="com"`, with two consequences:
1. The user-supplied `ori_token` (and `infer_ori_strategy`) was silently
dropped. Documented behavior is that the diffused-region COM ends up
within ~5 A of the user's ORI token, but in partial diffusion mode any
value passed by the caller had no effect on the output coordinates.
2. The default centering used the COM of the entire input (motif +
diffused region) instead of the diffused-region COM. The training
pipeline uses `center_option=diffuse` (see
`configs/datasets/design_base.yaml`), so the model expects the
diffused region's COM at the origin. Joint-COM centering puts the
diffused region far from origin in a frame the model never saw at
training, which biases denoising to drag the diffused region toward
the motif COM. On asymmetric systems (large target, small binder),
the binder visibly drifts toward the target with increasing
`partial_t` -- consistent with the "binder winds around target"
reports.
This change updates partial-diffusion centering to:
1. Skip centering for symmetric structures (unchanged).
2. Honor user-supplied `ori_token` / `infer_ori_strategy` if provided.
3. Otherwise center on the diffused-region COM (matches training).
Empirical verification on a CD3E binder showed the inward pull at
partial_t=15 dropped from -4.46 A (joint-COM centering) to -0.46 A
(diffused-COM centering). On a thelma enzyme run, supplying
`ori_token=[50,0,0]` now shifts the output frame by -50 A in x as
expected (was 0 A before), while fixed-atom RMSD stays at machine
precision (~0.02 A Kabsch).
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix: correct bug when inferring ori from hotspots that occurs when the original hotspot COM is near (0,0,0)
* fix:rafi hotspot fix for inference.py for rfd3na
---------
Co-authored-by: Rafi Brent <rafi.brent@gmail.com>
Co-authored-by: Raktim Mitra <timkartar7879@gmail.com>
* Adding the RFD3 installation guide from the Tutorial Hackathon
* Update RFdiffusion3_installation_tutorial.md
Edits based on communications with the original author (Florian) along with minor corrections and formatting changes.
* Adding Google Analytics to the Foundry documentation
The analytics are under Rachel Clune's OSMF account and will only be used for reporting to the Rosetta Commons Board
* Add simple analytics tracking to the foundry docs
Simple analytics does not collect any personal information.
The page view information will only be used for reporting to the Rosetta board and prioritizing future work.
* Improve PTM bond handling in RFdiffusion3 input parsing
Replace the old _restore_bonds_for_nonstandard_residues approach with a
more robust bond restoration system that properly handles unindexed
components, backbone-like bonds for non-standard residues (PTMs), and
cross-residue bond preservation from source structures. Adds the legacy
counterpart and regression tests for both code paths.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Apply ruff formatting to PTM bond handling files
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Remove is_motif_atom guards from legacy input parsing
The bare is_motif_atom annotation is being abolished; remove the
guards that were adding it when missing.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Gate bond restoration behind nonstandard-residue check
Only run _restore_component_bonds, _add_backbone_bonds_for_nonstandard_residues,
and _sort_bonds when the source structure actually has backbone connections
to nonstandard residues.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix ligand res_id offset to match AF3 output convention
RFD3 was offsetting ligand res_id values from the protein max, causing
(chain_id, res_id, atom_name) pairing to fail against AF3 predictions
which always start ligand res_id at 1. Replace the offset with dense
rank-based per-chain renumbering (1, 2, ...) and add a chain A
validation with an override option (allow_ligand_on_chain_a).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Generalize chain validation to all existing chains
Rename allow_ligand_on_chain_a → allow_ligand_on_existing_chain and
check against all chains already present in the built atom array,
not just chain A.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Error on multiple ligands per chain; preserve gaps in override mode
When allow_ligand_on_existing_chain is False, raise an error if
multiple ligand residues share the same chain. Reset res_id min to 1
per chain, preserving relative gaps when ligands share a chain
(override mode).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Use legacy res_id offset when allow_ligand_on_existing_chain is True
The override path now matches the old behaviour (offset from protein
max res_id). The default path (separate chains) sets each ligand
chain's res_id to 1.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Note in errors that override restores old behaviour
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
I created a contribution guide for foundry that is meant to live both in the main directory and in the external documentation. Since this file lives outside of the `docs` folder but I still wanted it in the external documentation, the `contributing_link.rst` file is necessary. The content in the guide is based on the Atomworks contribution guide and some of the information provided in the Foundry README. Since this is mean to be rendered both on GitHub and Sphinx, I had to suppress Sphinx's `xref_missing` warnings because while these references are hidden in the Sphinx-built docs, they are visible in the GitHub rendered docs.
While creating this file I realized that a docs_requirements.txt file needed to be created so that contributors could easily make the necessary docs environment to run Sphinx.
* Expose n_recycle as inference sampler parameter and improve docs
The n_recycle parameter was previously hardcoded in the diffusion module
config and not overridable at inference time. This exposes it through the
inference sampler so users can control recycling iterations via CLI
(e.g. inference_sampler.n_recycle=3). Also adds num_timesteps and
n_recycle to the "Other CLI Options" docs section, and makes the
InputSpecification reference more prominent in the README.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Adds support for running inference on Apple Silicon MPS devices.
Key changes:
- Handle bfloat16 -> float32 fallback on MPS (bfloat16 unsupported)
- Add scatter_mean utility with MPS fallback (index_reduce unsupported)
- Guard masked_scatter_/boolean indexing in block_utils with MPS paths
- Use expand (zero-copy) on CUDA/CPU, repeat (contiguous) on MPS for
torch.where compatibility
- Add .contiguous() calls for scatter/gather ops that require it on MPS
- Replace hardcoded "cuda" in autocast dtype queries with device_of()
- Store torch.linalg.det result before torch.sign to avoid MPS in-place
op issues on autograd graph leaves
- Auto-detect MPS accelerator and enforce float32 precision
- Add MPS installation instructions to README
Based on work by @fnachon in PR #257 with additional fixes:
- expand/repeat if-else to avoid O(L^2) allocation on non-MPS backends
- ruff 0.8.3 formatting to pass CI lint checks
Co-Authored-By: fnachon
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Uploading and editing the first enzyme design tutorial from the Tutorial Hackathon
This tutorial was written by Johannes and Florian and is meant to be an intermediate enzyme design tutorial.
* Updated draft of Intermediate Enzyme Design Tutorial
* Added explanations for the fixed atom and unfixed motif constraints
* Added more detail about the metrics to quickly determine if a design is 'good'
* Adding example input and output files
- Removal of 1mg5.cif and 1mg5_motif.pdb.cif as they are not necessary for the tutorial.
- Creation of an `outputs.zip` that contains example output files for this tutorial
- Edits to the tutorial document to point to these files.
* Updated description of catalytic structure
Updated the description of the catalytic structure to better cite the literature.
* Docs: Installation FAQ space and minor RFD3 docs updates
Installation FAQ: created a document to specify any common installation issues and questions. Should be continuously updated based on logged issues and questions. Not specific to any model.
RFD3:
- changed the checkpoint files specified in the examples to rfd3_latest.ckpt
- updated information in input.md to clarify information based on recent issues that had been submitted
* Docs: Symlinks for RF3 and MPNN docs, RFD3 README minor edits
RF3 and MPNN: folders, index files, and symlinks were created in order to provide space for eventual RF3 and MPNN docs.
Several small changes in the RFD3 README to improve readability and add a pointer to the PPI tutorial as a starting point for someone new to RFdiffusion tools.
* First draft of enzyme design tutorial. Minor typo fixes in other documents.
* First draft of nucleic acid binder tutorial, minor edits to the other tutorials
* Completed enzyme design tutorial, removal of NA binder tutorial from index
Made changes based on edits from Saman, added images, and created zip file containing sample outputs for an enzyme design tutorial.
I am waiting on edits for the NA binder design tutorial, so for now I have removed it from the documentation index.
* First drafts of content for NA binder design tutorial
This tutorial is being created in collaboration with Raktim Mitra.
* Adding images to NA binder design tutorial
* Final draft of NA binder tutorial
* Create unfix.zip
* Updated images for na binder tutorial
* fix: restore exact python version constraint (==3.12)
Commit 49187c3 unintentionally reverted requires-python from ==3.12
back to >=3.12 as a side-effect of the inference fix. This restores
the exact version constraint originally introduced in 8aeacba.
* fix: relax python version constraint to allow 3.12.x
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* RF3 README update and moving RF3 examples
I updated the RF3 README for installation instructions that matched the RFD3 installation instructions. For the first example, I improve the instructions for running and fixed the output file descriptions to match what is now output by running the example. I commented out the 'Templating a Small Molecule' section because many of the files in that section were not present in the repository. The rest of the changes were mostly typo fixes.
I moved the examples from `foundry/docs/releases` to `foundry/models/rf3/docs` to match the organization of RFD3. The changes made to the JSON files just reflect this change of location.
* Changed paths in example JSON files to point to new RF3 examples location
* Updated the landing page for the RF3 documentation so that it links out to the README
* Docs: Installation FAQ space and minor RFD3 docs updates
Installation FAQ: created a document to specify any common installation issues and questions. Should be continuously updated based on logged issues and questions. Not specific to any model.
RFD3:
- changed the checkpoint files specified in the examples to rfd3_latest.ckpt
- updated information in input.md to clarify information based on recent issues that had been submitted
* Docs: Symlinks for RF3 and MPNN docs, RFD3 README minor edits
RF3 and MPNN: folders, index files, and symlinks were created in order to provide space for eventual RF3 and MPNN docs.
Several small changes in the RFD3 README to improve readability and add a pointer to the PPI tutorial as a starting point for someone new to RFdiffusion tools.
* First draft of enzyme design tutorial. Minor typo fixes in other documents.
* First draft of nucleic acid binder tutorial, minor edits to the other tutorials
* Completed enzyme design tutorial, removal of NA binder tutorial from index
Made changes based on edits from Saman, added images, and created zip file containing sample outputs for an enzyme design tutorial.
I am waiting on edits for the NA binder design tutorial, so for now I have removed it from the documentation index.
* Removing file related to in-progress NA binder tutorial
* Removing file related to in-progress NA binder tutorial
* Final version of the enzyme design tutorial
Made small edits, created example files.
* Resolving merge conflicts
* Docs: Installation FAQ space and minor RFD3 docs updates
Installation FAQ: created a document to specify any common installation issues and questions. Should be continuously updated based on logged issues and questions. Not specific to any model.
RFD3:
- changed the checkpoint files specified in the examples to rfd3_latest.ckpt
- updated information in input.md to clarify information based on recent issues that had been submitted
* Docs: Symlinks for RF3 and MPNN docs, RFD3 README minor edits
RF3 and MPNN: folders, index files, and symlinks were created in order to provide space for eventual RF3 and MPNN docs.
Several small changes in the RFD3 README to improve readability and add a pointer to the PPI tutorial as a starting point for someone new to RFdiffusion tools.
* First draft of enzyme design tutorial. Minor typo fixes in other documents.
* First draft of nucleic acid binder tutorial, minor edits to the other tutorials
* Completed enzyme design tutorial, removal of NA binder tutorial from index
Made changes based on edits from Saman, added images, and created zip file containing sample outputs for an enzyme design tutorial.
I am waiting on edits for the NA binder design tutorial, so for now I have removed it from the documentation index.
* Removing file related to in-progress NA binder tutorial
* Removing file related to in-progress NA binder tutorial
* Update ppi_design_tutorial.md
- Added information about useful CLI arguments
- Cleaned up the introduction
- Added section for what one might do with the designs from RFD3
- Added a note about hotspot residues also being in the `contig` (information from Rafi's TTT talk)
- Fixed minor sphinx heading issue
* Reorganizing RFD3 documentation
Reorganized files into an `examples` and a `tutorials` folders to clean up the RFD3 docs folder and align its organization with the RF3 docs folder. Any edits made in the files are related to changing the paths to reflect these changes.
* Docs: Designability vs. Diversity document
Created a document describing the settings that can impact the designability and diversity of structures output by RFdiffusion3, the information is based on the talk Rafi gave at Tech Tea Time in January.
* Minor grammar fixes in designability vs diversity document
* Update models/rfd3/docs/tutorials/ppi_design_tutorial.md
Co-authored-by: Rafael Brent <105883594+RafiBrent@users.noreply.github.com>
* Update models/rfd3/docs/tutorials/enzyme_design_tutorial.md
Co-authored-by: Rafael Brent <105883594+RafiBrent@users.noreply.github.com>
* Update models/rfd3/docs/designability_vs_diversity.md
Co-authored-by: Rafael Brent <105883594+RafiBrent@users.noreply.github.com>
* Update models/rfd3/docs/designability_vs_diversity.md
Co-authored-by: Rafael Brent <105883594+RafiBrent@users.noreply.github.com>
---------
Co-authored-by: Jasper Butcher <66851659+Ubiquinone-dot@users.noreply.github.com>
Co-authored-by: Rafael Brent <105883594+RafiBrent@users.noreply.github.com>
* Create Issue Templates
Created templates for bug reports, feature requests, and usage questions. The main goal is to encourage users to provide files and details required to understand their problem/request/question so that minimal back and forth needs to occur before a solution is reached.
* Revise issue template for clarity and detail
Updated issue template to include a request for images of expected behavior and streamlined the reproduction steps section.
* Upload Dockerfile to examples
* Update Foundry README with Docker information
- There is an image for Foundry on DockerHub
- Example recipe is in `foundry/examples/docker`
---------
Co-authored-by: Rachel Clune <rachel.clune@omsf.io>
* Docs: Installation FAQ space and minor RFD3 docs updates
Installation FAQ: created a document to specify any common installation issues and questions. Should be continuously updated based on logged issues and questions. Not specific to any model.
RFD3:
- changed the checkpoint files specified in the examples to rfd3_latest.ckpt
- updated information in input.md to clarify information based on recent issues that had been submitted
* Docs: Symlinks for RF3 and MPNN docs, RFD3 README minor edits
RF3 and MPNN: folders, index files, and symlinks were created in order to provide space for eventual RF3 and MPNN docs.
Several small changes in the RFD3 README to improve readability and add a pointer to the PPI tutorial as a starting point for someone new to RFdiffusion tools.