Skip to content

Commit

Permalink
Merge pull request #20 from DerWaldi:master
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 333787951
  • Loading branch information
Magenta Team committed Sep 25, 2020
2 parents d4f0b97 + cf81906 commit 484e854
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
10 changes: 4 additions & 6 deletions note_seq/alignment/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ http_archive(
http_archive(
name = "eigen_repo",
build_file = "//:eigen.BUILD",
sha256 = "7e84ef87a07702b54ab3306e77cea474f56a40afa1c0ab245bb11725d006d0da",
strip_prefix = "eigen-eigen-323c052e1731",
strip_prefix = "eigen-3.3.7",
urls = [
"https://bitbucket.org/eigen/eigen/get/3.3.7.tar.gz",
"https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.zip",
],
)

Expand All @@ -47,9 +46,8 @@ http_archive(

http_archive(
name = "bazel_skylib",
sha256 = "bbccf674aa441c266df9894182d80de104cabd19be98be002f6d478aaa31574d",
strip_prefix = "bazel-skylib-2169ae1c374aab4a09aa90e65efe1a3aad4e279b",
urls = ["https://github.com/bazelbuild/bazel-skylib/archive/2169ae1c374aab4a09aa90e65efe1a3aad4e279b.tar.gz"],
strip_prefix = "bazel-skylib-master",
urls = ["https://github.com/bazelbuild/bazel-skylib/archive/master.zip"],
)


Expand Down
6 changes: 3 additions & 3 deletions note_seq/alignment/align_fine_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,14 @@ def align_cpp(samples,
# Write to file.
fh, temp_path = tempfile.mkstemp(suffix='.proto')
os.close(fh)
with open(temp_path, 'w') as f:
with open(temp_path, 'wb') as f:
f.write(alignment_task.SerializeToString())

# Align with C++ program.
subprocess.check_call([ALIGN_BINARY, temp_path])

# Read file.
with open(temp_path + '.result') as f:
with open(temp_path + '.result', 'rb') as f:
result = alignment_pb2.AlignmentResult.FromString(f.read())

# Clean up.
Expand All @@ -163,7 +163,7 @@ def align_cpp(samples,
'time_diff_min_s': np.min(time_diffs),
}

for name, value in sorted(stats.iteritems()):
for name, value in sorted(stats.items()):
logging.info('%s: %f', name, value)

aligned_ns, skipped_notes = sequences_lib.adjust_notesequence_times(
Expand Down

0 comments on commit 484e854

Please sign in to comment.