You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is, as we want a not-dependency-intensive neetbox, we are trying to remove codes with heavy dependencies from core functions. To be specific, in order to avoid installing package 'thop'(which depends on torch) for non-torch users, we have removed import torch from the headings of each python file into the line where the packages are required to overcome the import errors for most of the packages. For example, in neetbox.torch.profile:
It was simple until we added neetbox.integrations. I'm not a pro for Python things, but I found it much more clear if we move things related to third parties into neetbox.integrations. So what does the neetbox.integrations stand for? In general, neetbox.integrations contains plugins for the original neetbox codes which empowers neetbox with third-party-compbilities.
I first mentioned the idea in #19 , in which I suggest that we should move 'nvidia-smi' and 'conda' command line getters out of neetbox.utils. However, since I'm a little confused about how to effectively add plugins into python class, I'm not sure what to do next to form the general framework for neetbox.integrations. Anyway, I think I need some help. Further discussions and methods are welcomed and appreciated.
I think we can use modulefinder a builtin python module to integrate nvidia-smi or conda like command, and achieve the goal above. here is the doc. modulefinder
Activity
PommesPeter commentedon Mar 24, 2023
I think we can use
modulefindera builtin python module to integratenvidia-smiorcondalike command, and achieve the goal above. here is the doc. modulefindervisualDust commentedon Apr 11, 2023
Currently, I'm trying with patch as a workaround. But I think it's not gonna be so easy. I will put my new ideas here as soon I get them.
Not to mention, an example here:
The code adds a new function caller 'write_tensorboard' into class Logger. So later in my code, I can do such thing:
visualDust commentedon Apr 11, 2023
It's a kinda solution, but idk how my IDEs perform with the code completion... I'll find it out later when I have time.
visualDust commentedon Apr 11, 2023
Another example for
patchinneetbox.utils.utils:visualDust commentedon Apr 11, 2023
@PaperCube @PommesPeter What do you think? Do you find it plausible?
visualDust commentedon Apr 11, 2023
I'm running out of ideas. I'm rubbish indeed.
PaperCube commentedon Apr 12, 2023
I think
@patchis a nice design. Nevertheless, I think traditional OOP abstract classes might also be a feasible solution.visualDust commentedon Nov 26, 2023
another approach scans all submodules in
neetbox.integrationsand let them register a self loading function after workspace is loaded. #72cbcc66d
it's kinda piece of scaffold, I will make it into a stronger implementation later, just keep you guys up to date.
PommesPeter commentedon Nov 27, 2023
So, how should we design the
neetbox.intergrations.