Skip to content
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

Use znjson instead of znframe #481

Merged
merged 19 commits into from
Jun 18, 2024
Merged

Use znjson instead of znframe #481

merged 19 commits into from
Jun 18, 2024

Conversation

PythonFZ
Copy link
Member

@PythonFZ PythonFZ commented Jun 15, 2024

This PR replace the use of the znframe package with a definition on how to convert / read ase.Atoms from json strings through the use of znjson.

  • Bond calculation through vis is now optional by setting vis.bonds_calculator=None.
  • radii are now a rescaled version of covalent_radii from ase

Old ideas

Thereby I also looked into making computing the bonds optional.
Bonds computation can be expensive, thus loading the trajectory and visualizing it first and adding the bonds afterwards would be my prioritized way of doing things. We could use two celery workers for this:

  1. start read
  2. whilst still reading already process what is in the db. (on rare occasions this could be faster than 1. thus we need 3)
  3. After reading has finished, run another worker to check if all bonds have been computed.

Where do we want to define if bonds should be computed? E.b. ZnDraw(bonds=True)? Via the CLI?

Further this PR now uses covalent_radii from ase. VdW are too large, even covalent look a bit weird compared to what we had before.

  • test types after znjson.loads
  • test inf data file reading

@PythonFZ PythonFZ linked an issue Jun 15, 2024 that may be closed by this pull request
@PythonFZ
Copy link
Member Author

Radii for np.nan values

@codecov-commenter
Copy link

codecov-commenter commented Jun 15, 2024

Codecov Report

Attention: Patch coverage is 86.71875% with 17 lines in your changes missing coverage. Please review.

Project coverage is 52.89%. Comparing base (acdf27d) to head (dd6fdb4).

Files Patch % Lines
zndraw/zndraw.py 72.22% 5 Missing ⚠️
zndraw/modify/__init__.py 0.00% 4 Missing ⚠️
zndraw/tasks/__init__.py 42.85% 4 Missing ⚠️
zndraw/utils.py 96.82% 2 Missing ⚠️
zndraw/base.py 66.66% 1 Missing ⚠️
zndraw/scene.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #481      +/-   ##
==========================================
+ Coverage   49.45%   52.89%   +3.44%     
==========================================
  Files          26       28       +2     
  Lines        2010     2142     +132     
==========================================
+ Hits          994     1133     +139     
+ Misses       1016     1009       -7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@PythonFZ PythonFZ requested a review from RokasEl June 15, 2024 15:09
@PythonFZ PythonFZ linked an issue Jun 15, 2024 that may be closed by this pull request
Copy link
Collaborator

@RokasEl RokasEl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think use_bonds should be a flag in the CLI. Having control via python would also be nice.

@PythonFZ PythonFZ merged commit 656ac68 into main Jun 18, 2024
4 checks passed
@PythonFZ PythonFZ deleted the 201-use-znjson branch June 18, 2024 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

unable to read extxyz with inf Use znjson
3 participants