Skip to content

Refactor real-space density reward input preparation #314

Description

@etherealsunshine

Overview

In /rewards/real_space_density.py, RealSpaceRewardFunction.structure_to_reward_input() duplicates much of the preprocessing in extract_density_inputs_from_atomarray().

Both paths convert an AtomArray/AtomArrayStack into batched Torch tensors for real-space density evaluation:

  • coordinates
  • scattering element indices
  • B-factors
  • occupancies

However, the latter also removes invalid coordinates and replaces NaN B-factors with a default value, while structure_to_reward_input() only filters zero-occupancy atoms.

Proposed change

Refactor RealSpaceRewardFunction.structure_to_reward_input() to reuse extract_density_inputs_from_atomarray()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions