-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolved client-server import chain and added installation key for in…
…strument server dependencies (#448) * Moves the `_midpoint()` function to `murfey.util.tomo` to keep client and server modules detached * Replaces remaining instances of `procrunner.run()` with `subprocess.run()` * Creates a new key for instrument server package dependencies
- Loading branch information
Showing
8 changed files
with
81 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
def midpoint(angles: list[float]) -> int: | ||
""" | ||
Utility function to calculate the midpoint of the angles used in a tilt series. | ||
Used primarily in the tomography workflow. | ||
""" | ||
if not angles: | ||
return 0 | ||
if len(angles) <= 2: | ||
return round(angles[0]) | ||
sorted_angles = sorted(angles) | ||
return round( | ||
sorted_angles[len(sorted_angles) // 2] | ||
if sorted_angles[len(sorted_angles) // 2] | ||
and sorted_angles[len(sorted_angles) // 2 + 1] | ||
else 0 | ||
) |