Skip to content
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

Separating looper from models #74

Closed
nsheff opened this issue Mar 6, 2017 · 11 comments
Closed

Separating looper from models #74

nsheff opened this issue Mar 6, 2017 · 11 comments

Comments

@nsheff
Copy link
Contributor

nsheff commented Mar 6, 2017

We've discussed this briefly in the past and I wanted to formalize and collect discussion here.

looper.models is useful outside of looper, and other systems could use models while providing a different functional implementation of what looper does; or use them for analysis, or whatever. For example, snakemake would use models but not looper.

Right now you can already do this like so (see docs):

from looper import models

my_project = models.Project("path/to/project_config.yaml")
my_samples = my_project.samples

But it would be more natural to separate models into a new project, say promod for Project Models, and then both looper and other tools would do import promod instead.

@vreuter
Copy link
Member

vreuter commented Mar 6, 2017

👍 how about projels 🤔

@afrendeiro
Copy link
Contributor

My initial view of looper was as much of an API as a CLI program, so I'd still prefer if they were together.

Partitioning too much the code makes it somewhat difficult to keep a global view on everything and increases complexity for a user that also wants to understand the system as a whole. This would mean that there are 4 programs needed to keep the usual workflow as is.
One can create more submodules if needed no?
Another argument is for example if one of the projects gains particular traction there's no guarantee the others initailly design to work together primarily will maintain compatibility (more or less what is happening with looper and pipelines right now).

However if you guys really want to split it, would it be possible that looper imports models in a way that exposes its API in the same way?

PS: Besides, promod and projels are not really convincing names 😛

@nsheff
Copy link
Contributor Author

nsheff commented Mar 8, 2017

The API is fully maintained in models; the looper half of things has no API, it uses that API. Looper is actually very simple and much of the important functionality is in models -- I think you just have to think of the original project as "models" now. Looper has no objects; it's just a main that uses the models API to loop through and submit jobs. So the API would not change, it would actual gain prominence as the centerpiece of models, which is where it belongs.

PS pipelines just needs a few very small updates to the interface files to maintain compatibility -- I don't find this particularly problematic... it's mostly because we were very limited in early concepts of looper but as I've started using it for more wide stuff I've been able to generalize lots of things. it maintains backward compatibility, but does require just a few more specifications to account for the increased generality. but that's also what will make it useful to others.

@nsheff
Copy link
Contributor Author

nsheff commented Mar 8, 2017

Also @afrendeiro, one of the big motivating factors behind this is that in discussion with @johanneskoester we realized that snakemake could also make use of the models API side of things, but does not require the looper submission (because this is what snakemake does). So, likely there are other systems in the same vein. We could encourage development, improvement, and sharing of the models concept if it was separated from looper; looper then becomes one of many clients of models. this is good for everyone.

@nsheff
Copy link
Contributor Author

nsheff commented Mar 8, 2017

and actually, one last point: your way of using the API for analysis is also only reliant on models, not on looper; so you don't need looper functionality for any of that stuff, you just need models. that's another example of the above. by bundling with looper, we obscure the much more general utility of models.

@nsheff
Copy link
Contributor Author

nsheff commented Mar 22, 2017

How about probjects ?

@vreuter
Copy link
Member

vreuter commented Mar 22, 2017

Ha I'm good with that.

@nsheff
Copy link
Contributor Author

nsheff commented Apr 27, 2017

We need a catchy name for the objects project -- @johanneskoester do you have a suggestion for a name?

@johanneskoester
Copy link

Not currently. My feeling is that project is a bit too generic though...

@nsheff
Copy link
Contributor Author

nsheff commented Jul 19, 2017

see also databio/pypiper#39 -- with dividing out models we should use the attribute dict in pypiper as well.

@nsheff
Copy link
Contributor Author

nsheff commented Oct 19, 2017

ok, plan is: after the next release (0.7), we do this separation.

@vreuter vreuter modified the milestones: 0.7, Migration to PEP Oct 19, 2017
@vreuter vreuter closed this as completed Dec 19, 2017
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants