On Jan 14, 7:29 pm, Christopher Lee <[email protected]> wrote:

> mdb = pygr.metabase.path[0] # get the first metabase in PYGRDATAPATH
>
> As far as I can see, sys.path provides a clear model for  
> pygr.metabase.path

> calling pygr.metabase.path.clear().  What do you think about this?  Do  
> you see any reasons not to follow the sys.path model?

I agree with almost everything that you wrote. The only thing that I
don't like is that the metabase.path appears to be a global variable,
and that seems like a holdover from the current pygr.Data that is also
a global name. These global variables/names tend to cause lots of
complications.

Why not make this path an attribute of the instance (object) itself.
That way one can have two Metabase instances that are independent from
one another. For example inside __init__.py it may look like so:

Data = Metabase()

this creates a Data object initialized from the environment variable,
that works exactly as before. You can add metadata to it but you can
also inspect its path to see where it can read the metadata from:

pygr.Data.Bio.Genome.Yeast = FooClass()
print pygr.Data.path

At the same time one can also write in their own program something
like:

workdata = Metabase( path=[ 'foo/bar/.localpygrdata' ]  )
workdata.Mystuff.Chunk1 = BarClass()

and the two  stay independent and we don't need to do anything to keep
them separate. Its path is different from the one above:

print workdata.path

Istvan


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pygr-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pygr-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to