-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
[DO NOT MERGE] Rewrite YAPF scripts #1971
Changes from 9 commits
3cf4f70
7f85a22
323be6f
b1153d3
f3f8f47
0bd4745
b9ff97b
4579266
3105a88
6d2a24b
d2a0ba7
45501cf
42ec70a
30f6478
a1a5633
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,30 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Cause the script to exit if a single command fails | ||
set -e | ||
|
||
ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE:-$0}")"; pwd) | ||
|
||
pushd $ROOT_DIR/../test | ||
find . -name '*.py' -type f -exec yapf --style=pep8 -i -r {} \; | ||
popd | ||
|
||
pushd $ROOT_DIR/../python | ||
find . -name '*.py' -type f -not -path './ray/dataframe/*' -not -path './ray/rllib/*' -not -path './ray/cloudpickle/*' -exec yapf --style=pep8 -i -r {} \; | ||
popd | ||
|
||
CHANGED_FILES=(`git diff --name-only`) | ||
if [ "$CHANGED_FILES" ]; then | ||
echo 'Reformatted staged files. Please review and stage the changes.' | ||
echo | ||
echo 'Files updated:' | ||
for file in ${CHANGED_FILES[@]}; do | ||
echo " $file" | ||
done | ||
exit 1 | ||
else | ||
exit 0 | ||
set -eo pipefail | ||
|
||
ROOT="$(git rev-parse --show-toplevel)" | ||
builtin cd "$ROOT" | ||
|
||
yapf \ | ||
--style "$ROOT/.style.yapf" \ | ||
--in-place --recursive --parallel \ | ||
--exclude 'python/ray/dataframe/' \ | ||
--exclude 'python/ray/rllib/' \ | ||
--exclude 'python/ray/cloudpickle/' \ | ||
-- \ | ||
'test/' 'python/' | ||
|
||
CHANGED_FILES=($(git diff --name-only)) | ||
|
||
if [[ "${#CHANGED_FILES[@]}" -gt 0 ]]; then | ||
echo 'Reformatted staged files. Please review and stage the changes.' | ||
echo 'Files updated:' | ||
|
||
for file in "${CHANGED_FILES[@]}"; do | ||
echo "$file" | ||
done | ||
|
||
exit 1 | ||
fi | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -750,8 +750,8 @@ def micros_rel(ts): | |
"name": | ||
"SubmitTask", | ||
"args": {}, | ||
"id": (parent_info["worker_id"] + | ||
str(micros(min(parent_times)))) | ||
"id": (parent_info["worker_id"] + str( | ||
micros(min(parent_times)))) | ||
} | ||
full_trace.append(parent) | ||
|
||
|
@@ -825,8 +825,8 @@ def micros_rel(ts): | |
"name": | ||
"SubmitTask", | ||
"args": {}, | ||
"id": (parent_info["worker_id"] + | ||
str(micros(min(parent_times)))) | ||
"id": (parent_info["worker_id"] + str( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not a big fan of these There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @alok can we revert this? |
||
micros(min(parent_times)))) | ||
} | ||
full_trace.append(parent) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -189,10 +189,9 @@ def cleanup_object_table(self): | |
if manager in self.dead_plasma_managers: | ||
# If the object was on a dead plasma manager, remove that | ||
# location entry. | ||
ok = self.state._execute_command(object_id, | ||
"RAY.OBJECT_TABLE_REMOVE", | ||
object_id.id(), | ||
hex_to_binary(manager)) | ||
ok = self.state._execute_command( | ||
object_id, "RAY.OBJECT_TABLE_REMOVE", object_id.id(), | ||
hex_to_binary(manager)) | ||
if ok != b"OK": | ||
log.warn("Failed to remove object location for dead " | ||
"plasma manager.") | ||
|
@@ -507,8 +506,8 @@ def run(self): | |
log.debug("{} dead local schedulers, {} plasma managers total, {} " | ||
"dead plasma managers".format( | ||
len(self.dead_local_schedulers), | ||
(len(self.live_plasma_managers) + | ||
len(self.dead_plasma_managers)), | ||
(len(self.live_plasma_managers) + len( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this one is also a little odd.. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @alok can we revert this? |
||
self.dead_plasma_managers)), | ||
len(self.dead_plasma_managers))) | ||
|
||
# Handle messages from the subscription channels. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not a big fan of these