-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: let ImageSpec copy new file into container
Signed-off-by: machichima <[email protected]>
- Loading branch information
1 parent
e01efc2
commit 3e7e2b2
Showing
2 changed files
with
31 additions
and
2 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
examples/customizing_dependencies/customizing_dependencies/calculate-ellipse-area-new.py
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,29 @@ | ||
import math | ||
import sys | ||
|
||
|
||
def write_output(output_dir, output_file, v): | ||
with open(f"{output_dir}/{output_file}", "w") as f: | ||
f.write(str(v)) | ||
|
||
|
||
def calculate_area(a, b): | ||
return math.pi * a * b | ||
|
||
|
||
def main(a, b, output_dir): | ||
a = float(a) | ||
b = float(b) | ||
|
||
area = calculate_area(a, b) | ||
|
||
write_output(output_dir, "area", area) | ||
write_output(output_dir, "metadata", "[from python rawcontainer]") | ||
|
||
|
||
if __name__ == "__main__": | ||
a = sys.argv[1] | ||
b = sys.argv[2] | ||
output_dir = sys.argv[3] | ||
|
||
main(a, b, output_dir) |
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