Conversation
WIP: for some reason when utilizing threading, logged in client does not persist among threads. added a client parameter to post to /attached_media route and private _save_attached_image so logged in client can bubble down.. ideally, this would be saved in threading.local()
…all .result() to see if successful/errors
|
@lcjohnso this is ready for review. Do you mind reading through the doc strings and examples to make sure wording makes sense? Bonus: if you can run the examples and see what extra info is needed that I did not include in docs. Maybe worth pinging @astrohayley after an initial run through from Cliff. |
lcjohnso
left a comment
There was a problem hiding this comment.
I suggest a number of docs edits, and I have questions about how users are meant to use the new functions. It appears save_attached_image() is the primary interface, but the availability of add_attached_image() clouds this assumption.
panoptes_client/subject.py
Outdated
| - **metadata** optional dict, serves as metadata for the attached_image/media | ||
| - **client** optional Panoptes.client() instance. Sent as a parameter for threading purposes for parallelization so that thread uses the correct client context. | ||
|
|
||
| Examples:: |
There was a problem hiding this comment.
Please add in-line comments (with # mark)
Co-authored-by: Cliff Johnson <cliff@zooniverse.org>
Co-authored-by: Cliff Johnson <cliff@zooniverse.org>
Co-authored-by: Cliff Johnson <cliff@zooniverse.org>
Co-authored-by: Cliff Johnson <cliff@zooniverse.org>
|
At one point you are stating: This is no longer quite correct if the user has not installed libmagic and mime type detection is being handled by mimetypes - mimetypes does not handle all types of :py:class: |
Hi @PmasonFF -- For the case where libmagic is not installed/available and the user wants to pass a BytesIO object, one can override and avoid any form of type sensing by using the |
…ched_image a private method since used internally, add eg. on saved attached image for externally hosted files
…to changed method to match order)
Upload Subject attached media/ attached images/ancillary data for existing subjects
Example usages:
Without parallelism and multiple threads
Utilizing parallelism