Skip to content

Commit b450b7b

Browse files
committed
Add two notes relevant to the environment setting in IngestReader to
the reference documentation
1 parent 28d26a0 commit b450b7b

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

src/icat/ingest.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ class IngestReader(XMLDumpFileReader):
9797
Dataset_complete = "false"
9898
"""Value to prescribe in the `complete` attribute of datasets.
9999
100+
.. note::
101+
The value for this class attribute is subject to change in
102+
version 2.0. You might want to override it in order to pin it
103+
to a value that is suitable for you.
104+
100105
.. versionadded:: 1.5.0
101106
"""
102107
DatasetType_name = "raw"
@@ -198,6 +203,20 @@ def get_environment(self, client):
198203
Subclasses may override this method to control the attributes
199204
set in the environment.
200205
206+
.. note::
207+
If you override this method, it is advisable to call the
208+
inherited method from the parent class and augment the
209+
result. This avoids inadvertently dropping environment
210+
settings added in future versions. E.g. do something
211+
like the following in your subclass:
212+
213+
.. code-block:: python
214+
215+
def get_environment(self, client):
216+
env = super().get_environment(client)
217+
env['mykey'] = 'value'
218+
return env
219+
201220
:param client: the client object being used by this
202221
IngestReader.
203222
:type client: :class:`icat.client.Client`

0 commit comments

Comments
 (0)