-
Notifications
You must be signed in to change notification settings - Fork 7
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
core library can't discover derived treants by itself. #100
Comments
@kain88-de I don't see an easy alternative to the existing behavior, since in order for Under the current behavior |
For me the bigger problem besides the CLI tools is that the return of |
When I understand correctly datreant was though of a package that can be used to For me this makes datreant similar to other database software like But datreant is designed to change the database implementation by introducing Another issue is that it can now be possible to create several state files in |
A short description might be that datreant tries to be a tool and low-level library to create a tool at the same time. This is technically possible to implement but leads to confusing behavior in the end. Is there a technical/practical reason why a Sim object creates it's own state file? Why couldn't it just create a Treant file as well and store special hidden attributes to define that it is a sim object? |
I don't know the internals of mds well enough but I do like @kain88-de 's reasoning: just use treant state files and throw special stuff into a "top level" "mdsynthesis" attribute in the json. dtr.core only accesses a subset and ignores everything else. Higher level tools like mds take the core stuff and their own things. |
I think this would switch to duck-typing: S = mds.Sim("name") will throw an exception if the treant json file does not contain the stuff that it expects from a Sim. If directory "name" is empty, create a Sim. Maybe add Not sure how this would interact with current workflows. In contrast, T = datreant.core.Treant("name") will always work; |
After a discussion with @orbeckst (a while ago), here's a possible solution. There may be issues with it, but I think it's a clean resolution to this and partially to #101. It has a few aspects:
Are there holes in this idea? One problem is that it means specialized packages can only implement one type of specialized |
Like it
Also like it.
I don't understand this. So a
Never used it. Generally like the idea but I think we should have some discussions about the changes needed for the state file and check if we they match all our requirements how we plan Treants and specialized Treants to behave. |
So this will automatically convert any treant found into a special sim treant? Not a bad idea. How does the state file ensure then that different special extensions don't interfere with one another? This would actually be nice so I can so assuming I have another specialization called |
Oliver Beckstein
Special treats have one top level entry that acts as their reserved namespace. For instance, MDSynthesis stores all its own data under 'mdsynthesis'. A package foo would claim top level 'foo'. |
Working on this now. I'm going to cut a 0.7.1 release with the current state of |
Btw do we have a solution when I want to find only existing Sims? For when I do a discover in a folder with mixed Treant and Sim objects in them. Now I only want to have the sim-object. I guess that would be a |
Under the new scheme described in datreant/MDSynthesis#65, By contrast, Something we could add to the |
Objects inheriting from a Treant define their own state files. This leads to inconsistencies. For example
if I have a folder with a Sim object I can't discover it until I imported MDSynthesis. Then the following python session can occur.
I can now treat the bundle like any other bundle just some mdsynthesis specific operations are missing.
It feels weird to me in the usage that the return value of
dtr.discover
depends on the global modules that I have loaded.This is a problem in
datreant.cli
where I would have to import all packages that extenddatreant.core
to find their respective state file, this means it would only work with official datreant packages.The text was updated successfully, but these errors were encountered: