Skip to content

Commit ffa9411

Browse files
Fix symmetry issues (#126)
Addressing #115
1 parent a36d29c commit ffa9411

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

models/rfd3/src/rfd3/engine.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from dataclasses import dataclass, field
66
from os import PathLike
77
from pathlib import Path
8-
from typing import Any, Dict, List, Optional
8+
from typing import Dict, List, Optional
99

1010
import torch
1111
import yaml
@@ -378,7 +378,7 @@ def _canonicalize_inputs(
378378

379379
def _multiply_specifications(
380380
self, inputs: Dict[str, dict | DesignInputSpecification], n_batches=None
381-
) -> Dict[str, Dict[str, Any]]:
381+
) -> Dict[str, dict | DesignInputSpecification]:
382382
# Find existing example IDS in output directory
383383
if exists(self.out_dir):
384384
existing_example_ids = set(

models/rfd3/src/rfd3/utils/inference.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -373,12 +373,13 @@ def ensure_inference_sampler_matches_design_spec(
373373
design_spec: Design specification dictionary
374374
inference_sampler: Inference sampler dictionary
375375
"""
376-
has_symmetry_specification = [
377-
True
378-
if "symmetry" in item.keys() and item.get("symmetry") is not None
379-
else False
380-
for item in design_spec.values()
381-
]
376+
has_symmetry_specification = []
377+
for item in design_spec.values():
378+
if hasattr(item, "symmetry"):
379+
has_symmetry = item.symmetry is not None
380+
else:
381+
has_symmetry = "symmetry" in item and item.get("symmetry") is not None
382+
has_symmetry_specification.append(has_symmetry)
382383
if any(has_symmetry_specification):
383384
if (
384385
inference_sampler is None

0 commit comments

Comments
 (0)