Skip to content

[#827] Add README text on usage of iRODSSession instances - #832

Open
d-w-moore wants to merge 5 commits into
irods:mainfrom
d-w-moore:827.m
Open

[#827] Add README text on usage of iRODSSession instances#832
d-w-moore wants to merge 5 commits into
irods:mainfrom
d-w-moore:827.m

Conversation

@d-w-moore

Copy link
Copy Markdown
Collaborator

No description provided.

@korydraughn korydraughn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wording seems good.

Are we encouraging the use of irods.helpers and make_session()?
Are they meant for general usage?

Comment thread README.md
Comment thread README.md
@d-w-moore d-w-moore changed the title Add README text on usage of iRODSSession instances [#827] Add README text on usage of iRODSSession instances Sep 4, 2026
@d-w-moore

Copy link
Copy Markdown
Collaborator Author

Wording seems good.

Are we encouraging the use of irods.helpers and make_session()? Are they meant for general usage?

I don't feel we have to encourage it ... if the mention of it as the first option seems like encouraging, perhaps a reorganization is needed. The upshot is: a client environment set up, make_session is the quickest way to create and authenticate.

There is this: make_session is used widely in the tests, with only the tiny difference that the version called from the tests will vet the connected server version internally before continuing.

@d-w-moore

Copy link
Copy Markdown
Collaborator Author

Ok, I think we're now presenting the different instance creation options fairly and on equal ground.

@korydraughn

Copy link
Copy Markdown
Contributor

Are new commits on the way? Nothing has changed since I last looked at this PR.

@d-w-moore

Copy link
Copy Markdown
Collaborator Author

Are new commits on the way? Nothing has changed since I last looked at this PR.

Yeah, sorry ... concentration lapse. I have just now put in the changes referred to aboe.

Comment thread README.md
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment on lines +47 to +52
One way to create the session object, assuming one has already successfully
set up a client environment via `iinit`, is by using a simple `make_session`
call:

>>> from irods.helpers import make_session
>>> session = make_session()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cover the constructor form(s) before introducing make_session.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be preferable to have no mention of make_session at all?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's fine to mention make_session if it's considered to be a general purpose tool.

That said, make_session is a convenience function, so it should be mentioned after showing the tools which make_session is built on top of.

Thoughts?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That said, make_session is a convenience function, so it should be mentioned after showing the tools which make_session is built on top of.

that sounds right.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done - and the README can now be reviewed again, since I'm done for now changing things around for the present.

Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md
# (... Further instances of calls to the server through 'session' may follow.)
```

This casual approach usually ends up being optimal choice in terms efficiency, since

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This casual approach usually ends up being optimal choice in terms efficiency, since
This casual approach usually ends up being the optimal choice in terms of efficiency, since

Comment thread README.md

One way of starting a session is to pass iRODS credentials as keyword
An `iRODSSession` instance is the interface object through which iRODS server
APIs can be invoked. One can create the object using constructor form directly,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
APIs can be invoked. One can create the object using constructor form directly,
APIs can be invoked. One can create the object using the constructor form directly,

Comment thread README.md
Comment on lines +62 to +71
Once created, the `iRODSSession` instance can be managed from a choice between two
possible patterns. Firstly, one can allow references to the instance to persist as
is natural for the application. This allows Python interpreter's reference counting to
let the object pass out of scope and destroy the underlying server connection(s) at the
proper time:

```python
home_coll = session.collections.get(f'/tempZone/home/{session.username}')
# (... Further instances of calls to the server through 'session' may follow.)
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code block on line 68 seems out of place in relation to the text on line 62.

Feels like the code block can be removed entirely?

Comment thread README.md
@@ -41,7 +41,62 @@ Uninstalling
Establishing a (secure) connection

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This title includes (secure), but SSL/TLS isn't mentioned until the next section.

Consider whether (secure) should be moved or removed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants