-
Notifications
You must be signed in to change notification settings - Fork 10
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
ENH: Changing the recommendation on how to set up a project. #570
Comments
This sounds very helpful in general. A couple of questions, remarks:
|
I think that is an important question. In my projects so far the non-task code in the |
Hi! Thank you both for your input and sorry for being quiet about this issue. Since I started the discussion here, some developments have made me wonder whether the changes would substantially improve the situation.
A more serious point is that I added support for Dask and coiled in pytask-parallel for the upcoming v0.5 release. There is a problem with how pytask imports task modules and dask that requires task modules to live in a package ( |
Great, thanks! Can we brainstorm at some point about how to accommodate multiple pytask-powered packages in one DAG? (my point 2. above) This really is a very common situation here and I am still looking for the "right" way to do it. |
I have not needed this feature so far, but it is an interesting problem. What have you tried already? I would probably approach it with
Software environment-wise, the whole story would be much easier if pixi had a workspace feature like rye. |
Thanks for the suggestion!
Before interacting in any other way with ** independent_project** from ** dependent_project** and running pytask, I received the following error: It seems like pytask is struggling with loading modules from the independent_project. |
Have you installed both projects or added the path to |
Yes, both projects are installed in editable mode. |
Still sounds like the most likely cause. Have you activated the environment? Have you checked whether the packages show up in |
Thanks for the further hints. Used |
While this works nicely, I have been wondering a bit whether such a project could be made installable. That is, |
Is your feature request related to a problem?
The documentation contains a couple of sections where the project structure is explained.
All of them propose to structure the project using an
src layout
(good) where the tasks are within the project folder (bad).Why is this bad?
You cannot use
pip install .
to install the project but must use the editable mode.Why? If you use the normal installation, the paths
SRC
andBLD
defined inconfig.py
will be relative to the installed package path (like/mambaforge/envs/my_project/lib/python-3.11/site-packages/my_project/
). It means the data is assumed to lie somewhere there.Of course, you could add the data to your Python project via
MANIFEST.in
, but then the data would be copied over to the environment directory on every install, which can be very expensive.The data should not be part of the application.
Describe the solution you'd like
The new structure I propose is this one.
tasks
, just like tests.data
, out ofsrc
.API breaking implications
None.
Describe alternatives you've considered
None.
Additional Context
Popular templates for data science projects also keep
The text was updated successfully, but these errors were encountered: