Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions models/rfd3/src/rfd3/utils/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ def inference_load_(
return data


def ensure_input_is_abspath(args: dict, path: PathLike | None):
def ensure_input_is_abspath(args: Dict[str, DesignInputSpecification | dict], path: PathLike | None):
Comment thread
Ubiquinone-dot marked this conversation as resolved.
Outdated
"""
Ensures the input source is an absolute path if exists, if not it will convert

Expand All @@ -381,9 +381,11 @@ def ensure_input_is_abspath(args: dict, path: PathLike | None):
)
if "input" not in args or not exists(args["input"]):
return args
input = args["input"]
input = str(args["input"])
if not os.path.isabs(input):
input = os.path.abspath(os.path.join(os.path.dirname(path), input))
if path is not None:
Comment thread
Ubiquinone-dot marked this conversation as resolved.
Outdated
raise ValueError("input path provided in input, but no path to resolve relative to (required).")
input = os.path.abspath(os.path.join(os.path.dirname(str(path)), input))
ranked_logger.info(
f"Input source path is relative, converted to absolute path: {input}"
)
Expand All @@ -401,7 +403,7 @@ def ensure_inference_sampler_matches_design_spec(
inference_sampler: Inference sampler dictionary
"""
has_symmetry_specification = [
True if "symmetry" in item.keys() else False for item in design_spec.values()
True if "symmetry" in item.keys() and item.get("symmetry") is not None else False for item in design_spec.values()
]
if any(has_symmetry_specification):
if (
Expand Down
Loading