Skip to content

Conversation

@badisa
Copy link
Collaborator

@badisa badisa commented Dec 1, 2025

  • An edge case, but worth handling

@badisa badisa requested a review from jgullingsrud December 1, 2025 17:22
batch_size=md_params.water_sampling_params.batch_size,
)
movers.append(water_sampler)
except ValueError:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems fragile... Wouldn't it be better to test for a None host environment and disable water sampling in just that case?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be moved up into estimate_relative_free_energy_bisection_or_hrex in a similar manner to how it is done in the run_ functions. Calling get_context(initial_state) would require the user to setup the MDParams appropriately. How does that sound?

# Expect a specific type of exception, else raise the exception
if str(e) == "must have exactly one NonbondedInteractionGroup potential":
warn("System has no Nonbonded potential, disabling local md")
md_params = replace(md_params, local_md_params=None)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here - can these checks be made higher up in the call chain so that they don't depend on generic exceptions and string checks?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants