-
Notifications
You must be signed in to change notification settings - Fork 906
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
[KED-1169] Library code should be framework decision agnostic #149
Comments
Am I correct that you have If you do not want |
You are technically correct, however that line is only used for updating the python path, the user can set the python path themselves and put the source wherever they want. |
Indeed - any particular reason we do not want to surface this in I am currently working around this like you mentioned but it is a bit ugly. In my case:
|
@tsanikgr Thanks for raising this! We're going to put it on our next sprint to discuss this and get back to you with a proposed action. |
For what it's worth, our project template does not include a src directory. |
More very valid frustration from users on unintended side effects: #161. |
It is true that there should be no assumptions about the user code in the library, but We always need to make assumptions when we want to give the user a pre-built structure to work with, and maybe provide some level of extensibility and configuration. At the moment We're a planning to redesign the framework part Kedro soon, since we have identified a few ways to improve it, but this won't happen at least until the first quarter of 2020. Meanwhile, if people need to create their own framework on top of the library code of Kedro, the easiest way to do that is to create their own context creating function and ditch the one we have provided. |
|
This argument is a very unfair and incorrect interpretation of my comment. Framework code by definition is the code creating the structure of your application (hence the word framework). There is no intermingling of library code with framework code, no library components depend on the existence of a framework. You can find more information about the current architecture of Kedro here and how different components interact with each other. People can still just For more advanced users there's always the option of dropping the framework and creating their own structure (or framework), be it through custom project templates, custom context-like structures or whatever they see fit. Redesigning the framework part of Kedro is needed due to our users identifying many additional usecases where they can use the framework to simplify their work. However we are still exploring what that restructuring should look like in order to be more extensible and able to fit the most common usecases without any unnecessary configuration. We will provide more details once we have the issue well documented. |
|
First, thank you your work on Kedro! |
@philippegr Thank you for raising this! As @idanov mentioned above, our architecture change in framework code is in our plan in the first quarter of this year, mainly improving the usability of KedroContext (and |
@philippegr My teams projects currently all run from a modified form of the In essence this is how we are loading context without touching the path. import os
from pathlib import Path
from kedro.context import load_context
project_path = Path(__file__).parents[1].resolve() # needs to be the directory with your .kedro.yml file and conf
_working_dir = os.getcwd() # save current working directory before kedro moves it
context = load_context(project_path)
os.chdir(_working_dir) # move back to the current working directory |
@921kiyo I am Excited to see the upcoming architecture changes this quarter! Thanks for all of the hard work. |
We have made the source directory configurable with source_dir: . Or source_dir: src/nested/ if It will be released in the next release, so I'm closing this issue, but do let us know if you have any questions/comments. We are still continuing on the framework redesign, so more refactoring is coming soon :) |
Thank you very much. Looking forward to this next release! |
See the more up-to-date solution here: #1836 (reply in thread) |
Description
This line in library code makes assumptions about the user code (i.e. that the directory
src
exists). This used to be inkedro_cli.py
where all "frameworky" decisions are made, but now it is hidden (and undocumented), and the user is no longer able to change it.Context
Working on a project where
src
does not exist - I would like to modify the python path myself (or at least have control over what gets added or not)I understand that this is probably there to make this work both in jupyter/ipython and when running cli commands - however assumptions about user code should not be in library code.
The text was updated successfully, but these errors were encountered: