Coder Social home page Coder Social logo

Comments (7)

chStaiger avatar chStaiger commented on August 16, 2024 1

I see. Maybe it should not be excluded from the query but just from the explicit listing of the subcollections in the PRC?
From a user/scientific programmer perspective these are two different things for me. Explicitly calling subcollections I expected to get all members of the collection. While indeed, as a user, when I do iRODS path operations, it would be nice to behave similarly to pathlib or linux paths.

The iRODS Query I see as a sort of a backend function that gives information which then needs to be tweaked towards the user API call goal, i.e. list sub collections and return parent path.

I hope that makes sense and it is strictly from a programmers and user perspective.

from python-irodsclient.

chStaiger avatar chStaiger commented on August 16, 2024 1

Yes, agree, also. And with 'sub' being part of the name, some developers might expect to be able to write collection iterators or iterating functions where the subcollections member can be depended to be a proper subcollection of the parent. (In the mathematical sense of "proper" e.g. "proper subset"). That should be allowable, with no members of subcollections being 'equal' to the parent, otherwise the developer gets an infinite loop calling the iterator on the root collection.

Indeed I also noticed that in a never-ending while loop :)

from python-irodsclient.

trel avatar trel commented on August 16, 2024

Oh, well that's neat. Hmmm....

from python-irodsclient.

d-w-moore avatar d-w-moore commented on August 16, 2024

Yep, probably because:

$ iquest "select COLL_NAME where COLL_PARENT_NAME = '/'"
COLL_NAME = /
------------------------------------------------------------
COLL_NAME = /tempZone
------------------------------------------------------------

which is a very special case (only one collection is its own parent, and that's "/") so just excluding '/' specifically from the query should work just fine.

On the other hand:

$ cd / ; cd .. ; pwd
/
$ icd /
$ icd ..
 ERROR: parseRodsPath: parsing error for /..
No such collection: /..

from python-irodsclient.

trel avatar trel commented on August 16, 2024

I think I agree. PRC could exclude the / from the subcollections method easily enough...

def subcollections(self):
query = self.manager.sess.query(Collection)\
.filter(Collection.parent_name == self.path)
return [iRODSCollection(self.manager, row) for row in query]

from python-irodsclient.

d-w-moore avatar d-w-moore commented on August 16, 2024

Yes, agree, also. And with 'sub' being part of the name, some developers might expect to be able to write collection iterators or iterating functions where the subcollections member can be depended to be a proper subcollection of the parent. (In the mathematical sense of "proper" e.g. "proper subset"). That should be allowable, with no members of subcollections being 'equal' to the parent, otherwise the developer gets an infinite loop calling the iterator on the root collection.

from python-irodsclient.

alanking avatar alanking commented on August 16, 2024

@d-w-moore - Please close if complete. Thanks!

from python-irodsclient.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.