-
Notifications
You must be signed in to change notification settings - Fork 4
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
Update notebooks #203
Update notebooks #203
Conversation
notebooks/utils.py
Outdated
@@ -849,6 +850,39 @@ def prepare_visualization(results): | |||
return final_paths | |||
|
|||
|
|||
def _results_to_pickle(results, output_dir): |
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.
This should not be a private method, and probably be called differently, like save_job_results
. Can you also add the required type hinting for arguments and return of the method (-> None
)?
I also don't get why you specify an output_dir that then also still needs to be created. Why not the path to the exact file constructed the same way as the job result name? Wouldn't silently make directories here.
notebooks/utils.py
Outdated
pickle.dump(results, f) | ||
|
||
|
||
def _results_from_pickle(output_dir): |
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.
load_job_results
and same comments as above.
notebooks/utils.py
Outdated
WorldCereal InferenceResults | ||
Results object containing the loaded results from an openeo inference run. | ||
""" | ||
with open(output_dir / "results.pkl", "rb") as f: |
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.
build in resilience if file is not there? Would start from pure file path, not a directory.
Some minor updates: