-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds statistics to Python hello world example.
- Loading branch information
1 parent
0f162ce
commit d699df9
Showing
1 changed file
with
15 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
import nextmv | ||
|
||
# Read from stdin. | ||
input = nextmv.load_local() | ||
name = input.data["name"] | ||
if __name__ == "__main__": | ||
# Read from stdin. | ||
input = nextmv.load_local() | ||
name = input.data["name"] | ||
|
||
##### Insert model here | ||
##### Insert model here | ||
|
||
# Print logs that render in the run view in Nextmv Console | ||
nextmv.log(f"Hello, {name}") | ||
# Print logs that render in the run view in Nextmv Console | ||
nextmv.log(f"Hello, {name}") | ||
|
||
# Write output and statistics. | ||
output = nextmv.Output(solution=None, statistics={"message": f"Hello, {name}"}) | ||
nextmv.write_local(output) | ||
# Write output and statistics to stdout. | ||
output = nextmv.Output( | ||
solution=f"Hello, {name}", | ||
statistics=nextmv.Statistics( | ||
result=nextmv.ResultStatistics(custom={"length": len(name)}), | ||
), | ||
) | ||
nextmv.write_local(output) |