Skip to content

Commit b673bdc

Browse files
Update README.md - various review comments
Co-authored-by: Kory Draughn <korydraughn@ymail.com>
1 parent af113db commit b673bdc

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

README.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -835,10 +835,10 @@ datetime.datetime(2022, 9, 19, 15, 26, 7)
835835
Disabling AVU reloads from the iRODS server
836836
-------------------------------------------
837837

838-
With the default setting of reload = True, an iRODSMetaCollection will
838+
With the default setting of `reload = True`, an `iRODSMetaCollection` will
839839
proactively read all current AVUs back from the iRODS server after any
840-
metadata write done by the client. This helps methods such as items()
841-
to return an up-to-date result. Changing that default can, however, greatly
840+
metadata write done by the client. This helps methods such as `items()`
841+
to return an up-to-date result. Setting `reload = False` can, however, greatly
842842
increase code efficiency if for example a lot of AVUs must be added or deleted
843843
at once without reading any back again.
844844

@@ -850,13 +850,12 @@ for i in range(10):
850850

851851
# Force reload of AVUs and display:
852852
current_metadata = obj.metadata().items()
853-
from pprint import pp
854853
print(f"{current_metadata = }")
855854
```
856855

857856
Subclassing iRODSMeta
858857
---------------------
859-
The keyword option `iRODSMeta_type` can be used to set up any iRODSMeta
858+
The keyword option `iRODSMeta_type` can be used to set up any `iRODSMeta`
860859
subclass as the translator between native iRODS metadata APIs
861860
and the way in which the AVUs thus conveyed should be represented to the
862861
client.
@@ -865,12 +864,12 @@ An example is the `irods.meta.iRODSBinOrStringMeta` class which uses the
865864
`base64` module to "hide" arbitrary bytestrings within the `value` and
866865
`units` attributes of an iRODS metadata AVU:
867866

868-
```
867+
```py
869868
from irods.meta import iRODSBinOrStringMeta as MyMeta
870869
d = session.data_objects.get('/path/to/object')
871870
unencodable_octets = '\u1000'.encode('utf8')[:-1]
872871

873-
# Use our custom client-metadata type to store arbitrary octet strings
872+
# Use our custom client-metadata type to store arbitrary octet strings.
874873
meta_view = d.metadata(iRODSMeta_type = MyMeta)
875874
meta_view.set(m1 := MyMeta('mybinary', unencodable_octets, b'\x02'))
876875

@@ -879,15 +878,15 @@ irods.client_configuration.connections.xml_parser_default = 'QUASI_XML'
879878
meta_view.set(m2 := MyMeta('mytext', '\1', '\2'))
880879

881880
try:
882-
# These two lines are equivalent:
881+
# These two lines are equivalent.
883882
assert {m1,m2} <= (all_avus := set(meta_view.items()))
884883
assert {tuple(m1),tuple(m2)} <= all_avus
885884
finally:
886885
del meta_view['mytext'], meta_view['mybinary']
887886
```
888887

889888
Whereas the content of native iRODS AVUs must obey some valid text encoding as
890-
determined by the resident ICAT DB, the above is a possible alternative - albeit
889+
determined by the resident iRODS catalog, the above is a possible alternative - albeit
891890
one semantically bound to the local application that defines the needed
892891
translations. Still, this can be a valid usage for users who need a guarantee
893892
that any given octet string they might generate can be placed into metadata without

0 commit comments

Comments
 (0)