-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add feature to directly open files with IrodsPath #241
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice new feature!
There is only one thing we need to further investigate: writing of existing data objects.
if self.collection_exists(): | ||
raise ValueError("Cannot open collection, only data objects can be opened.") | ||
# Create the data object if it does not exist. | ||
if mode == "w" and not self.dataobject_exists(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add that existing object cannot be opened in write mode. It would be very useful as it led to inconsistencies when I tried that previously!!!
Can we maybe add an else which throws a message that an existing object can only be opened in read mode?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or maybe we need to test a bit more for the writing existing data objects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That seems inconsistent with how opening files works though. Doesn't it make more sense that the data object gets removed and then opened for writing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chStaiger I have tested, and writing to a data object that already exists is possible and will simply overwrite it. I think this is how it should be done. Let me know if you agree, then you can perhaps approve and merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think I opened the data object in "append" mode. And that led to problems. So all fine with me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woohoo.
This will make it more natural for users to open files directly from the IrodsPath, instead of needing to go through the PRC.
Fixes #170
TODO: