-
Notifications
You must be signed in to change notification settings - Fork 17
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
Delayed import of scikit-learn and pandas + other dependency tweaks #412
Conversation
Tests are failing, not sure why. Will enable screenshots first in #411 to debug this. |
To reproduce the failing test, you can launch a docker container and run the failed notebook with the branch. |
5f89422
to
3043e3a
Compare
for more information, see https://pre-commit.ci
Hi @danielhollas, just request review again when you think this is ready. |
@unkcpz I need to fix one of the XPath selector to fix the new test, but otherwise this is good to review. EDIT: Tests are passing |
setup.cfg
Outdated
spglib~=1.14 | ||
vapory~=0.1.2 | ||
python_requires = >=3.8 | ||
include_package_data = True | ||
zip_safe = False | ||
|
||
[options.extras_require] | ||
smiles = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure about this, if you want "smiles" related packages installed by aiidalab install
, it not supports install from extras dependencies yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's okay I think, because I can declare the dependency in my setup.cfg with these extras dependencies, so it should pull the package from pip.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, this is clever, but only for packages like aiidalab-widgets-base
and when we not treat it as "app" anymore. Anyway, good for the change here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that is a good point. But @yakutovicha said many times he wants to turn AWB into library anyways, so it should be okay.
@danielhollas I think you have permission to merge, correct? I'll leave it to you in case you still want to add things. It is all good to me. |
I don't have permission to merge actually. This is good to go from my side.
Yes, that would be great. I suspect this PR alone does not bring performance improvements much. Pandas is still imported by |
@yakutovicha can you confirm it's okay to delete |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am a bit concerned by some changes in this PR. Specifically, I don't see a need of separating dev
into dev
and testing
. All packages will be installed during the CI run anyways. Some while ago we actually did the opposite thing: we merged them together into dev
.
Various tweaks to dependencies:
Delayed import of scikit-learn and bokeh.
Both of these are very large packages that may negatively impact startup time, so it makes sense to import them only when necessary. It would be great to get rid of them altogether. We use pandas only to generate HTML tables from python dictionaries. Perhaps there is a more lightweight solution for that. Sklearn is only used to do PCA in SmilesWidget, I'll try to remove it in another PR.
Declare rdkit and sklearn as optional dependencies for SmilesWidget.
Add basic test for SmilesWidget
Updated test dependencies and moved them from
setup.cfg
torequirements_test.txt
, same way as in QeApp. The pip installation on GHA went from 1 minute to 5 seconds so this is worthwhile.Removed stale
requirements.json
file. I am assuming it is not needed given thesetup.cfg
but correct me if I am wrong.I added this to the milestone, since we're removing sklearn as a direct dependency, which might potentially break apps that relied on it. Note that SmilesWidget was already broken in principle, since rdkit is not installed in the new docker stack. At least now apps can reliably install needed dependencies by specifying
aiidalab-widgets-base[smiles]
.