-
Notifications
You must be signed in to change notification settings - Fork 7
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
Migrate to aiida-core 2.0 #331
Conversation
unkcpz
commented
Mar 9, 2022
•
edited
Loading
edited
- Update readme to have a aiida-core dep matrix, since it is not backward compatible. Will then have the major version changed.
Codecov Report
@@ Coverage Diff @@
## develop #331 +/- ##
===========================================
+ Coverage 93.03% 93.05% +0.02%
===========================================
Files 32 32
Lines 1363 1353 -10
===========================================
- Hits 1268 1259 -9
+ Misses 95 94 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it 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.
You don't seem to be updating the AiiDA version in this PR?
Ah sorry - this was still a draft - never mind me :) |
Hi @CasperWA, I see you add commits to the PR, thanks! Sorry that I am late to finish this clearly, I was distracted by other projects and just recovered from COVID. There are two things in the TODO list for this migration to v2.0.0: 1. There are lots of deprecation warnings need to be take care which means use the old API that not being supported. 2. For the loglevel, I change INFO to REPORT which I think it is not proper. The better solution is to use logging for aiida-optimade rather that call click log which will using aiida-core loglevel setting. |
48f6725
to
ea40e21
Compare
@CasperWA I revert the echo_report to echo_info by explicitly setting aiida.cmdline log level to |
75adadb
to
026e96b
Compare
At this point in time, one indeed needs to initialize/prime (run |
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.
This is looking really good.
Please remove the .vscode
folder (and maybe add it to your global .gitignore
file, see e.g., this StackOverflow answer on how to set that up).
Let me just merge in Edit: Done. |
Hi Casper, just to be clear: it's happening even when first initialization has already been run, but afterwards when adding new structures this problem occurs. E.g. it contradicts the README sentence of
However, i'm not sure if this problem was already there before or this PR introduced this (I currently don't have aiida < 2.0 to test quickly). |
Right! Let's just create an issue for it then, and we/I can take a look at it. Ah - just remembering now. It might be really important to inspect this part of the code and whether it should be updated. I needed to go directly through the specific backend to update node extras in bulk. This might have changed in the new version. |
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.
@CasperWA thanks for reviewing. I adopt most of your suggestions. And leave some open questions. Please have another look when you are avaliable.
|
||
with get_manager().get_backend().transaction() as session: | ||
session.query(DbNode).filter(DbNode.id == self._pk).update( | ||
values={"extras": extras} |
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.
Here could be the issue mentioned by @eimrek rooted. As I TODO comment above, I guess you did not load_node
and call (re)set_extra
from performance consideration? I think there may be a way to use sqla interface to do this without performance issue?
I'd like to @sphuber for a comment. The purpose of the code here was simply to update extras
attributes. Is calling load_node(<pk>)
then set_extras
at the expense of efficiency? If so how to do it properly with sqla directly?
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.
To be honest I am not sure anymore how much going to our front-end slows down these queries. It would be good to test since it has been refactored a lot and the slowdown may not be so bad anymore compared to before. If that is the case, I would definitely advise going through the front-end such that all storage backends are automatically supported, especially now that they are pluginnable with aiida v2.0.
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 fair enough, and some benchmarking would be more than welcome. I'm pretty sure this will come out to still be faster, as the Node is never (supposedly) retrieved from the database, but rather a specific DB row's extras
column is updated.
1883537
to
c536639
Compare
I check with old version, it also has this problem. And I guess this is why we need |
I have to remove support to python3.10 for the moment, since it rely on |
Screen.Recording.2022-05-31.at.21.32.08.movScreen.Recording.2022-05-31.at.21.35.45.mov@sphuber @CasperWA Here are some benchmarks about direct load node and update extras with aiida API and using |
Also add the dep matrix as like |
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.
The matrix looks nice - although it's a bit confusing with the naming, so I changed that a bit. Also, there is no record of this repository pre v0.18, which is a bit confusing as well, but I suppose it's not that relevant.
4226d8e
to
4ea0e9a
Compare
@CasperWA thanks! All changed. |
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.
Great work @unkcpz !
I'll add a fix for the CI to use |
This is temporary until aiida-optimade works with OPTIMADE Python tools v0.19 and above.
@CasperWA thanks! But seems the change fail the tests, any idea? I can have a close look into it later today, or do you already have a clue and working on it? |
Yeah - I have no idea why, |
It seems OPTIMADE Python tools has the same issue Indeed, a work-around is underway, see Materials-Consortia/optimade-python-tools#1317. |
New pydantic release is due in a few minutes, so the old Dockerfile will work again. I also pinned the Docker deps in Materials-Consortia/optimade-python-tools#1315 so this problem shouldn't occur again. |
@ml-evs thanks a lot! I retrigger the tests, hope it works fine now. |
I just released v0.19.2 which includes the fix for self-built docker images (which I think is what you are doing here) and also the 2D structure CIF export bug that was reported at the workshop. I'd recommend upgrading! |
The 3.7 test failures are caused by us dropping Python 3.7 support, which we did mostly because AiiDA 2.0 also dropped it 😅 The other tests look like you just need to pass through the config value for |
I don't understand why this is related to py3.7, the CI docker test is all run for py3.8. |
I only meant for the other PR you linked, #375. Here, everything should be fixed if you change |
I see, thank you! I'll take care of that. |
This reverts commit dd1b909.
I just reverted my latest "fix" then - I do indeed think we need to add the |
I agree. I open an issue at #379. Not sure if all the image parameters are configurable. I have used it to replace the dedicated branch in materials cloud for optimade-index |