[arvados] updated: 2.5.0-82-g9b17cfdd8

git repository hosting git at public.arvados.org
Wed Feb 1 14:12:57 UTC 2023


Summary of changes:
 doc/sdk/python/cookbook.html.textile.liquid | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

       via  9b17cfdd8676c34c334452a52279ee547392ef33 (commit)
       via  b8a7f08e9b04868f80731452c31fa7c2ab0c4a42 (commit)
      from  674630a6f461527f5b26e917814736b444cb4f51 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 9b17cfdd8676c34c334452a52279ee547392ef33
Author: Brett Smith <brett.smith at curii.com>
Date:   Wed Feb 1 09:10:33 2023 -0500

    19792: Use binary mode in cookbook download+upload examples
    
    This incorporates a suggestion from review to use a binary mode in a way
    that makes the recipes more robust. It's very likely that readers will
    want to work with binary files at least as much as text files, and these
    recipes still work for text files too for verbatim copies.
    
    Refs #19792.
    
    Arvados-DCO-1.1-Signed-off-by: Brett Smith <brett.smith at curii.com>

diff --git a/doc/sdk/python/cookbook.html.textile.liquid b/doc/sdk/python/cookbook.html.textile.liquid
index 43d694d48..f2d087625 100644
--- a/doc/sdk/python/cookbook.html.textile.liquid
+++ b/doc/sdk/python/cookbook.html.textile.liquid
@@ -396,15 +396,15 @@ with collection.open('ExampleFile') as my_file:
 
 h3(#download-a-file-from-a-collection). Download a file from a collection
 
-Once you have a @Collection@ object, the "@Collection.open@ method":{{ site.baseurl }}/sdk/python/arvados/collection.html#arvados.collection.RichCollectionBase.open lets you open files from a collection the same way you would open files from disk using Python's built-in @open@ function. It returns a file-like object that you can use in many of the same ways you would use any other file object. You can pass it as a source to Python's standard "@shutil.copyfileobj@ function":https://docs.python.org/3/library/shutil.html#shutil.copyfileobj to download it. This code downloads @ExampleFile@ from your collection and saves it to the current working directory as @ExampleDownload@:
+Once you have a @Collection@ object, the "@Collection.open@ method":{{ site.baseurl }}/sdk/python/arvados/collection.html#arvados.collection.RichCollectionBase.open lets you open files from a collection the same way you would open files from disk using Python's built-in @open@ function. You pass a second mode argument like @'rb'@ to open the file in binary mode. It returns a file-like object that you can use in many of the same ways you would use any other file object. You can pass it as a source to Python's standard "@shutil.copyfileobj@ function":https://docs.python.org/3/library/shutil.html#shutil.copyfileobj to download it. This code downloads @ExampleFile@ from your collection and saves it to the current working directory as @ExampleDownload@:
 
 {% codeblock as python %}
 import arvados.collection
 import shutil
 collection = arvados.collection.Collection(...)
 with (
-  collection.open('ExampleFile') as src_file,
-  open('ExampleDownload', 'w') as dst_file,
+  collection.open('ExampleFile', 'rb') as src_file,
+  open('ExampleDownload', 'wb') as dst_file,
 ):
     shutil.copyfileobj(src_file, dst_file)
 {% endcodeblock %}
@@ -432,8 +432,8 @@ import arvados.collection
 import shutil
 collection = arvados.collection.Collection(...)
 with (
-  open('ExampleFile') as src_file,
-  collection.open('ExampleUpload', 'w') as dst_file,
+  open('ExampleFile', 'rb') as src_file,
+  collection.open('ExampleUpload', 'wb') as dst_file,
 ):
     shutil.copyfileobj(src_file, dst_file)
 collection.save_new(...)  # or collection.save() to update an existing collection

commit b8a7f08e9b04868f80731452c31fa7c2ab0c4a42
Author: Brett Smith <brett.smith at curii.com>
Date:   Wed Feb 1 09:07:08 2023 -0500

    19792: Fix typos throughout
    
    Refs #19792.
    
    Arvados-DCO-1.1-Signed-off-by: Brett Smith <brett.smith at curii.com>

diff --git a/doc/sdk/python/cookbook.html.textile.liquid b/doc/sdk/python/cookbook.html.textile.liquid
index 156b7cbad..43d694d48 100644
--- a/doc/sdk/python/cookbook.html.textile.liquid
+++ b/doc/sdk/python/cookbook.html.textile.liquid
@@ -162,7 +162,7 @@ In brief, a permission is represented in Arvados as a link object with the follo
 * @tail_uuid@ identifies the user or role group that receives the permission.
 * @head_uuid@ identifies the Arvados object this permission grants access to.
 
-For details, refer to the "Permissions model documentation":{{ site.baseurl }}/api/permission-model.html. Managing permissions is just a matter of ensuring the desired links exist with the standard @create@, @update@, and @delete@ methods.
+For details, refer to the "Permissions model documentation":{{ site.baseurl }}/api/permission-model.html. Managing permissions is just a matter of ensuring the desired links exist using the standard @create@, @update@, and @delete@ methods.
 
 h3(#grant-permission). Grant permission to an object
 
@@ -418,7 +418,7 @@ import arvados.collection
 collection = arvados.collection.Collection(...)
 with collection.open('ExampleFile', 'w') as my_file:
     # Write to my_file as desired.
-    # This example writes "Hello, world!" to the file.
+    # This example writes "Hello, Arvados!" to the file.
     print("Hello, Arvados!", file=my_file)
 collection.save_new(...)  # or collection.save() to update an existing collection
 {% endcodeblock %}
@@ -616,7 +616,7 @@ for mount_name, mount_source in container_request['mounts'].items():
         pprint.pprint(mount_source.get('content'))
 {% endcodeblock %}
 
-h3(#get-input-of-a-cwl-workflow). Get input of a container or CWL workflow run
+h3(#get-input-of-a-cwl-workflow). Get input of a CWL workflow run
 
 When you run a CWL workflow, the CWL inputs are stored in the container request's @mounts@ field as a JSON mount named @/var/lib/cwl/cwl.input.json at .
 

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list