Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated piecewise linear T schedule #353

Merged
merged 4 commits into from
Oct 21, 2024
Merged

updated piecewise linear T schedule #353

merged 4 commits into from
Oct 21, 2024

Conversation

M-R-Schaefer
Copy link
Contributor

changed the steps parameter to duration, which is the number of time steps between temperatures.

@M-R-Schaefer
Copy link
Contributor Author

closes #353

Comment on lines +20 to 30
def __init__(self, T0: int, temperatures: list[float], durations: list[int]):
self.T0 = T0
self.values = jnp.array(values)
self.temperatures = jnp.array(temperatures)
steps = np.cumsum(durations)
self.steps = jnp.array(steps)

def __call__(self, step) -> float:
T = jnp.interp(step, self.steps, self.values, left=self.T0, right=self.values[-1])
T = jnp.interp(
step, self.steps, self.temperatures, left=self.T0, right=self.temperatures[-1]
)
return T * units.kB
Copy link
Contributor

Choose a reason for hiding this comment

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

You made the changes to MD config also in #352 but the changes in this file are missing. Can this cause issues if #352 is merged first? Tests should cover this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes the test does actually fail rn but should be fixed with the other PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure what I was thinking here

@M-R-Schaefer M-R-Schaefer requested a review from PythonFZ October 17, 2024 13:11
Copy link
Contributor

@PythonFZ PythonFZ left a comment

Choose a reason for hiding this comment

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

LGTM

@M-R-Schaefer M-R-Schaefer merged commit d58bea6 into main Oct 21, 2024
2 checks passed
@M-R-Schaefer M-R-Schaefer deleted the tschdule branch October 21, 2024 10:40
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.

2 participants