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

[rllib] Fix some missing f-strings #24148

Merged
merged 1 commit into from
Apr 25, 2022
Merged

Conversation

silky
Copy link
Contributor

@silky silky commented Apr 24, 2022

Noticed some strings should've been f-strings; this fixes them, and
fixes a minor bug that was present, as a result.

Note that I only did this in the rllib folder; I didn't want to go through everything, because my regex generated a lot of false positives; but someone better with regexes could probably improve it:

rg '(?<!f)"[^"]*?{.{1,}}.*?"' --pcre2 -t py | grep -v format

Why are these changes needed?

It's a bug.

Related issue number

Checks

  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

Noticed some strings should've been f-strings; this fixes them, and
fixes a minor bug that was present, as a result.
@@ -516,8 +516,8 @@ def compute_actions(
_is_training=tf.constant(False),
)
if state_batches is not None:
for s in enumerate(state_batches):
input_dict["state_in_{i}"] = s
for i, s in enumerate(state_batches):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note that this was a bug, I think, that is fixed by this change.

Copy link
Contributor

Choose a reason for hiding this comment

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

Wow, nice catch!

Copy link
Contributor

@sven1977 sven1977 left a comment

Choose a reason for hiding this comment

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

Thanks a ton for the fix and cleanups @silky ! Very nice.

@sven1977 sven1977 merged commit 3589c21 into ray-project:master Apr 25, 2022
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.

None yet

2 participants